Intro to IDOR
What IDOR is
Insecure Direct Object References (IDOR) occur when a web application exposes a direct reference to an internal object (file, database record, API resource) and the end-user can manipulate that reference to access other objects. The vulnerability is not the exposed reference itself — it is the absence of a back-end access control system that validates whether the requesting user is authorized to access the referenced object.
Example: download.php?file_id=123 returns the user’s uploaded file. Changing the parameter to file_id=124 returns another user’s file if no access control check exists on the back-end.
Why IDOR is so common
- Building a solid access control system is inherently difficult
- Automating detection of access control weaknesses is also hard, so flaws survive to production
- Many developers skip back-end access control entirely, relying on the front-end to show only the current user’s data — manually crafting HTTP requests exposes full access to all users’ data
- Found in major platforms (Facebook, Instagram, Twitter) despite mature security programs
What makes it a vulnerability
A direct reference alone is not a vulnerability. It becomes one when either:
- No back-end access control exists at all
- The access control does not compare the requesting user’s authentication/authorization against the resource’s access list
Even when pages, functions, or APIs are restricted in the UI, if a user reaches them via a shared/guessed link and the back-end does not enforce authorization, the resource is exposed.
A proper mitigation is a system like Role-Based Access Control (RBAC) that validates every request server-side, independent of front-end logic.
Impact
Information disclosure
Accessing private files and data belonging to other users — personal documents, credit card data, PII. This is the most basic IDOR outcome.
Data modification and account takeover
If the reference allows write operations (update, delete), an attacker can modify or destroy other users’ data, potentially achieving complete account takeover.
Privilege escalation (insecure function calls)
Many apps expose admin-only URL parameters or API endpoints in front-end code but disable them client-side for non-admin users. If the back-end does not explicitly deny non-admin callers, an attacker with a standard account can:
- Call administrative functions directly
- Change other users’ passwords
- Grant elevated roles
This can lead to full takeover of the entire web application.
Attack pattern
- Identify a direct reference (database ID, URL parameter, API path segment)
- Test adjacent or sequential values to see if other objects are accessible
- Map the reference pattern and enumerate systematically
- Determine whether the access is read-only (disclosure) or read-write (modification/deletion)