jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Ghaセキュリティレビュー

gha-security-review

GitHub Actions(ギットハブアクションズ)の自動

⏱ ボイラープレート実装 半日 → 30分

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

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.

🇯🇵 日本人クリエイター向け解説

一言でいうと

GitHub Actions(ギットハブアクションズ)の自動

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o gha-security-review.zip https://jpskill.com/download/2919.zip && unzip -o gha-security-review.zip && rm gha-security-review.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/2919.zip -OutFile "$d\gha-security-review.zip"; Expand-Archive "$d\gha-security-review.zip" -DestinationPath $d -Force; ri "$d\gha-security-review.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して gha-security-review.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → gha-security-review フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Gha Security Review を使って、最小構成のサンプルコードを示して
  • Gha Security Review の主な使い方と注意点を教えて
  • Gha Security Review を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[スキル名] gha-security-review

<!-- StepSecurity (2025) による HackerBot Claw キャンペーン分析から得られた攻撃パターンと実世界の例: https://www.stepsecurity.io/blog/hackerbot-claw-github-actions-exploitation -->

GitHub Actions セキュリティレビュー

GitHub Actions ワークフローにおける悪用可能な脆弱性を発見します。すべての発見には具体的な悪用シナリオを含める必要があります。攻撃を構築できない場合は、報告しないでください。

このスキルは、一般的な CI/CD 理論ではなく、実際の GitHub Actions のエクスプロイトからの攻撃パターンをエンコードしています。

使用するタイミング

  • 悪用可能なセキュリティ問題について GitHub Actions ワークフローをレビューしている場合。
  • 外部の攻撃者からワークフローの実行またはシークレットの漏洩に至る具体的な攻撃パスを追跡する必要がある場合。
  • 証拠に基づいた発見のみで、ワークフローファイル、複合アクション、またはワークフロー関連スクリプトのセキュリティレビューが必要な場合。

スコープ

提供されたワークフロー(ファイル、差分、またはリポジトリ)をレビューします。報告する前に、完全な攻撃パスを追跡するために必要に応じてコードベースを調査してください。

レビューするファイル

  • .github/workflows/*.yml — すべてのワークフロー定義
  • action.yml / action.yaml — リポジトリ内の複合アクション
  • .github/actions/*/action.yml — ローカルの再利用可能なアクション
  • ワークフローによってロードされる設定ファイル: CLAUDE.mdAGENTS.mdMakefile.github/ 配下のシェルスクリプト

スコープ外

  • 他のリポジトリのワークフロー(依存関係のみをメモする)
  • GitHub App のインストール権限(関連する場合のみメモする)

脅威モデル

外部の攻撃者、つまりリポジトリへの書き込みアクセス権を持たない人物によって悪用可能な脆弱性のみを報告します。攻撃者はフォークから PR を開いたり、Issue を作成したり、コメントを投稿したりできます。ブランチへのプッシュ、workflow_dispatch のトリガー、手動ワークフローのトリガーはできません。

書き込みアクセスを必要とする脆弱性はフラグを立てないでください

  • workflow_dispatch 入力インジェクション — トリガーに書き込みアクセスが必要
  • 保護されたブランチでの push 専用ワークフローにおける式インジェクション
  • すべての呼び出し元が内部である workflow_call 入力インジェクション
  • workflow_dispatch/schedule 専用ワークフローにおけるシークレット

信頼度

HIGH および MEDIUM の信頼度の発見のみを報告します。理論的な問題は報告しないでください。

信頼度 基準 アクション
HIGH 完全な攻撃パスを追跡し、悪用可能であることを確認済み 悪用シナリオと修正を含めて報告
MEDIUM 攻撃パスが部分的に確認済み、不確実なリンク 検証が必要として報告
LOW 理論的または他の場所で軽減済み 報告しない

各 HIGH の発見について、以下の5つの要素すべてを提供してください。

  1. エントリーポイント — 攻撃者はどのように侵入しますか?(フォーク PR、Issue コメント、ブランチ名など)
  2. ペイロード — 攻撃者は何を送信しますか?(実際のコード/YAML/入力)
  3. 実行メカニズム — ペイロードはどのように実行されますか?(式展開、チェックアウト + スクリプトなど)
  4. 影響 — 攻撃者は何を得ますか?(トークン窃盗、コード実行、リポジトリへの書き込みアクセス)
  5. PoC スケッチ — 攻撃者が従う具体的な手順

これら5つすべてを構築できない場合は、MEDIUM(検証が必要)として報告してください。


ステップ1: トリガーを分類し、参照をロードする

各ワークフローについて、トリガーを特定し、適切な参照をロードします。

トリガー / パターン 参照をロード
pull_request_target references/pwn-request.md
コマンド解析を伴う issue_comment references/comment-triggered-commands.md
run: ブロック内の ${{ }} references/expression-injection.md
PATs / デプロイキー / 昇格された資格情報 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

参照は選択的にロードしてください。発見されたトリガーに関連するもののみをロードします。

ステップ2: 脆弱性クラスをチェックする

チェック1: Pwn Request

ワークフローは pull_request_target を使用しており、かつフォークコードをチェックアウトしていますか?

  • PR ヘッドを指す ref: を持つ actions/checkout を探します。
  • フォークから来る可能性のあるローカルアクション(./.github/actions/)を探します。
  • チェックアウトされた PR からコードを実行する run: ステップがあるか確認します。

チェック2: 式インジェクション

外部からトリガー可能なワークフローの run: ブロック内で ${{ }} 式が使用されていますか?

  • すべての run: ステップ内のすべての ${{ }} 式をマッピングします。
  • 値が攻撃者によって制御可能であることを確認します(PR タイトル、ブランチ名、コメント本文 — 数値 ID、SHA、リポジトリ名ではない)。
  • 式が run: ブロック内にあり、if:with:、またはジョブレベルの env: ではないことを確認します。

チェック3: 不正なコマンド実行

issue_comment によってトリガーされるワークフローが、承認なしにコマンドを実行していますか?

  • author_association チェックがありますか?
  • 任意の GitHub ユーザーがコマンドをトリガーできますか?
  • コマンドハンドラーもインジェクション可能な式を使用していますか?

チェック4: 資格情報昇格

昇格された資格情報(PATs、デプロイキー)が信頼できないコードからアクセス可能ですか?

  • 各シークレットの爆発半径はどれくらいですか?
  • 侵害されたワークフローが長期間有効なトークンを盗む可能性がありますか?

チェック5: 設定ファイル汚染

ワークフローは PR から提供されたファイルから設定をロードしていますか?

  • AI エージェントの指示: CLAUDE.mdAGENTS.md.cursorrules
  • ビルド設定: Makefile、シェルスクリプト

チェック6: サプライチェーン

サードパーティ製アクションは安全にピン留めされていますか?

チェック7: 権限とシークレット

ワークフローの権限は最小限ですか?シークレットは適切にスコープ設定されていますか?

チェック8: ランナーインフラストラクチャ

セルフホストランナー、キャッシュ、またはアーティファクトは安全に使用されていますか?

安全なパターン(フラグを立てない)

報告する前に、パターンが実際に安全であるかを確認してください。

パターン 安全な理由
フォークコードのチェックアウトを伴わない pull_request_target 攻撃者のコードは決して実行されない
run: 内の ${{ github.event.pull_request.number }} 数値のみ — インジェクション不可能
`$

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

<!-- 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.

When to Use

  • You are reviewing GitHub Actions workflows for exploitable security issues.
  • The task requires tracing a concrete attack path from an external attacker to workflow execution or secret exposure.
  • You need a security review of workflow files, composite actions, or workflow-related scripts with evidence-based findings only.

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?

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
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

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

## 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."

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.