Repository navigation
Commit 734b5e3
committed
fix: harden claude-agent workflow against script injection and untrusted triggers
Issue title/body were interpolated directly into a double-quoted bash
string via ${{ }}, letting a crafted title/body (e.g. containing a
double quote) break out and run arbitrary shell in a job with
contents/pull-requests/issues write access and both ANTHROPIC_API_KEY
and GITHUB_TOKEN available. Pass them through env: and reference as
shell variables instead.
Also add an author_association check (OWNER/MEMBER/COLLABORATOR) so
the workflow, which triggers on any issue/comment containing
"@claude", can no longer be invoked by arbitrary outside users.
Reported by an external security researcher via email.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WTkGkngvts5uHP9CjedJTg1 parent aaa8dae commit 734b5e3
1 file changed
Lines changed: 21 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
| |||
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
46 | | - | |
47 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
| |||
0 commit comments