Security operations

What Is IDOR? Insecure Direct Object Reference Explained

IDOR is a missing ownership check: the server trusts the ID in your request and hands back whatever it points to. Here is how it works, how testers find it, and how developers fix it.

Cysoro Security TeamPublished · 8 min read
/users/123OK/users/124DENIED?/invoices/1002LEAKSECURITY OPERATIONSWhat isIDOR?Change one number, see someone else's data.
Quick answer

IDOR, or insecure direct object reference, is an access control vulnerability in which a web application uses an identifier supplied by the user, such as a user ID or document number, to fetch an object without checking that the user is allowed to access that specific object. Changing the identifier, for example from user 123 to user 124, can expose another person's data.

Key takeaways

  • IDOR is a missing authorization check, not a problem with exposing IDs: random IDs alone do not fix it.
  • It sits under broken access control, the top category in the OWASP Top 10, and is classified as CWE-639.
  • The fix is a server-side ownership check on every request that touches an object, for read, update, delete and export.

Imagine you log in to a website, open your invoice, and notice the address ends in a number. You change that number by one, press Enter, and see someone else's invoice. That is IDOR, and it is one of the most common web vulnerabilities in the world.

What is IDOR?

IDOR is an access control vulnerability that occurs when an application exposes an internal object reference, such as a database key, file name or record ID, and fails to verify that the requesting user is authorized to access the referenced object. An attacker exploits it by modifying the reference value.

OWASP describes three ingredients in its IDOR prevention cheat sheet: an object such as an account, document, support ticket or transaction; a reference to that object in the form of an ID, UUID, account number, token or slug; and a missing object-level authorization check. Remove the third ingredient and the first two are harmless.

IDOR is classified under broken access control, category A01 in the OWASP Top 10, and its MITRE classification is CWE-639, authorization bypass through a user-controlled key. In APIs, the same flaw is called broken object level authorization, or BOLA.

How does an IDOR attack work?

An IDOR attack is simple, which is why it is so common. The attacker is already signed in as a normal user, finds an identifier in a URL, form field, cookie or API request, changes it, and sees whether the server returns someone else's data.

How an IDOR attack works1Log in normallyattacker is a realsigned-in user2Change the ID/users/123 becomes/users/1243Server returns itno ownership check,data is exposedThe server trusted the ID in the request. It never asked who owns it.
An IDOR attack needs no malware: a signed-in user changes one identifier. Illustration by Cysoro.

The identifier does not have to be in the URL. OWASP gives an example of a hidden form field carrying a user ID, and the same flaw appears in JSON API bodies, cookies and file download links. CISA's advisory lists four places where tampering happens: form fields in a POST body, identifiers in URLs, IDs stored in cookies, and values inside JSON requests.

Because the attacker is authenticated, many security tools miss IDOR. A web application firewall sees a normal logged-in request, and a scanner cannot know which objects belong to which user without test accounts.

What are the types of IDOR?

The joint CISA, NSA and ACSC advisory groups IDOR into four types. They overlap, and one endpoint can show more than one type at the same time.

TypeWhat the attacker gainsExample
Horizontal IDORAnother user's data at the same privilege levelA customer reads another customer's order history
Vertical IDORData that needs a higher privilege levelA standard user reads an admin-only record by its ID
Object-level IDORAbility to modify or delete an objectA user deletes another user's uploaded file
Function-level IDORAccess to a function or actionA user calls an admin-only export or approval action

Horizontal IDOR is the most common type, because every multi-user application has users at the same level. Vertical and function-level IDOR are more dangerous, because they can lead to admin access or data destruction.

What are real examples of IDOR?

IDOR flaws have caused some of the largest data exposures on record. The cases below are all documented in the joint CISA, NSA and ACSC advisory or in regulatory orders, and they share the same pattern: a predictable identifier plus no access check.

First American Financial: over 800 million documents

In May 2019, a document-sharing application used by First American Financial exposed over 800 million document images dating back to 2003, including bank account numbers and other personal financial information. The documents were reached by changing a sequential document number in a link. The US Securities and Exchange Commission later found that security staff had identified the vulnerability months earlier but had not remediated it.

A mobile carrier: data of more than 100,000 customers

The CISA advisory cites a 2012 incident in which an attacker obtained personal data of more than 100,000 mobile device owners from a US communications company's public website, by exploiting an IDOR flaw. The case shows the flaw has been exploited at scale for more than a decade.

Stalkerware backend: hundreds of thousands of phones

In October 2021, a data leak exposed mobile phone data, including text messages, call records, photos and geolocation, from hundreds of thousands of devices. The data came from a stalkerware backend whose API let a caller read data collected from any monitored phone. The CISA advisory lists this as an IDOR case.

These cases are not exotic. They are ordinary web applications with ordinary identifiers, and the fix in each case was the same: check ownership on the server before returning the object.

IDOR vs BOLA vs broken access control: what is the difference?

The vocabulary causes more confusion than the bug does. Broken access control is the parent category in the OWASP Top 10, covering IDOR plus missing function checks, forced browsing and privilege escalation. IDOR is the web name for the object-level flaw, and BOLA is the API name for the same flaw.

OWASP lists IDOR under broken access control in the 2025 Top 10, where it remains category A01. In the OWASP API Security Top 10, BOLA is API1:2023, the top API risk, rated as easy to exploit, widespread and easy to detect.

For a developer, the distinction matters less than the fix. Whether the identifier arrives in a URL or a JSON body, the server must check that the caller may access that object. If your team also handles phishing and account takeover, our guide to spear phishing covers the human side of access abuse.

How do you test for IDOR?

IDOR testing is authorization testing, and authorization only makes sense relative to who owns what. The core technique uses at least two accounts, as described in the OWASP cheat sheet.

  1. Create two accounts with different data, for example User A and User B, each with their own documents, orders or tickets.
  2. Log in as User A and note the identifiers for User A's objects in URLs, forms and API requests.
  3. Replay the requests as User A but with User B's identifiers, and record whether the server returns, changes or deletes User B's data.
  4. Repeat for every action, including read, create, update, delete, export and admin actions, and for every role and tenant.
  5. Check the response carefully: a 403 denial is a pass, a 200 with another user's data is a fail, and a 404 that leaks whether the object exists is a weaker but real issue.

Automated scanners can help by flagging endpoints that take identifiers, but they cannot decide ownership for you. A human tester with two accounts, or an automated test suite that runs the same checks on every release, is the reliable approach.

The two-account IDOR testUser A — signed inOwns document 101, order 55Requests document 202User B — the victimOwns document 202, order 78Never shared it with AExpected result: 403 ForbiddenIf the server returns document 202, the application has IDOR.
Test with two accounts: one user must never reach the other's objects. Illustration by Cysoro.

How do you fix IDOR?

The fix is a server-side authorization check on every request that touches an object. OWASP is clear that complex identifiers are only defense in depth: even with random IDs, access control checks are essential if an attacker obtains a valid URL.

Use these fixes together:

  • Scope queries to the current user. Instead of looking up a project by ID alone, look it up among the current user's projects. In code, that means a query such as finding a document by ID and owner ID together.
  • Check ownership after fetching. If the object's owner does not match the caller, deny access. Return the same response for missing and forbidden objects when the existence of the object is itself sensitive.
  • Take identity from the session, not the client. Do not accept a user ID from a form field or JSON body when the session already knows who the caller is.
  • Use indirect reference maps. Give each user a per-user list of choices that are meaningful only in their context, or replace sequential IDs with random UUIDs as an extra layer.
  • Centralize the check. Put authorization in one place, such as a service layer or middleware, so a new endpoint cannot accidentally skip it.
  • Log and monitor. Watch for one user requesting many sequential IDs, which is a sign of enumeration.

Do not rely on hiding IDs, encrypting IDs, or checking access only in the user interface. A user can call the API directly, bypassing any check that lives only in the browser.

Random IDs are not a fixUUIDs make guessing harder, but if a link is shared, logged or leaked, the server must still refuse an unauthorized caller. Authorization is the fix; unpredictability is only a bonus.

What mistakes keep IDOR in production?

IDOR survives because it is easy to write and hard to spot in a code review. The most common mistakes are checking authentication but not authorization, checking access on read but not on update or delete, and trusting a user ID sent by the client.

Another mistake is testing with only one account. A developer who tests with their own account will never see the flaw, because every object they request is theirs. The two-account test above catches it in minutes.

Finally, teams often fix the endpoint that was reported and stop there. IDOR is usually a pattern, not a single bug: if one endpoint lacks an ownership check, the same pattern is likely in other endpoints, exports and admin actions. Audit every endpoint that takes an object reference. For a wider checklist, our small business cybersecurity checklist covers access control alongside the basics.

The bottom line

IDOR is a missing ownership check. The application takes an ID from the request, looks the object up, and returns it without asking whether the caller may see it. That is why it is so common, and why it has exposed data at the scale of hundreds of millions of records.

Fix it by enforcing a server-side check on every object access, scoping queries to the current user, and testing with two accounts on every release. You can check your own site's headers and transport security while you audit the code with the free security headers checker.

Frequently asked questions

What does IDOR stand for?

IDOR stands for insecure direct object reference. It describes a web application that exposes a direct reference to an object, such as a database record ID, and fails to check whether the requesting user may access that object.

What is an example of IDOR?

A user opens their profile at example.org/users/123, changes the number to 124, and sees another user's profile. The application fetched the record by the ID in the URL without checking that the caller owned it.

Is IDOR the same as BOLA?

IDOR and BOLA describe the same root cause. IDOR is the web term, while BOLA, or broken object level authorization, is the API term used in the OWASP API Security Top 10, where it is listed as API1:2023.

Can IDOR happen without sequential IDs?

Yes. Any predictable or leaked identifier can be abused, including file names, account numbers and tokens. Random UUIDs make guessing harder, but they do not replace an authorization check if an attacker obtains a valid identifier.

How do you test for IDOR?

Create at least two accounts with different data, log in as the first user, and try to access the second user's objects by changing identifiers in URLs, form fields, cookies and API requests. The application should deny every cross-user attempt.

How do you fix IDOR?

Enforce a server-side authorization check on every request that accesses an object, scope database queries to the current user, and use indirect reference maps or random identifiers as defense in depth. Verify the check for read, create, update, delete and export actions.

Is IDOR a serious vulnerability?

Yes. CISA, the NSA and the Australian Cyber Security Centre warned in a joint advisory that IDOR flaws have exposed personal, financial and health information of millions of users, and that they are frequently exploited in data breach incidents.

Sources

  1. OWASP Cheat Sheet Series — Insecure Direct Object Reference Prevention
  2. CISA, NSA, ACSC — Preventing Web Application Access Control Abuse (AA23-208A)
  3. OWASP Foundation — Insecure Direct Object Reference (IDOR)
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against the OWASP IDOR Prevention Cheat Sheet and the joint CISA, NSA and ACSC advisory AA23-208A.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free