شعار Sh Kb Access Control

Sh Kb Access Control

المجتمع
dmdhrumilmistry
sh-kb-access-control

Knowledge base for finding broken access control - IDOR/BOLA, missing function-level authorization, privilege escalation, and multi-tenant isolation failures. Use when hunting authorization issues or reviewing whether users can access resources/actions they shouldn't. CWE-284/285/639/862/863, OWASP A01:2021-Broken Access Control.

نظرة عامة

الناشرdmdhrumilmistry
المستودعsecurity-harness
اسم المهارةsh-kb-access-control
النجوم
42
التفريعات
11
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها dmdhrumilmistry على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Sh Kb Access Control في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-access-control
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dmdhrumilmistry/security-harness.git /tmp/security-harness
mkdir -p .claude/skills
cp -r /tmp/security-harness/plugins/security-harness/skills/sh-kb-access-control .claude/skills/sh-kb-access-control
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Sh Kb Access Control في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Sh Kb Access Control تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Sh Kb Access Control بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Broken Access Control - Hunter Knowledge Base

The #1 OWASP risk. The app authenticates the user but fails to check whether this user may access this resource or perform this action. Unlike injection, the bug is usually a missing or wrong check, not a dangerous sink - so hunt by comparing "who can reach this" against "who should".

Sub-classes

  • IDOR / BOLA (object-level): /api/orders/{id} returns any order because the handler looks up by id without checking ownership.
  • Missing function-level authz (BFLA): an admin-only endpoint has no role check; forced browsing to /admin/*; a mutating action reachable by a read-only user.
  • Privilege escalation: user can set their own role/tenant/flags (mass-assignment of is_admin), or a lower role reaches a higher-role action.
  • Multi-tenant isolation: queries not scoped by tenant_id/org_id; one tenant reads another's data.
  • URL-matching / verb bypass: the authz check binds to one HTTP method or exact path while the route handler accepts more - e.g. POST /admin/deleteUser is checked but GET/PUT on the same handler isn't; a reverse proxy/framework treats /ADMIN/deleteUser (case), /admin/deleteUser/ (trailing slash), or /admin/deleteUser.anything (suffix, e.g. Spring's pre-5.3 default useSuffixPatternMatch) as a different route than the one the gate matches on, but the underlying handler still resolves it. Non-standard override headers (X-Original-URL, X-Rewrite-URL) accepted by some frameworks can also change the effective path after the access-control gate has already run.
  • Multi-step process flaws: authz is enforced on an early step of a wizard/flow but not re-checked on a later step; an attacker submits the final step's request directly with the required parameters, skipping the gated steps entirely.

Sources & the key question

Every request carrying a resource identifier the client controls (path/query/body id, filename, key) or a capability (action, role, flag). For each entry point in codebase-map.json, ask:

  1. Is authentication required? (recon flags auth_required.)
  2. After auth, is there an ownership/tenant check tying the resource to the caller?
  3. Is there a role/permission check for the action?

Sinks / patterns (grep targets)

  • Handlers that fetch by client id without a scope: findById(req.params.id), Model.objects.get(pk=id), repository.findOne(id), SELECT ... WHERE id = <id> with no AND owner_id = <current_user>.
  • Missing decorators/middleware: routes lacking @login_required/@requires_role/authorize()/ [Authorize]/before_action; Express routes without an auth middleware in the chain.
  • Client-trusted authz: role/tenant taken from request body/JWT claim that the client can set, or from a hidden form field; if (req.body.role === 'admin').
  • Mass assignment: User(**req.body), user.update(req.body), Object.assign(user, req.body), Model.objects.update(**data) letting role/is_admin/tenant_id through.
  • Client-side-only gating: an action guarded only by hiding a UI button.

Detection recipe

  1. From codebase-map.json, list every entry point and its auth_required.
  2. For each resource-fetching handler, graft ask "does this handler check that the resource belongs to the current user" (or read it) - look for a comparison against the authenticated principal.
  3. Diff sibling endpoints: if GET /doc/{id} checks ownership but DELETE /doc/{id} doesn't, flag it. Also diff the methods/paths the authz gate matches against what the router/handler actually accepts (other verbs, case variants, trailing slash, suffix, X-Original-URL/X-Rewrite-URL handling).
  4. Grep role checks and find endpoints that mutate/admin without one: graft grep "is_admin|role\s*==|hasRole|requires_role|@Authorize|before_action|current_user" --json.
  5. For mass assignment, grep object-hydration-from-request patterns above and check for allowlists.

PoC templates

  • IDOR: authenticate as user A, capture GET /api/orders/1001; replay as user B (or unauth) -> if B sees A's order, confirmed. Enumerate/increment/UUID-swap the id.
  • BFLA: as a normal user, call the admin/mutating endpoint directly (curl -X POST /admin/users -H 'Authorization: <user-token>') -> success = missing function-level check.
  • Priv-esc via mass assignment: PATCH /api/me {"is_admin":true} or {"role":"admin"} -> re-fetch profile.
  • Tenant bypass: as tenant T1, request a resource id owned by T2.
  • Verb tampering: retry a gated POST/DELETE action as GET/PUT/HEAD on the same path.
  • Header override: send X-Original-URL: /admin/deleteUser (or X-Rewrite-URL) at a permitted path and see if the app routes to the restricted one.
  • Path normalization: retry a blocked path with case changes, a trailing slash, or an appended extension (/admin/deleteUser.json) to see if the gate and the router disagree.
  • Multi-step skip: as a low-privilege user, submit the request for a flow's last step directly, without performing the earlier steps that carried the authz check.

False-positive filters

  • Ownership/tenant enforced in a query scope (WHERE owner_id = :me), a base queryset (get_queryset filtered by user), row-level security, or shared middleware you must read to see.
  • Central authorization layer (policy objects, Pundit/CanCan, Spring Security matchers, a gateway) applied before the handler - confirm the resource is actually covered by it, and that the gate's path/method matching is as permissive as the router's (same case/trailing-slash/suffix handling, all methods covered).
  • The identifier is not attacker-controlled (server-derived from session).
  • Resource is intentionally public (read-only, non-sensitive) - confirm via intent, don't assume.
  • Not a filter - flag it: an access check based only on the Referer header (fully attacker-controlled) is not a real control, even though it looks like a check is present.

CWE / OWASP / severity

  • CWE-639 (IDOR), CWE-862 (missing authz), CWE-863 (incorrect authz), CWE-284/285, CWE-566 (mass-assign). OWASP A01:2021-Broken Access Control.
  • Severity: high->critical by data sensitivity and whether it's cross-tenant / privilege-gaining.

Chaining hints

  • IDOR read -> harvest other users' data/tokens -> auth account takeover.
  • Mass-assignment priv-esc -> reach admin-only features -> which may enable RCE / config change.
  • Combine with secrets/sqli reads for a full data-exfil chain. Often the escalation step in chains.

Mitigation

Enforce authorization server-side at the object level on every access: scope queries by the authenticated principal/tenant, use a central policy layer (deny by default), never trust client-supplied role/tenant, and allowlist mass-assignable fields. Make sure the authz gate and the router agree on path matching (method, case, trailing slash, suffix) and reject non-standard override headers (X-Original-URL); re-check authorization on every step of a multi-step flow, not just the first; never rely on Referer as a control.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Sh Kb Access Control؟

Knowledge base for finding broken access control - IDOR/BOLA, missing function-level authorization, privilege escalation, and multi-tenant isolation failures. Use when hunting authorization issues or reviewing whether users can access resources/actions they shouldn't. CWE-284/285/639/862/863, OWASP A01:2021-Broken Access Control.

لماذا تستخدم Sh Kb Access Control على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Sh Kb Access Control عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Sh Kb Access Control في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-access-control. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Sh Kb Access Control؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Sh Kb Access Control؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Sh Kb Access Control معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Sh Kb Access Control مجانية؟

نعم. نشرها dmdhrumilmistry على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇