IDOR: The Bug That Keeps Slipping Through
Insecure Direct Object Reference (IDOR) is one of the most common serious flaws in web applications. It is also one that automated scanners have little chance of detecting, because the bug lives in business logic, not syntax. Here is the playbook.
Web applications · By Thimmagurudu Bathini · Published · 6 min read · Last reviewed
What IDOR actually is
An endpoint accepts an object identifier from the user — an integer, UUID, hash — and returns or modifies the matching record without checking that the authenticated user is authorized for it. The vulnerability is the missing check, not the predictable ID. Even UUIDs and signed IDs are vulnerable if the authorization check is missing downstream.
How we test for it
We authenticate as two low-privilege users in separate tenants. Then we walk every endpoint that takes an object identifier, swap user A's ID with user B's, and replay. A 200 response is a finding. A 404 is suspicious (404 vs 403 leaks existence). We do this systematically — for every CRUD operation, every nested resource, every export endpoint.
GET /api/invoices/4192 → user A's invoice (legitimate)
GET /api/invoices/4193 → user B's invoice (should be 403)
PATCH /api/invoices/4193 → modifying B's data from A's session
GET /api/exports/run/4193 → background export of B's data
Where IDOR hides in modern apps
- Bulk operations —
POST /api/items/bulk-deletewith an array of IDs; the per-item check is missing - Filename in storage URLs —
/files/{user_id}/{filename}served by a CDN with no authz layer - Webhooks and exports — async jobs that re-fetch data and skip the original session check
- GraphQL nested resolvers — parent is authorized, child resolver is not
Designing it out
Centralize authorization in a single layer. Make the authorized entity (the current user) the implicit owner of every query — repositories should take userId as a mandatory parameter, never accept a raw object ID without one. For deeper coverage, our code review service maps every endpoint against an authz matrix.
Written by Thimmagurudu Bathini, BERRY9 IT SERVICES PRIVATE LIMITED, Hyderabad. Questions about your own systems? Request a scoping call or call +91 86868 92922.
Plan your next security test
Tell us what needs testing and when you need it done, and we will propose a scope and timeline. We respond within 24 hours. If you would rather talk first, call or write to us.
- +91 86868 92922
- contact@berry9.com
- H.No: 8-3-945/A/12 & 13, Sri Venkata Sai Nest Apartments, Nagarjuna Nagar Colony, Yellareddyguda, Hyderabad 500073, Telangana