Insecure Direct Object Reference (IDOR)
An insecure direct object reference (IDOR) is a flaw where an app lets users access records just by changing an ID in a URL or request, like order 1001 to 1002, without checking that the record belongs to them.
Also called: IDOR, broken object level authorization, BOLA
What is an IDOR?
Apps refer to records by IDs: customer 52, invoice 1001, file 8f3a. An IDOR happens when the app trusts whatever ID the user sends and returns that record without checking that the user is allowed to see it. It's one of the most common forms of broken access control. In APIs, OWASP calls the same flaw broken object level authorization (BOLA) and ranks it the number one API security risk.
Example
A customer logs in and views their statement at `/statements?id=1001`. They change it to `1002` and see another customer's statement, name, address and account details. A script can then download every statement in minutes. Many real data breaches have started exactly this way.
Why it's so common
Developers often assume users will only click the links they're shown. Using hard-to-guess IDs helps a little, but OWASP is clear that it's not a fix on its own: the server must check ownership on every request.
How to prevent IDOR
- Check, on the server, that the logged-in user is allowed to access the specific record on every request, including API calls, downloads and updates.
- Look up records through the user's own data ("this user's invoices") instead of by raw ID where possible.
- Use random, non-sequential IDs as an extra layer.
- Test with two accounts during penetration testing to see whether one can reach the other's data.
Related terms
Sources
- Insecure Direct Object Reference Prevention Cheat Sheet (OWASP)
- API1:2023 Broken Object Level Authorization (OWASP Foundation)
Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.
