gha-security-review by getsentry/skills
npx skills add https://github.com/getsentry/skills --skill gha-security-review在 GitHub Actions 工作流中发现可利用的漏洞。每个发现必须包含一个具体的利用场景——如果你无法构建攻击,就不要报告它。
此技能编码了来自真实 GitHub Actions 漏洞利用的攻击模式——而非通用的 CI/CD 理论。
审查提供的工作流(文件、差异或仓库)。在报告前,根据需要研究代码库以追踪完整的攻击路径。
.github/workflows/*.yml — 所有工作流定义action.yml / action.yaml — 仓库中的复合操作.github/actions/*/action.yml — 本地可重用操作CLAUDE.md、AGENTS.md、Makefile、.github/ 下的 shell 脚本广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
仅报告可由外部攻击者利用的漏洞——即没有仓库写入权限的人。攻击者可以从复刻仓库创建 PR、创建问题以及发表评论。他们无法推送到分支、触发 workflow_dispatch 或触发手动工作流。
不要标记需要写入权限才能利用的漏洞:
workflow_dispatch 输入注入——需要写入权限才能触发push 触发的工作流中的表达式注入workflow_call 输入注入workflow_dispatch/schedule 触发的工作流中的密钥仅报告高和中置信度的发现。不要报告理论性问题。
| 置信度 | 标准 | 操作 |
|---|---|---|
| 高 | 追踪了完整的攻击路径,确认可利用 | 报告,附带利用场景和修复方案 |
| 中 | 攻击路径部分确认,存在不确定环节 | 报告为需要验证 |
| 低 | 理论性的或已在其他地方缓解 | 不报告 |
对于每个高置信度发现,提供全部五个要素:
如果你无法构建全部五个要素,则报告为中置信度(需要验证)。
对于每个工作流,识别触发器并加载相应的参考:
| 触发器 / 模式 | 加载参考 |
|---|---|
pull_request_target | references/pwn-request.md |
带命令解析的 issue_comment | references/comment-triggered-commands.md |
run: 块中的 ${{ }} | references/expression-injection.md |
| PAT / 部署密钥 / 提升的凭据 | references/credential-escalation.md |
| 检出 PR 代码 + 配置文件加载 | references/ai-prompt-injection-via-ci.md |
| 第三方操作(特别是未固定的) | references/supply-chain.md |
permissions: 块或密钥使用 | references/permissions-and-secrets.md |
| 自托管运行器、缓存/制品使用 | references/runner-infrastructure.md |
| 任何已确认的发现 | references/real-world-attacks.md |
有选择地加载参考——仅加载与发现的触发器相关的内容。
工作流是否使用 pull_request_target 并检出复刻代码?
ref: 指向 PR 头部的 actions/checkout./.github/actions/)run: 步骤执行来自已检出 PR 的代码在外部可触发的工作流中,run: 块内是否使用了 ${{ }} 表达式?
run: 步骤中的每个 ${{ }} 表达式run: 块中,而不是在 if:、with: 或作业级的 env: 中由 issue_comment 触发的工作流是否在没有授权的情况下执行命令?
author_association 检查?不受信任的代码是否可以访问提升的凭据(PAT、部署密钥)?
工作流是否从 PR 提供的文件加载配置?
CLAUDE.md、AGENTS.md、.cursorrulesMakefile、shell 脚本第三方操作是否已安全地固定?
工作流权限是否最小化?密钥范围是否适当?
自托管运行器、缓存或制品的使用是否安全?
在报告之前,检查模式是否实际上是安全的:
| 模式 | 安全原因 |
|---|---|
使用 pull_request_target 但不检出复刻代码 | 从不执行攻击者代码 |
run: 中的 ${{ github.event.pull_request.number }} | 仅为数字——不可注入 |
${{ github.repository }} / github.repository_owner | 仓库所有者控制此值 |
${{ secrets.* }} | 不是表达式注入向量 |
if: 条件中的 ${{ }} | 由 Actions 运行时评估,而非 shell |
with: 输入中的 ${{ }} | 作为字符串参数传递,非 shell 评估 |
| 固定到完整 SHA 的操作 | 不可变引用 |
pull_request 触发器(非 _target) | 在复刻上下文中运行,使用只读令牌 |
workflow_dispatch/schedule/推送到受保护分支中的任何表达式 | 需要写入权限——在威胁模型之外 |
关键区别: ${{ }} 在 run: 块中很危险(shell 扩展),但在 if:、with: 和作业/步骤级的 env: 中是安全的(Actions 运行时评估)。
在包含任何发现之前,请阅读实际的工作流 YAML 并追踪完整的攻击路径:
if: 条件run: 块中或实际引用了复刻代码如果任何环节中断,标记为中置信度(需要验证)或放弃该发现。
如果检查没有产生任何发现,报告零发现。不要捏造问题。
## GitHub Actions 安全审查
### 发现
#### [GHA-001] [标题] (严重性: 严重/高/中)
- **工作流**: `.github/workflows/release.yml:15`
- **触发器**: `pull_request_target`
- **置信度**: 高 — 通过攻击路径追踪确认
- **利用场景**:
1. [分步攻击]
- **影响**: [攻击者获得什么]
- **修复**: [修复问题的代码]
### 需要验证
[中置信度项目,附带需要验证内容的解释]
### 已审查并确认安全
[已审查并确认安全的工作流]
如果没有发现:"未识别到可利用的漏洞。所有工作流已审查并确认安全。"
每周安装量
148
仓库
GitHub 星标数
454
首次出现
2026年3月3日
安全审计
安装于
codex136
gemini-cli136
cursor136
kimi-cli135
amp135
cline135
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.
Review the workflows provided (file, diff, or repo). Research the codebase as needed to trace complete attack paths before reporting.
.github/workflows/*.yml — all workflow definitionsaction.yml / action.yaml — composite actions in the repo.github/actions/*/action.yml — local reusable actionsCLAUDE.md, AGENTS.md, Makefile, shell scripts under .github/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_dispatch input injection — requires write access to triggerpush-only workflows on protected branchesworkflow_call input injection where all callers are internalworkflow_dispatch/schedule-only workflowsReport 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:
If you cannot construct all five, report as MEDIUM (needs verification).
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 |
Load references selectively — only what's relevant to the triggers found.
Does the workflow use pull_request_target AND check out fork code?
actions/checkout with ref: pointing to PR head./.github/actions/) that would come from the forkrun: step executes code from the checked-out PRAre ${{ }} expressions used inside run: blocks in externally-triggerable workflows?
${{ }} expression in every run: steprun: block, not if:, with:, or job-level env:Does an issue_comment-triggered workflow execute commands without authorization?
author_association check?Are elevated credentials (PATs, deploy keys) accessible to untrusted code?
Does the workflow load configuration from PR-supplied files?
CLAUDE.md, AGENTS.md, .cursorrulesMakefile, shell scriptsAre third-party actions securely pinned?
Are workflow permissions minimal? Are secrets properly scoped?
Are self-hosted runners, caches, or artifacts used securely?
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 conditions |
Key distinction: ${{ }} is dangerous in run: blocks (shell expansion) but safe in if:, with:, and env: at the job/step level (Actions runtime evaluation).
Before including any finding, read the actual workflow YAML and trace the complete attack path:
if: conditions that gate executionrun: block or actually references fork codeIf 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.
## 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."
Weekly Installs
148
Repository
GitHub Stars
454
First Seen
Mar 3, 2026
Security Audits
Gen Agent Trust HubPassSocketWarnSnykFail
Installed on
codex136
gemini-cli136
cursor136
kimi-cli135
amp135
cline135
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
125,100 周安装
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 |
if:| Evaluated by Actions runtime, not shell |
${{ }} in with: inputs | Passed as string parameters, not shell-evaluated |
| Actions pinned to full SHA | Immutable reference |
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 |