☼
⌃
☰

Insecure Direct Object References

Table of Contents

Insecure Direct Object References (IDOR) is a type of access control vulnerability that occurs when an application provides direct access to objects based on user-supplied input, without adequately verifying that the requesting user is authorised to access that specific object.

The core issue is inadequate server-side authorisation checks. While an application might authenticate a user, it often fails to verify whether that authenticated user is actually authorised to access the specific object they're requesting or manipulating. This can lead to horizontal privilege escalation (accessing other users' data) or vertical privilege escalation (accessing administrator functions).

IDOR is frequently listed in the OWASP Top 10 under "Broken Access Control." Note the classification distinction: IDOR is the general term for any direct, unauthorised object access; BOLA (Broken Object Level Authorisation) is the API-specific variant of the same underlying flaw. On the exam, classify API endpoint findings as BOLA and traditional web app findings as IDOR — see the PT1 Cheat Sheet for the full disambiguation.

Related: Broken Object Level Authorisation Path Traversal OWASP Top 10 PT1 Vulnerability Classification Cheat Sheet Web Application Testing Methodology

Common Techniques

1. Parameter Tampering in URLs

  • Direct Object ID Modification: The most straightforward technique. Look for numerical or alphanumeric IDs in URL parameters (e.g., example.com/profile?id=123 or example.com/orders/456). Change these IDs to other plausible values (e.g., id=124, id=1, orders/1) to see if you can access another user's profile or order.
  • Sequential ID Guessing: Many applications use sequential IDs. If you find user_id=10, try user_id=11, user_id=9, etc.
  • GUID/UUID Manipulation: Even if IDs are complex GUIDs, if they are directly referenced, an attacker could potentially guess or brute-force them (though less likely than sequential IDs) or find them leaked elsewhere.

2. Manipulating Request Body Parameters

For POST, PUT, or DELETE requests, sensitive object references might be sent in the request body (JSON, XML, or form data). Intercept these requests using a proxy (Burp Suite) and modify the object IDs within the body to target other resources.

HTTP
# Original
{"account_number": "USER_ABC_001", "action": "update_details"}

# Tampered — targeting another user's account
{"account_number": "USER_XYZ_002", "action": "update_details"}

3. Changing HTTP Method

Sometimes an application enforces strict access controls for GET requests (e.g., /user/123/delete might be rejected) but has weaker controls for POST or PUT requests to the same endpoint, or vice-versa. Experiment with different HTTP verbs (GET, POST, PUT, DELETE, etc.) on URLs containing object references.

4. Referer Header Bypass

Some applications rely on the Referer header for basic access control, assuming a request for a resource came from a legitimate page that already performed authorisation. Modifying or removing the Referer header might bypass some checks.

5. Path Traversal in File References

Though often categorised as a separate vulnerability, when an IDOR deals with file names or paths, it can overlap with Path Traversal. If an application serves files based on a user-supplied filename (e.g., /download?file=report.pdf), an attacker might try file../confidential/passwords.txt= to access files outside their authorised directory.

6. Exploiting API Endpoints

APIs are a common target for IDORs. They often use clear object identifiers in their URLs or request bodies (e.g., /api/v1/users/userID/posts/postID). Test these endpoints rigorously by changing userID and postID parameters.

Look for endpoints like /api/v1/user/me or /api/v1/current_user. If these exist, try changing me or current_user to a specific user ID to see if it's processed without proper authorisation checks.

7. Batch Processing / Array Manipulation

If an application allows operations on multiple items using an array of IDs (e.g., delete_items[1,2,3]=), try adding IDs of objects you shouldn't have access to into the array.

8. Encoded IDs

Sometimes object IDs are encoded (e.g., Base64, URL encoding). Decode them, modify the underlying ID, and then re-encode before sending the request.

Testing Methodology / Checklist

  • [ ] Identify object references in URLs, request bodies, or headers (id, user_id, account_id, doc_id, filename, order_num)
  • [ ] Determine what type of object the reference points to (user profile, document, order)
  • [ ] Manipulate the reference — sequential numbers first, then known IDs of other users if inferable
  • [ ] Observe the response — data returned or an action performed on the modified ID confirms unauthorised access
  • [ ] Test with two separate accounts to confirm cross-account access, not just a permissive single-user edge case
  • [ ] Test different user roles — a standard user attempting to reach admin-level or another customer's resources
  • [ ] Try each applicable technique above (HTTP method switching, Referer removal, encoded ID decoding, batch array injection) before concluding a parameter is not exploitable

Reporting Template

Classification: Broken Access Control (IDOR)

Severity: High (typically 6.5–8.1 depending on data sensitivity and whether write access, not just read, is possible)

Description: The application at [endpoint] references objects directly via a user-controlled parameter ([parameter name]) without verifying that the authenticated user is authorised to access the referenced object. This allows an attacker to access or modify data belonging to other users by altering the parameter value.

Evidence:

[Raw request/response pair showing access to another user's data
using a manipulated ID, ideally captured with two distinct test
accounts]

Remediation:

  • Enforce server-side authorisation checks on every object access, verifying the requesting user owns or is permitted to access the specific object — not just that they are authenticated
  • Prefer indirect references (session-scoped mapping or UUIDs tied to the authenticated user) over predictable sequential IDs
  • Apply the same authorisation logic consistently across all HTTP methods for a given resource

Tips

  • Always test with two separate accounts — accessing your own data with a slightly different ID proves nothing; cross-account access is the actual finding
  • If standard parameter tampering fails, don't stop — try switching HTTP method on the same endpoint before concluding it's not exploitable, since access controls are often inconsistently applied across verbs
  • On the exam, classify by context: a REST/API endpoint finding is BOLA, a traditional web app URL/form finding is IDOR — see the PT1 Cheat Sheet if genuinely ambiguous