Django access control review
Audits Django and DRF code for IDOR and broken access control by learning the app's authorization model and tracing each endpoint from ID to query, reporting only confirmed gaps with enforcing fixes. Use when reviewing views, viewsets or tenant isolation.
django-access-review- Author
- Sentry
- Source
- getsentry/skills/skills/django-access-review @ a582c51
- License
- Apache-2.0
About this skill
What it does
The skill audits Django and DRF code for broken access control and IDOR around one question: can user A read, change or delete user B's data? Pattern matching is ruled out. The agent first learns how this codebase enforces authorization (decorators, middleware, base views, DRF permission classes, custom managers, get_queryset()) and what the ownership model is: user, organisation, tenant or a hierarchy. SKILL.md gives grep commands for this and forbids moving on before then.
The agent then traces each endpoint with user data from where the ID enters (URL, query string, body) to the query that fetches the object, looking for the check in between. Follow-up questions cover list filtering, who sets the owner on create, bulk operations, related objects and swapping org_id in the URL. A worked example traces a ModelViewSet with IsAuthenticated and Document.objects.all() to a confirmed IDOR.
Only confirmed findings are reported: high confidence means the flow was traced and no check exists, medium goes under "needs manual verification", low is dropped. A suggested fix must enforce the rule in code; a comment asking the caller to check permissions does not count. Each finding comes with location, evidence and a fix.
references/ holds four background notes: django-orm.md (scoping managers), django-views.md (layers from URL conf to query), drf-permissions.md (why a direct Model.objects.get skips has_object_permission) and tenant-isolation.md (where the tenant comes from). SKILL.md does not point to them; ask the agent to read them.
When to use it, and when not
Use it on views, viewsets and ORM code that decide who sees what, especially in multi-tenant apps.
It covers authorization in Django only.
How to run it
We do not copy this skill: its own SKILL.md says its reference material is based on the OWASP Cheat Sheet Series under CC BY-SA 4.0, while the repository is Apache-2.0. Install it from the author's repository; the button on this page leads there. The author's README offers a Claude Code plugin with the whole Sentry set (claude plugin marketplace add getsentry/skills, then claude plugin install sentry-skills@sentry-skills) or npx skills add getsentry/skills for other agents. The agent picks the skill up by its description when you mention IDOR or access control; to call it yourself:
- Claude Code with the plugin:
/sentry-skills:django-access-review, or ask for the skill by name. - Codex:
$django-access-review. - Cursor: type
/in the Agent chat and pickdjango-access-review.
Example: /sentry-skills:django-access-review Can a member of one organisation reach another organisation's invoices through our API?
How it differs from similar skills
Security review, Sentry covers every vulnerability class with the same confidence levels; this skill goes deeper on one class in one framework. Security review from our catalog traces untrusted input to sinks for any stack. Find bugs in branch changes has IDOR as one item of eleven. Django performance review is the companion for N+1 queries and unbounded querysets.
Install
This skill is not copied to the catalog. Install it from the author's repository.
Connect through AnyModel API
This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.
AnyModel