security: stop leaking signing secrets via shell interpolation / argv (PER-8611, PER-8612)#2281
security: stop leaking signing secrets via shell interpolation / argv (PER-8611, PER-8612)#2281Shivanshu-07 wants to merge 1 commit into
Conversation
… (PER-8611, PER-8612) PER-8611 (CWE-532) — the GCP KMS key path was interpolated directly into the signtool PowerShell command, so a signing failure could surface it in the job log (bypassing GitHub's exact-string masking). Bind it via the step `env:` map (GCP_KMS_KEY_PATH) and reference `$env:GCP_KMS_KEY_PATH` instead, so redaction applies to all log output. PER-8612 (CWE-214) — the Apple app-specific password was passed to `xcrun notarytool` as a CLI argument, visible in the process table. Use notarytool's `@env:APPLE_ID_KEY` form so it is read from the environment instead of argv. Note: the `.p12` import passphrase on `security import -P` (executable.sh:59) is NOT changed here — `security import` has no env/stdin option for the passphrase, and the safe fix (keychain pre-population) is a larger rework of the signing pipeline. The GitHub-hosted macOS runner is single-tenant and ephemeral, which limits that argv-exposure window; tracked as a follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude Code PR ReviewPR: #2281 • Head: 88d1330 • Reviewers: stack:code-reviewer SummaryTwo targeted secret-leak fixes in the executable build/release:
Both introduced changes are correct. Review Table
FindingsNo Critical/High issues are introduced or worsened by this PR.
Verdict: PASS |
Summary
Fourth focused percy-cli security PR — two High-severity release-pipeline secret-handling findings (deadline 2026-06-16).
notarytoolChanges
.github/workflows/executable.yml(PER-8611): MovedGCP_KMS_KEY_PATHinto the signing step'senv:map and reference$env:GCP_KMS_KEY_PATHin the PowerShell command, instead of interpolating${{ secrets.GCP_KMS_KEY_PATH }}into therun:string. GitHub's secret redaction now applies to the value in all (including error) log output.scripts/executable.sh(PER-8612):xcrun notarytool submitnow uses--password "@env:APPLE_ID_KEY"(notarytool's documented env-var form) instead of--password $APPLE_ID_KEY, so the Apple app-specific password — which grants notarization capability under BrowserStack's Developer ID — is no longer visible in the process table.Scope note (flagged)
The
.p12import passphrase onsecurity import -P $APPLE_CERT_KEY(executable.sh:59) is not changed here:security importhas no env/stdin option for-P(confirmed against the macOSsecurityman page), so the only real fix is a keychain-pre-population rework of the signing flow — deferred to avoid risking the release pipeline. The GitHub-hosted macOS runner is single-tenant and ephemeral, which limits that argv-exposure window. Tracked as a follow-up on PER-8612.Verification
executable.ymlparses as valid YAML;bash -n scripts/executable.shpasses.GCP_KMS_KEY_PATHnow appears only in theenv:binding (not inline in the command), andnotarytoolreads@env:APPLE_ID_KEY.Closes PER-8611. Addresses the app-specific-password leg of PER-8612 (
.p12import passphrase rework flagged as follow-up).🤖 Generated with Claude Code