Skip to content

ci: harden untrusted-checkout and pin claude-code-action to SHA (CodeQL)#32

Open
jhamon wants to merge 1 commit into
mainfrom
security/harden-untrusted-checkout-and-pin-action
Open

ci: harden untrusted-checkout and pin claude-code-action to SHA (CodeQL)#32
jhamon wants to merge 1 commit into
mainfrom
security/harden-untrusted-checkout-and-pin-action

Conversation

@jhamon

@jhamon jhamon commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves all 4 open CodeQL alerts on this repo.

Alerts resolved

Alert Fix
#3, #7 actions/untrusted-checkout/medium Added fork guard to contextualize-skills.yml
#2, #5 actions/unpinned-tag Pinned anthropics/claude-code-action@v1 to commit SHA in both workflows

Untrusted checkout risk

The contextualize job checks out the PR head and feeds it to Claude Code (with Write, Edit, Bash tools) with contents: write and pull-requests: write permissions. A fork PR named sync/skills-* could inject malicious prompts via the checked-out CLAUDE.md or skill files.

The fix: !github.event.pull_request.head.repo.fork added to the job condition.

SHA used

  • anthropics/claude-code-action@e90deca47693f9457b72f2b53c17d7c445a87342 (= v1)

Verification

  • YAML parses cleanly (ruby -ryaml).
  • No behavior change for legitimate (non-fork) skill-sync PRs.

Part of PIN-16 (security tail), child of PIN-6.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant