ci: harden untrusted-checkout and pin claude-code-action to SHA (CodeQL)#32
Open
jhamon wants to merge 1 commit into
Open
ci: harden untrusted-checkout and pin claude-code-action to SHA (CodeQL)#32jhamon wants to merge 1 commit into
jhamon wants to merge 1 commit into
Conversation
Resolves 4 CodeQL alerts: - #3, #7 actions/untrusted-checkout/medium: add fork guard on contextualize-skills.yml so the workflow never runs on PRs from external forks. The checkout feeds code to an AI (claude-code-action with Write/Edit/Bash tools) with contents: write; fork PRs could inject malicious prompts. The sync/skills- pattern is automation-only from within the org. - #2, #5 actions/unpinned-tag: pin anthropics/claude-code-action@v1 to commit SHA in both contextualize-skills.yml and claude.yml. 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
Resolves all 4 open CodeQL alerts on this repo.
Alerts resolved
actions/untrusted-checkout/mediumactions/unpinned-taganthropics/claude-code-action@v1to commit SHA in both workflowsUntrusted checkout risk
The
contextualizejob checks out the PR head and feeds it to Claude Code (withWrite,Edit,Bashtools) withcontents: writeandpull-requests: writepermissions. A fork PR namedsync/skills-*could inject malicious prompts via the checked-out CLAUDE.md or skill files.The fix:
!github.event.pull_request.head.repo.forkadded to the job condition.SHA used
anthropics/claude-code-action@e90deca47693f9457b72f2b53c17d7c445a87342(=v1)Verification
ruby -ryaml).Part of PIN-16 (security tail), child of PIN-6.
🤖 Generated with Claude Code