Skip to content
Offensive Security Glossary / Insecure Direct Object Reference (IDOR)

Insecure Direct Object Reference (IDOR): When Changing One ID Exposes Another User's Data

Why IDOR is an authorization bug rather than an ID-format bug, how testers find it, and why scanners rarely do.

What Is Insecure Direct Object Reference (IDOR)

An insecure direct object reference (IDOR) is an access control vulnerability in which an application uses a user-supplied identifier, such as a record ID or file name, to retrieve an object without checking that the requesting user is authorized to access that specific object. It maps to CWE-639 (Authorization Bypass Through User-Controlled Key) and falls under A01:2025 Broken Access Control.

The name points at the identifier, but the bug is the missing authorization check. Replacing sequential IDs with UUIDs makes guessing harder; it does not fix IDOR, because identifiers leak through URLs, logs, shared links, API responses and browser history. In API contexts the same flaw is called Broken Object Level Authorization (BOLA).

A Simple Example

A user views their own invoice:

GET /api/invoices/10482
Authorization: Bearer <token for user A>

The server looks up invoice 10482 and returns it. If user A changes the path to /api/invoices/10483 and the server returns user B's invoice, the application authenticated the user but never checked ownership of the object. The same pattern appears in query parameters (?account_id=), JSON bodies, hidden form fields, file download paths and GraphQL arguments.

Horizontal and Vertical IDOR

VariantWhat happensExample
HorizontalAccess to objects belonging to another user at the same privilege levelReading or editing another customer's order
VerticalAccess to objects or functions reserved for higher privilegesA standard user retrieving an admin-only report by ID
Write IDORModifying or deleting another user's objectPUT /api/users/77/email changes the victim's login email, enabling account takeover
Multi-tenant IDORCrossing tenant boundaries in a SaaS applicationTenant A reading tenant B's records by changing an organization ID

Why Scanners Miss IDOR

An IDOR response is a normal 200 OK with well-formed data. Nothing in the response signals that the data belongs to someone else. Detecting it requires knowing which objects belong to which user, which means testing with at least two accounts and understanding the application's data model. This is the same reason IDOR is a staple of business logic testing and bug bounty reports rather than automated scanner output.

How Penetration Testers Test for IDOR

  1. Create two or more test accounts in each role (and in separate tenants for SaaS).
  2. Capture every request that carries an object identifier while using account A.
  3. Replay each request with account B's session, and with no session, and compare the responses.
  4. Test every HTTP method on the object, not only GET: read access may be checked while PUT, PATCH or DELETE are not.
  5. Look for identifiers in indirect places: export jobs, file names, websocket messages, batch endpoints and GraphQL node IDs.
  6. Report with both accounts' requests and responses so the ownership violation is unambiguous.

Prevention

  • Enforce object-level authorization on every access: check that the authenticated principal owns or is permitted to act on the specific object, on the server, for every method.
  • Scope queries to the user: look objects up through the user or tenant (for example WHERE id = ? AND owner_id = ?) rather than by ID alone.
  • Centralize access control: use a shared policy layer instead of per-endpoint checks that developers can forget.
  • Deny by default: objects are inaccessible unless a rule grants access.
  • Use non-guessable IDs as defense in depth only.
  • Add regression tests that assert a second user receives 403 or 404.

Standards Mapping

FrameworkReference
CWECWE-639: Authorization Bypass Through User-Controlled Key
OWASP Top 10 (2025)A01:2025 Broken Access Control
OWASP API Security Top 10API1:2023 Broken Object Level Authorization

How FireCompass Tests for IDOR

FireCompass AI agents run authenticated tests with multiple user contexts, replay object-level requests across accounts and roles, and report an IDOR only when cross-account access to a specific object is demonstrated, with both requests and responses attached. See web application penetration testing.

Sources and Standards

Frequently Asked Questions

Is IDOR the same as BOLA?

They describe the same flaw. IDOR is the older web application term; Broken Object Level Authorization (BOLA) is the term the OWASP API Security Top 10 uses for it as API1:2023.

Do UUIDs fix IDOR?

No. Random identifiers make guessing harder, but identifiers leak in URLs, logs, emails and API responses. The fix is a server-side authorization check on every object access.

Which CWE is IDOR?

CWE-639, Authorization Bypass Through User-Controlled Key.

Why do automated scanners rarely find IDOR?

The vulnerable response looks like a normal successful response. Detecting IDOR requires multiple accounts and knowledge of which objects belong to which user.

Where does IDOR fall in the OWASP Top 10?

Under A01:2025 Broken Access Control, the top-ranked category in the OWASP Top 10:2025.

Further Reading

Reviewed against the primary sources cited on this page. Verified 2026-12-02.

Test Every Object Reference With Two Accounts, Not One

Run a free AI pentest with multi-user authenticated testing and get IDOR findings that show the cross-account request and response.

Free AI Pen Test

No credit card. Findings include reproducible steps and exploit code.

Firecompass ranked #1 AI on HackerOne. Read more →