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

Broken Object Level Authorization in REST APIs

Exploit BOLA/IDOR vulnerabilities where APIs fail to validate object ownership, allowing unauthorized resource access.

Broken Object Level Authorization in REST APIs

What you'll learn: How attackers exploit missing ownership checks in APIs to access or manipulate resources belonging to other users.

The Vulnerability

Broken Object Level Authorization (BOLA), also known as Insecure Direct Object Reference (IDOR), occurs when a REST API fails to verify that the authenticated user actually owns or has permission to access the resource they're requesting. The API checks who you are but not whether you should access that specific object.

How It Works

Imagine a library where your ID card gets you in the door, but once inside, you can pick up anyone's reserved book—not just your own. That's BOLA.

Example scenario: A user makes this legitimate API request:

GET /api/orders/12345
Authorization: Bearer user123_token

The API verifies the token is valid (authentication passes), but it doesn't check if order 12345 belongs to user123. An attacker simply changes the order ID:

GET /api/orders/12346
Authorization: Bearer user123_token

If the API returns order 12346 without checking ownership, you've exploited BOLA. The attacker can enumerate IDs (12347, 12348...) to access all orders in the system.

Why It's Dangerous

This vulnerability appears in endpoints that accept resource identifiers (IDs, UUIDs, filenames). Attackers can:

  • View other users' private data (orders, messages, documents)
  • Modify resources they don't own
  • Delete other users' content
  • Escalate privileges by accessing admin-only objects

Prevention Basics

Every API endpoint must verify: "Does this authenticated user have permission to access this specific resource?" This check must happen on the server before returning or modifying data.

Key Takeaway: BOLA vulnerabilities let attackers access resources by simply changing IDs in requests because APIs authenticate the user but fail to authorize access to specific objects—always validate ownership server-side.