security: stop leaking signing secrets via shell interpolation / argv (PER-8611, PER-8612)#2281
Open
Shivanshu-07 wants to merge 1 commit into
Open
security: stop leaking signing secrets via shell interpolation / argv (PER-8611, PER-8612)#2281Shivanshu-07 wants to merge 1 commit into
Shivanshu-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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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