Insecure Direct Object Reference (IDOR)
What is an IDOR?
- Vulnerability where an attacker can access objects directly by manipulating a reference.
- Example: Changing
user_id=1000 to user_id=100 in http://online-service.thm/profile?user_id=1000.
- Encoded IDs (e.g., Base64):
- Decode the ID (Base64).
- Change the value.
- Encode the new value.
- Use the new encoded ID in the request.

- Hashed IDs:
- More complex.
- Check for predictable patterns (e.g., hashed integer values).
- Use online hash cracking services (e.g., CrackStation).
- Unpredictable IDs:
- Create two accounts.
- Swap IDs between the accounts.
- If you can view the other user's content, it's an IDOR.
IDOR Locations
- Not just in the address bar: Check AJAX requests, JavaScript files.
- Unreferenced Parameters (Parameter Mining): Discover hidden parameters that might be vulnerable. Example:
/user/details vs. /user/details?user_id=123.
- API Endpoints: Look for IDs in API calls. Example:
/api/v1/customer?id=.
General IDOR Testing Strategy
- Identify potential endpoints: Look for URLs or API calls that take IDs as parameters.
- Understand ID format: Decode, analyze hashes, or test with multiple accounts.
- Modify IDs: Try different values, especially those of other users.
- Observe the response: Check if you can access unauthorized data.
- Document findings: Record the vulnerable endpoint and the ID manipulation method.