Insecure Direct Object References (IDOR)
You'll learn how attackers exploit predictable object identifiers to access data they shouldn't see.
What Is IDOR?
Insecure Direct Object References (IDOR) occur when an application exposes internal object identifiers (like database keys, file names, or user IDs) in URLs or API requests without proper authorization checks. Attackers simply change these identifiers to access other users' data or resources.
Think of it like a hotel where room keys are just numbered 101, 102, 103. If the front desk gives you key 102 but never checks if you're authorized for that room, you could easily try key 101 or 103 and walk right in.
How Attackers Exploit IDOR
Consider a typical scenario:
https://example.com/user/profile?id=4582
An attacker notices their user ID is 4582 in the URL. They simply change it:
https://example.com/user/profile?id=4581
If the application doesn't verify that the requester is authorized to view user 4581's profile, the attacker gains access to someone else's personal information.
Common Attack Patterns
- Sequential ID enumeration: Trying
id=1,id=2,id=3to harvest all user accounts - Predictable file paths:
/invoices/user_123_invoice.pdf→/invoices/user_124_invoice.pdf - API parameter tampering: Modifying JSON payloads like
{"userId": 999}to access different accounts
The vulnerability exists because the application trusts the user-supplied reference without checking if the current user has permission to access that specific object.
Key Takeaway: IDOR vulnerabilities arise when applications expose internal object identifiers without implementing proper authorization checks—always verify that the authenticated user has permission to access the requested resource, not just that they're logged in.