idor
ما الذي تفعله
هذه المهارة كتيّب لإيجاد مراجع الكائنات المباشرة غير الآمنة، حيث يُستخدم معرّف عنصر دون التحقق من الملكية. وهي مخصصة للمطورين والمختبرين الذين يراجعون تطبيقاتهم أو كودًا مصرّحًا لهم باختباره.
متى تستخدمها
- ✓عندما يطلب مطور من وكيله فحص ما إذا كان تغيير معرّف في رابط أو طلب يكشف بيانات مستخدم آخر.
- ✓عندما يراجع وكيلك نقاط نهاية REST أو GraphQL أو معاملات الاستعلام التي تأخذ معرّفات كائنات.
- ✓عندما يريد فريق قائمة بنقاط النهاية التي تحتاج إلى فحص ملكية.
رابط المهارة
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/idor/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل تستطيع فحص ما إذا كان تغيير رقم الطلب في واجهة البرمجة لدينا يسمح لمستخدم برؤية فاتورة شخص آخر؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يجد وكيلك نقاط النهاية التي تأخذ معرّفات كائنات، ثم يطرح ثلاثة أسئلة على كل واحدة: هل المتصل معروف، وهل ينتمي الكائن إليه، وهل دوره مسموح له.
المحتوى التقني (ملف 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 |
الأسئلة الشائعة
ما مرجع الكائن المباشر غير الآمن؟
هو أن يستخدم التطبيق معرّفًا من الطلب لجلب عنصر دون التحقق من أن المستخدم مسموح له برؤيته.
أين تظهر هذه المعرّفات عادة؟
تسرد المهارة مسارات الروابط ومعاملات الاستعلام وأجسام 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
- آخر تحديث
- 1/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
detector-overview
6.5kيساعد وكيلك على قراءة الكود الذي أبلغ عنه فاحص أمني، وتحديد أي المواضع المُعلَّمة ثغرات أمنية حقيقية وأيها إنذارات كاذبة.
exploiter-overview
6.5kيساعد وكيلك على ربط عدة نقاط ضعف أمنية مؤكدة في سلسلة اختبار واحدة، ومعرفة مدى وصول هذه السلسلة.
llm-redteam-overview
6.5kيساعد وكيلك على إيجاد دليل الاختبار الأحمر المناسب للذكاء الاصطناعي، ويغطي 15 مجموعة تكتيكية من حقن الأوامر إلى إساءة استخدام النموذج.
aatmf-t01-prompt-injection
6.5kيشرح حقن الأوامر، حيث تحاول تعليمات مخفية تجاوز نظام الذكاء الاصطناعي، حتى يتمكن مختبرو الأمان من فحصه.
مهارات مشابهة
reverse-engineer-anything
422kيساعد وكيلك على فحص التطبيقات والحزم المنشورة من الداخل ليشرح الميزات ويقارن الإصدارات ويرشد إلى إعادة البناء، باستخدام أداة REA.
1password
394kيساعد وكيلك على إعداد واجهة سطر أوامر 1Password وتسجيل الدخول، وقراءة الأسرار أو حقنها دون طباعة قيمها في المحادثة.
healthcheck
394kيساعد وكيلك على تدقيق جهاز OpenClaw أو خادمه أمنيًا، مثل SSH والجدار الناري والتحديثات، ويقترح إصلاحات آمنة قابلة للتراجع.