idor
Skill này làm gì
Skill này là playbook để tìm tham chiếu đối tượng trực tiếp không an toàn (IDOR), khi một ID mục được dùng mà không kiểm tra quyền sở hữu. Skill dành cho lập trình viên và người kiểm thử rà soát ứng dụng của chính họ hoặc mã họ được phép kiểm tra.
Khi nào nên dùng
- ✓Khi lập trình viên yêu cầu agent kiểm tra xem việc đổi ID trong URL hoặc yêu cầu có lộ dữ liệu của người dùng khác không.
- ✓Khi agent rà soát các endpoint REST, GraphQL hoặc tham số chuỗi truy vấn nhận ID đối tượng.
- ✓Khi một đội muốn có danh sách các endpoint cần kiểm tra quyền sở hữu.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/idor/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể kiểm tra xem việc đổi số đơn hàng trong API của chúng tôi có cho người dùng xem hóa đơn của người khác không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent tìm các endpoint nhận ID đối tượng, rồi đặt ba câu hỏi cho mỗi endpoint: người gọi có được xác định không, đối tượng có thuộc về họ không, và vai trò của họ có được phép không.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 |
Câu hỏi thường gặp
Tham chiếu đối tượng trực tiếp không an toàn là gì?
Đó là khi ứng dụng dùng ID trong yêu cầu để lấy một mục mà không kiểm tra người dùng có được phép xem nó không.
Những ID này thường xuất hiện ở đâu?
Skill liệt kê đường dẫn URL, chuỗi truy vấn, thân JSON, header, claim trong JWT và đối số GraphQL.
Vì sao công cụ quét tự động khó phát hiện lỗi này?
Skill nói rằng việc phân quyền phụ thuộc vào quy tắc nghiệp vụ, nên máy quét thường không biết quyền truy cập có đúng hay không.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #13959
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.