Course contentsShow
← Security
Lesson 1025 of 3,05221. Web Security - API SecurityFree lesson

Indirect Object Reference Vulnerabilities

Exploiting predictable or enumerable identifiers to access unauthorized resources through API calls.

Indirect Object Reference Vulnerabilities

What you'll learn: How attackers exploit predictable identifiers in API calls to access resources they shouldn't be able to reach.

The Core Problem

Imagine a library where books are stored in lockers numbered 1, 2, 3, 4, and so on. If the librarian only checks your library card at the entrance but never verifies which locker you're allowed to open, you could simply try every number until you find someone else's book.

This is exactly what happens with Indirect Object Reference (IDOR) vulnerabilities. APIs often use simple, predictable identifiers (like sequential numbers or easily-guessable values) to reference resources. When an application fails to verify that the requesting user actually owns or has permission to access that specific resource, attackers can modify these identifiers to access unauthorized data.

How It Works

Consider an API endpoint like this:

GET /api/invoices/1234

If the application only checks that you're authenticated (logged in) but doesn't verify that invoice 1234 belongs to you, an attacker can simply change the ID:

GET /api/invoices/1235
GET /api/invoices/1236
GET /api/invoices/1237

By enumerating through sequential IDs, the attacker can access every user's invoices. This is particularly dangerous when identifiers are:

  • Sequential integers (1, 2, 3...)
  • Predictable UUIDs or hashes
  • Enumerable within a small range

Real-World Impact

IDOR vulnerabilities frequently lead to massive data breaches because they're easy to automate. An attacker can write a simple script to iterate through thousands of IDs and extract sensitive information like user profiles, financial records, or private documents.

Key Takeaway: Indirect Object Reference vulnerabilities occur when APIs use predictable identifiers without properly verifying that the authenticated user has authorization to access that specific resource—always implement resource-level authorization checks, not just authentication.