Insecure Direct Object Reference (IDOR)
What is Insecure Direct Object Reference (IDOR)?
Insecure Direct Object Reference (IDOR)An access-control flaw where an application exposes references to internal objects and lets a user change them to access data that does not belong to them.
IDOR occurs when an endpoint uses a user-supplied identifier (numeric ID, UUID, filename, account number) to fetch or modify an object without verifying that the caller is authorized for that specific object. The application authenticates who you are but forgets to check what you may touch — so swapping one reference for another silently returns someone else's data. In the OWASP taxonomy IDOR sits under A01:2021 – Broken Access Control, and it maps to CWE-639 (Authorization Bypass Through User-Controlled Key); on APIs the same bug is catalogued as API1:2023 Broken Object Level Authorization (BOLA).
Sequential IDs make exploitation trivial, but even UUIDs are unsafe if any user can guess, enumerate, or leak them — obscurity is not authorization. In the 2018 USPS Informed Visibility incident an authenticated usps.com API let any logged-in user query (and partly edit) the records of an estimated 60 million account holders, with wildcard searches returning bulk data — a textbook object-level authorization failure reported by KrebsOnSecurity. IDOR is also one of the most frequently paid bug-bounty classes.
Defences: enforce per-request ownership checks at the data layer, scope every query to the current user/tenant, prefer indirect per-session reference maps, deny by default, and add automated horizontal-access tests to CI.
flowchart TD
A[User requests /invoices/1042] --> B{Authenticated?}
B -- No --> R[401 Reject]
B -- Yes --> C{Ownership check:<br/>does object 1042<br/>belong to this user?}
C -- "Missing (IDOR)" --> L[Return object 1043 too<br/>Data of another tenant leaks]
C -- Enforced --> D{Owner matches?}
D -- No --> F[403 Forbidden]
D -- Yes --> G[200 Return object]● Examples
- 01
Changing /invoices/1042 to /invoices/1043 and reading another customer's invoice.
- 02
Editing a profile picture URL parameter to overwrite another user's avatar.
● Frequently asked questions
What is Insecure Direct Object Reference (IDOR)?
An access-control flaw where an application exposes references to internal objects and lets a user change them to access data that does not belong to them. It belongs to the Vulnerabilities category of cybersecurity.
What does Insecure Direct Object Reference (IDOR) mean?
An access-control flaw where an application exposes references to internal objects and lets a user change them to access data that does not belong to them.
How do you defend against Insecure Direct Object Reference (IDOR)?
Defences for Insecure Direct Object Reference (IDOR) typically combine technical controls and operational practices, as detailed in the full definition above.
What are other names for Insecure Direct Object Reference (IDOR)?
Common alternative names include: IDOR, Direct object reference vulnerability.