跳到主内容
智客 ZICQ

技能库 智客分类:安全测试 gha-security-review

Gha Security Review

GitHub行动对工作流程开发脆弱性的安全审查。 当被请求用于"审查GitHub Actions","审计工作流程","检查CI安全","GHA安全","工作流程安全审查",或针对pwn请求审查.github/workflows/,表达注入,证书盗窃,以及供应链攻击. 以具体的《行动纲领》设想方案为重点进行开发.

4160 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

GitHub 工作流程开发脆弱性行动安全审查

何时用

要求"审查 GitHub 动作","审计工作流程","检查CI安全","GHA安全","工作流程安全审查",或审查. github/workflows/用于pwn请求,表达注射,证书盗窃,以及供应链攻击. 以具体的《行动纲领》设想方案为重点的利用

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:GitHub Actions Security Review、Scope、Files to Review、Out of Scope、Threat Model、Confidence。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/pwn-request.md、references/comment-triggered-commands.md、references/expression-injection.md、references/credential-escalation.md、references/ai-prompt-injection-via-ci.md、references/supply-chain.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

GitHub Actions security review for workflow exploitation vulnerabilities. Use when asked to "review GitHub Actions", "audit workflows", "check CI security", "GHA security", "workflow security review", or review .github/workflows/ for pwn requests, expression injection, credential theft, and supply chain attacks. Exploitation-focused with concrete PoC scenarios.

GitHub Actions Security ReviewScopeFiles to ReviewOut of ScopeThreat ModelConfidenceStep 1: Classify Triggers and Load ReferencesStep 2: Check for Vulnerability ClassesCheck 1: Pwn RequestCheck 2: Expression InjectionCheck 3: Unauthorized Command ExecutionCheck 4: Credential Escalation

· allowed-tools:Read, Grep, Glob, Bash, Task

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
gha-security-review
description
GitHub Actions security review for workflow exploitation vulnerabilities. Use when asked to "review GitHub Actions", "audit workflows", "check CI security", "GHA security", "workflow security review", or review .github/workflows/ for pwn requests, expression injection, credential theft, and supply chain attacks. Exploitation-focused with concrete PoC scenarios.
allowed-tools
Read, Grep, Glob, Bash, Task实验字段,支持情况取决于客户端;字段声明本身不会授予工具权限。
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 9
  • references/pwn-request.md
  • references/comment-triggered-commands.md
  • references/expression-injection.md
  • references/credential-escalation.md
  • references/ai-prompt-injection-via-ci.md
  • references/supply-chain.md
  • references/permissions-and-secrets.md
  • references/runner-infrastructure.md
  • references/real-world-attacks.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「gha-security-review」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-66529aeeb3ad8c20-GHA-%E5%AE%89%E5%85%A8%E5%AE%A1%E6%9F%A5.html
请存为 .cursor/skills/gha-security-review/SKILL.md 或 .claude/skills/gha-security-review/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/getsentry/skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/getsentry/skills' --list

npx skills add 'https://github.com/getsentry/skills' --skill 'gha-security-review'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: gha-security-review description: 'GitHub Actions security review for workflow exploitation vulnerabilities. Use when asked to "review GitHub Actions", "audit workflows", "check CI security", "GHA security", "workflow security review", or review .github/workflows/ for pwn requests, expression injection, credential theft, and supply chain attacks. Exploitation-focused with concrete PoC scenarios.' allowed-tools: Read, Grep, Glob, Bash, Task --- # 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 definitions - `action.yml` / `action.yaml` — composite actions in the repo - `.github/actions/*/action.yml` — local reusable actions - Config 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_dispatch` input injection — requires write access to trigger - Expression injection in `push`-only workflows on protected branches - `workflow_call` input injection where all callers are internal - Secrets 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: 1. **Entry point** — How does the attacker get in? (fork PR, issue comment, branch name, etc.) 2. **Payload** — What does the attacker send? (actual code/YAML/input) 3. **Execution mechanism** — How does the payload run? (expression expansion, checkout + script, etc.) 4. **Impact** — What does the attacker gain? (token theft, code execution, repo write access) 5. **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/checkout` with `ref:` pointing to PR head - Look for local actions (`./.github/actions/`) that would come from the fork - Check 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 every `run:` step - Confirm 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, not `if:`, `with:`, or job-level `env:` ### Check 3: Unauthorized Command Execution Does an `issue_comment`-triggered workflow execute commands without authorization? - Is there an `author_association` check? - 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`, `.cursorrules` - Build 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/*` or `github/*` on version tags - Do **not** flag same-repo / vendored (`./.github/actions/...`) as supply-chain pinning issues - Only 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: 1. **Read the full workflow** — don't rely on grep output alone 2. **Trace the trigger** — confirm the event and check `if:` conditions that gate execution 3. **Trace the expression/checkout** — confirm it's in a `run:` block or actually references fork code 4. **Confirm attacker control** — verify the value maps to something an external attacker sets 5. **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 ````markdown ## 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."

相关技能

安全测试

Skill Vetter

人工智能特工的安全第一技能审查。 在安装来自 ClawdHub, GitHub 或其他来源的任何技能之前使用 。 检查红旗,许可范围,可疑图案.

安全测试

Moltguard

MoltGuard——由OpenGuardrails担任OpenClaw保安. 安装 MoltGuard 以保护你和你的人类免受迅速注射、数据过滤和恶意命令的影响。 资料来源:https://github.com/openguardrails/openguardrails/tre…

安全测试

Security Auditor

用于审查安全漏洞代码,实施认证流,审计OWASP Top 10,配置CORS/CSP头,处理秘密,输入验证,SQL注射预防,XSS保护,或任何与安全相关的代码审查.

安全测试

Skill Vetter

安装任何AI代理技能前的安全审查协议. 红旗侦取入证盗取,疏通密码,放出. 风险分类:低/中/高/高。 编制结构化审查报告。 不先运行此功能, 绝不安装不信任的技能 .