Course contentsShow
← Security
Lesson 813 of 3,05217. Web Security - Authorization and Access ControlFree lesson

IDOR Fundamentals and Common Patterns

Understanding Insecure Direct Object References, how attackers manipulate identifiers, and typical vulnerable patterns.

IDOR Fundamentals and Common Patterns

You'll learn: What Insecure Direct Object References (IDOR) are, how attackers exploit them, and the most common vulnerable patterns.

What Is IDOR?

Imagine a library where each book has a number on its spine. If anyone can simply walk up, say "give me book #42," and receive it without the librarian checking if they're allowed to borrow that specific book — that's IDOR.

Insecure Direct Object Reference (IDOR) occurs when an application exposes internal object identifiers (like database IDs, filenames, or user references) directly in URLs, forms, or APIs without properly verifying whether the current user should access that particular resource.

How Attackers Exploit IDOR

The attack is simple:

  1. Observe a legitimate request containing an identifier (e.g., GET /invoice?id=1234)
  2. Change the identifier to another value (id=1235, id=1236, etc.)
  3. If the application doesn't check authorization for each object, the attacker accesses other users' data

This is direct reference manipulation — changing identifiers to access unauthorized resources.

Common Vulnerable Patterns

  • Sequential numeric IDs: /profile?user_id=501 → change to 500 or 502
  • Predictable filenames: /download?file=invoice_march_2024.pdf → guess other months/years
  • UUIDs without authorization: Even "random" IDs are vulnerable if not checked
  • Hidden form fields: <input type="hidden" name="account_id" value="9876"> — easily tampered
  • API endpoints: DELETE /api/users/789 — can you delete any user?

The vulnerability isn't about guessability of the ID — it's about missing authorization checks after the object is identified.

Key Takeaway:
IDOR vulnerabilities occur when applications fail to verify that the authenticated user has permission to access the specific object referenced by an identifier, allowing attackers to manipulate IDs and access unauthorized resources.