+# destination: upload in the shared plist is what hands the artifact to App Store
+# Connect, and it is the only key a dry run has to change. Generating the copy beats
+# keeping a second file, which would drift the moment either channel gains an option.
+# Takes the value of the caller's own upload flag and echoes the plist to use.
+appstore_export_options() {
I've read all three changed files in full and traced every new sink:
appstore_export_options in release-env.sh — only inputs are the literal strings "true" / "false" set by the caller's --no-upload flag parsing (with a whitelist). No attacker-controllable interpolation reaches plutil, mktemp, or the resulting -exportOptionsPlist sink.
Temp file path (mktemp -t reachy-export-options).plist) — the appended .plist suffix does create a different path than the one mktemp atomically created, but mktemp on macOS uses per-user $TMPDIR under /var/folders/.../T/ (mode 700), and the 8-char random suffix makes the derived path unpredictable to other users. Not exploitable.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
=== DIFF: Scripts/release-macos.sh ===
@@ -1,9 +1,19 @@
#!/bin/bash
-# Archive the macOS app (Release, signed), export it with Developer ID,
-# notarize, staple, and zip it for distribution.
+# Archive the macOS app (Release, signed) and ship it through both distribution
+# channels: the Mac App Store (TestFlight) and Developer ID (notarized zip).
-# mise run release:macos # the whole pipeline
-# mise run release:macos -- --no-notarize # stop after the signed export
+# mise run release:macos # both channels
+# mise run release:macos -- --channel appstore # TestFlight only
+# mise run release:macos -- --channel developer-id # notarized zip only
+# mise run release:macos -- --no-notarize # developer-id: stop after signing
+# mise run release:macos -- --no-upload # appstore: export a .pkg locally
+#
+# The last two flags each belong to one channel and are ignored by the other.
+#
+# One archive feeds both exports: it is not signed for a channel, -exportArchive
+# re-signs it per method, so the two artifacts cannot differ in anything but the
+# signature. Developer ID runs first deliberately — it is the artifact that always
+# ships, and an App Store upload that fails should not also cost you the zip.
Needs a "Developer ID Application" certificate in the keychain
(Xcode → Settings → Accounts → Manage Certificates) besides the ASC API key.
+wants_appstore=false
+wants_developer_id=false
+# A case rather than two [ … ] || [ … ] && flag=true lines: that form returns
+# non-zero when neither test matches, and set -e takes the whole list's status.
+case "$channel" in
+appstore) wants_appstore=true ;;
+developer-id) wants_developer_id=true ;;
+both)
wants_appstore=true
wants_developer_id=true
;;
+esac
+# Only notarization needs the key; the App Store channel signs through the Xcode
+# account like the iOS one, for the reason release-env.sh documents.
+if [ "wants_developer_id" = true ] && [ "notarize" = true ]; then
echo "Uploaded macOS build $BUILD_NUMBER to App Store Connect. TestFlight shows it after processing (minutes)."
else
echo "Exported without uploading:"
ls "$EXPORT_DIR/AppStore"/*.pkg
fi
fi
-echo " gh release upload VERSIONZIP"
Investigate per the method in your instructions, then return the findings list.
.plist
release-macos.sh CLI parsing — strict whitelist on --channel (appstore|developer-id|both), only fixed flags accepted, no eval of args.
ZIP / VERSION / APP paths — derived from Info.plist written by xcodebuild from the developer's own project config; not attacker-influenced.
require_asc_key gating — the new gate [ "$wants_developer_id" = true ] && [ "$notarize" = true ] correctly matches the only path (notarytool submit) that actually consumes the key. The app-store channel path uses only xcodebuild -exportArchive, which authenticates via Xcode account per the documented rationale — no missing check.
Sibling-path parity — both new export blocks correctly rm -rf their own subdirectory (DeveloperID / AppStore) before export; no cross-contamination between channels.
No shell/exec injection, no SQL, no network sinks, no auth boundaries — this is a local developer release-automation change.