GitHub Actions Workflow Security Review
Skill7 starsChanged 5 months agoMITView on GitHub
Reviews GitHub Actions workflow diffs for script injection of untrusted input, pull_request_target with untrusted checkout, over-broad GITHUB_TOKEN permissions, and unpinned third-party actions.
- Reads credentials
In this repository140 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- static/llms.txtllms.txt
- ask-codexSkill
- river-review-disciplineSkill
- skill-creatorSkill
- skill-ops-plannerSkill
- skill-optimizerSkill
- commandsSkill
- adversarial-reviewSkill
- review-teamSkill
- river-review-architectureSkill
- river-review-codeSkill
- river-review-docsSkill
- river-review-frontendSkill
- river-review-performanceSkill
- river-review-security-auditSkill
- river-review-securitySkill
- river-reviewSkill
- river-review-testingSkill
- unknown-coverage-reviewSkill
- Coverage and Failure Path GapsSkill
- Flaky Test Risk CheckSkill
- Standard Review Policy for DownstreamSkill
- Test Assertion Effectiveness 常に PASS するテストの検出Skill
- Test Presence for Changed CodeSkill
- Test Naming and StructureSkill
- テスト観点レビュー(差分ドリブン)Skill
- a11y Accessible Name BasicsSkill
- Agent Skill Bridge ReviewSkill
- Altitude Generalization GuardSkill
- API Compatibility and Test Gap ReviewSkill
- Assumption Resolution Trace Plan の前提解消トレーサビリティSkill
- Async Correctness 非同期処理の正しさ検証Skill
- Behavior-Structure Separation 振る舞い変更と構造変更の分離・外部挙動維持Skill
- Closure Scope Retention GuardSkill
- Component Variants / States Documentation コンポーネント状態の文書化Skill
- Configuration File ReviewSkill
- Cross-File Leakage リファクタ後の caller 側残骸検出Skill
- Design Source-of-Truth Conformance デザイン定義準拠Skill
- Design System Component Reuse GuardSkill
- Design Token EnforcementSkill
- Detector Detection Power 検査器の検出力の検証Skill
- Documentation Hygiene ドキュメント衛生Skill
- End-to-End Wiring 末端到達・貫通の検証Skill
- Existing-Pattern Conformance 既存パターン準拠の確認Skill
- Firebase Security Rules ReviewSkill
- Fix Scope Integrity 指摘対応ループのスコープ逸脱・前提破壊検出Skill
- GitHubレビューコメント対応(修正案つき)Skill
- Hallucinated Reference 幻覚的参照の実在確認Skill
- Hello Skill (Always-On Sample)Skill
- i18n Unused Key ReviewSkill
- Impact Evidence Coverage 影響・失敗系・外部依存の証拠充足Skill
- Independent Review SynthesisSkill
- Invisible Unicode Injection Scan 不可視 Unicode コード注入検出Skill
- Knowledge-to-Code Alignment 新知識のコード反映・設計知識の保全Skill
- Laravel Eloquent N+1 and Query Efficiency ReviewSkill
- Laravel Mass Assignment and Authorization ReviewSkill
- The first 60 shown.
The file
Files
Pattern declaration
Primary pattern: Reviewer Secondary patterns: Inversion Why: workflow の意味的なセキュリティ判断(権限の必要性・トリガーの用途)に集中し、決定論ツールが見ない文脈を検査する
Goal / 目的
- untrusted input の式展開によるスクリプトインジェクションと、特権トリガー + untrusted checkout(pwn request)を検出する。
- GITHUB_TOKEN の過剰権限と third-party action の未ピン留めを検出する。
Non-goals / 扱わないこと
- 構文的に決定論で判定できる領域(pinned-dependencies / token-permissions の機械検出)は OpenSSF Scorecard / zizmor / CodeQL に委ねる(重複指摘しない)。
- workflow のロジック・効率(セキュリティ以外)。
Pre-execution Gate / 実行前ゲート
このスキルは以下の条件がすべて満たされない限りNO_REVIEWを返す。
- 差分に
.github/workflows/配下の追加変更が含まれている - diff コンテキストが利用可能である
ゲート不成立時の出力: NO_REVIEW: gha-workflow-security — workflow の変更なし
False-positive guards / 抑制条件
- 同一 repo / 自 org 内 action(
./.github/actions/...、自 org reusable workflow)はピン留め不要とする運用が一般的。minor 以下に留める。 actions/*公式 action の tag 運用は third-party より低リスク。minor 扱い。if:条件式内の式展開、github.event.*.number/github.sha/github.actor等の数値・制約付きフィールドは原則安全。- checkout なし、または base ref checkout のみの
pull_request_targetは安全パターン。 - repo 可視性が不明な self-hosted runner は major でなく warning + 確認依頼にする。
Rule / ルール
- 攻撃者制御フィールド(
github.event.issue.title/.body、pull_request.title/.body/.head.ref、comment.body、commits.*.message、github.head_ref等)をrun:に直接式展開しない。env:経由で変数化する。 pull_request_target/issue_comment/workflow_runでhead.sha/head.refを checkout して PR 由来コードを実行しない(secrets + write 権限の文脈での RCE)。permissionsは top-level をcontents: readにし、write は必要な job 単位で昇格する(write-allを避ける)。- third-party action は full-length commit SHA でピン留めする(バージョンコメント併記を推奨)。
Evidence / 根拠の取り方
- 指摘は
<file>:<line>で差分に紐づけ、出典(securitylab.github.com / docs.github.com の secure-use)を 1 行で添える。 - 重要度: untrusted input の
run:直挿し /pull_request_target+ head checkout = critical、permissions 過剰 / public self-hosted = major、tag ピン / persist-credentials = minor。
Output / 出力(短文版の推奨)
コメントは日本語で返す。
- Finding: インジェクション / pwn request / 過剰権限 / 未ピンのどれか(1文)
- Impact: RCE / secrets 漏えい / 権限昇格
- Fix: env 経由 / トリガー分離 / job 単位 permissions / SHA ピンの最小案
Sources / 出典
- GitHub — Secure use of GitHub Actions: https://docs.github.com/en/actions/reference/security/secure-use
- GitHub Security Lab — Preventing pwn requests: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
- GitHub Security Lab — Untrusted input: https://securitylab.github.com/resources/github-actions-untrusted-input/
- OpenSSF Scorecard checks: https://github.com/ossf/scorecard/blob/main/docs/checks.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

