security: harden CI workflows — pin actions, scope tokens, fix dispatch branch injection (PER-8691/8692/8693)#1164
Open
Shivanshu-07 wants to merge 1 commit into
Open
Conversation
…ch branch injection (PER-8691/8692/8693)
Breaks the percy-ember supply-chain attack chains (C-001/C-002/C-003), whose
entry points are CI weaknesses:
- SHA-pin every third-party action across all workflows (checkout, setup-node,
cache, release-drafter, action-regex-match, stale) so a hijacked mutable tag
can't inject code into the release/test pipeline or exfiltrate NPM_TOKEN.
- Add least-privilege `permissions` to every workflow (top-level
`contents: read`; changelog → contents/PR write; stale → issues/PR write),
removing the implicit write-all GITHUB_TOKEN that amplified the chains.
- Fix the workflow_dispatch branch-injection in test.yml: bind the
user-supplied branch to an env var (`CLI_BRANCH`) and quote it in the
`git clone` instead of interpolating `${{ github.event.inputs.branch }}`
into the shell.
The runtime component findings for this repo (F-004 PERCY_SERVER_ADDRESS SSRF,
F-005 eval of network-fetched JS) are separate code fixes tracked on
PER-8681 / PER-8682.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
Impact analysis + automated reviewImpact — no existing functionality breaks. CI-config only (
|
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
Breaks the percy-ember supply-chain attack chains (deadline 2026-06-21), whose entry points are all CI weaknesses:
Changes
checkout,setup-node,cache,release-drafter,action-regex-match,stale) — a hijacked mutable tag can no longer inject code or exfiltrateNPM_TOKEN.permissionson every workflow (top-levelcontents: read;changelog→ contents/PR write;stale→ issues/PR write), removing the write-allGITHUB_TOKENthat amplified the chains.workflow_dispatchbranch-injection intest.yml: the user-supplied branch is bound to an env var (CLI_BRANCH) and quoted ingit clone, instead of interpolating${{ github.event.inputs.branch }}into the shell.Verification
All 7 workflow YAMLs parse; every workflow declares
permissions:; zero unpinneduses:; the dispatch branch is no longer interpolated inline.Closes the CI-supply-chain entry of PER-8691/8692/8693. The runtime component findings (PER-8681
PERCY_SERVER_ADDRESSSSRF, PER-8682evalof network JS) are separate code fixes tracked on those tickets.🤖 Generated with Claude Code