Skip to content

Commit b0e9853

Browse files
mmagicianclaude
andcommitted
fix: prevent pwn request vulnerability in claude-ci-autofix workflow
Restrict workflow_run trigger to PRs from the same repository (not forks) to prevent untrusted code execution in a privileged context (CWE-829, CodeQL alert #14). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4bf93ad commit b0e9853

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/claude-ci-autofix.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ permissions:
1414

1515
jobs:
1616
auto-fix:
17-
# Only run on PR branches that failed, skip branches created by this workflow
17+
# Only run on PR branches that failed, skip branches created by this workflow.
18+
# head_repository check prevents checkout of untrusted code from forks in this
19+
# privileged workflow_run context (pwn request mitigation).
1820
if: |
1921
github.event.workflow_run.conclusion == 'failure' &&
2022
github.event.workflow_run.pull_requests[0] &&
23+
github.event.workflow_run.head_repository.full_name == github.repository &&
2124
!startsWith(github.event.workflow_run.head_branch, 'claude-auto-fix-ci-')
2225
runs-on: ubuntu-latest
2326
steps:

0 commit comments

Comments
 (0)