idor
できること
このスキルは、アイテムのIDを、そのユーザーが所有しているかを確認せずに使ってしまう、安全でない直接オブジェクト参照を探す手順書です。自分のアプリや検査を許可されたコードをテストする開発者とテスター向けです。
使う場面
- ✓URLやリクエスト内のIDを変えると、他のユーザーのデータが露出しないかを開発者が確認するとき。
- ✓RESTやGraphQL、クエリ文字列のオブジェクトIDを取るエンドポイントを確認するとき。
- ✓所有者の確認が必要なエンドポイントの一覧が欲しいとき。
スキルのリンク
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/idor/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“当社のAPIで注文番号を変えると、ある利用者が他人の請求書を見られてしまうかを確認してもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、オブジェクトIDを取るエンドポイントを見つけ、各エンドポイントについて三つの質問をします。呼び出し元は確認されているか、オブジェクトは本人のものか、役割は許可されているかです。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
IDOR Hunting Playbook
IDOR is the #1 source of bug bounty payouts because it's simple, ubiquitous, and scanners can't find it (authorization is business logic). Every endpoint that takes an object ID is a candidate.
1. Sources
- URL path segments:
/api/users/123/invoices/456 - Query string:
?user_id=123 - JSON body fields:
{"orderId": 123} - Headers used as auth scope:
X-Tenant-ID,X-Customer-Id - JWT claims that downstream handlers trust:
sub,tenant,role - WebSocket subscription filters
- GraphQL arguments (
user(id: 123))
2. Audit workflow
Step 1 — enumerate object-handling endpoints
# REST
grep -rE '@(Get|Post|Put|Delete|Patch)Mapping.*\{[a-zA-Z]+Id\}' /workspace/src # Spring
grep -rE 'router\.(get|post|put|delete)\([^)]*:id' /workspace/src # Express
grep -rE '@app\.route\([^)]*<[a-z]+:' /workspace/src # Flask
grep -rE 'resources?\s+:[a-z]+' /workspace/src # Rails
# GraphQL
grep -rE 'type Query|type Mutation' /workspace/src
grep -rE '\w+\(id: ID' /workspace/src
Step 2 — for each endpoint, answer three questions
- Does it check who the caller is? (auth middleware / decorator)
- Does it check whether the object belongs to the caller? (ownership check / tenant filter in the query)
- Does it check whether the caller's role permits the action? (RBAC / policy engine)
A "no" to question 2 = horizontal IDOR (read/write other users' data). A "no" to question 3 = vertical IDOR (regular user → admin action).
Step 3 — ownership-check grep patterns
# Django: should have .filter(user=request.user) on the queryset
grep -rE 'Model\.objects\.get\(pk=' /workspace/src | grep -v 'user=request\.user'
# Rails: should have current_user.posts.find(params[:id])
grep -rE 'Post\.find\(params\[:id\]\)' /workspace/src
# Spring: should have @PreAuthorize("#id == principal.id")
grep -rE 'findById\(id\)' /workspace/src | xargs -I{} grep -L '@PreAuthorize\|@PostAuthorize'
3. High-yield patterns
GraphQL IDOR via introspection
curl -X POST https://target.com/graphql \
-H 'Content-Type: application/json' \
-d '{"query":"{ __schema { types { name fields { name args { name type { name } } } } } }"}'
Any query field that takes an id arg and lacks a custom directive
(@auth(requires: OWNER)) is a candidate. Mutations are even higher
value — they often forget ownership checks.
JWT claim trust
If the handler pulls user_id from request.user.id but also accepts
a user_id query param as override for "admin features", check whether
the override path enforces the admin claim. Frequently broken.
Mass assignment via hidden fields
User.objects.create(**request.POST.dict())
# allows POST'ing is_staff=true
4. PoC workflow
Two-account diff:
- Create account A, note
sessionAcookie andobjectAID. - Create account B, note
sessionBcookie andobjectBID. curl -b sessionA /api/objects/<objectB>— should 403.- If it returns 200 with objectB data → confirmed IDOR.
For vertical escalation:
- Normal user cookie
sessionU. - Call admin endpoint:
curl -b sessionU -X POST /api/admin/users/<victim>/role -d '{"role":"admin"}'. - Watch the response code + subsequent
GET /api/users/<victim>.
5. UUID vs integer
Sequential integer IDs make IDOR trivial. UUIDv4 makes it harder but:
- UUIDs leak in logs, emails, public URLs, support tickets
- Many apps use UUIDv1 (time-based) which is partially predictable
- Enumeration through a listing endpoint still works
- Some APIs accept both UUID and numeric ID (dual primary key)
Always test UUID endpoints — the "it's a UUID so it's safe" assumption is one of the richest hunting grounds.
6. Success signals
- HTTP 200 where you expected 403/404
- Response body contains PII/data belonging to the other account
- Role field changed on victim account
- Subsequent admin action now permitted for low-priv session
Negative control: same request with your own account's ID. Should return 200 with identical shape. Anything that returns 404 for your own account but 200 for someone else's is a confirmation signal.
7. Default CVSS
| Variant | Vector | Score |
|---|---|---|
| Horizontal read (other user PII) | AV:N/AC:L/PR:L/UI |
よくある質問
安全でない直接オブジェクト参照とは何ですか?
リクエストのIDを使ってアイテムを取得し、そのユーザーが見てよいかを確認しないことです。
これらのIDはどこに現れますか?
URLのパス、クエリ文字列、JSONの本文、ヘッダー、JWTのクレーム、GraphQLの引数が挙げられています。
なぜ自動スキャナーには難しいのですか?
認可は業務のルールに依存するため、スキャナーはアクセスが正しいかを判断できないことが多いとスキルは述べています。
詳細
作者による元の説明
Hunt Insecure Direct Object Reference (CWE-639) — missing authorization checks on object IDs. Covers horizontal vs vertical privilege escalation, UUID vs integer guessing, and GraphQL introspection-driven IDOR discovery.
人気
- GitHubのスター
- 6.5k
- ランキング
- #13959
- ライセンス
- 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、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。