How Attackers Exploit IDOR (Insecure Direct Object References)

How Attackers Exploit IDOR (Insecure Direct Object References)

2 min read

IDOR · authorization · API security · OWASP

Authors

PandaONE Team

Educational walkthrough of IDOR abuse in APIs and multi-tenant SaaS — ID swaps, missing ownership checks, and what proof looks like in authorized testing.

Change invoice_id from yours to someone else's. Same session cookie. JSON comes back with their line items.

IDOR (Insecure Direct Object Reference) is one of the most common API bugs: the application trusts that if you are logged in, any object ID you send is yours. Attackers stay authenticated as themselves and change the ID.

This post is educational for defenders. Only test applications you own or are authorized to assess. Full guide: Learn → IDOR.

The abuse pattern

  1. Create or use a normal account (user A).
  2. Note object identifiers in responses — /api/orders/1001, documentId, org_id.
  3. Replay the request as A with B’s identifier.
  4. If the server returns B’s data or accepts a write, authorization failed.

The UI can hide other users' rows all day. Attackers call the API directly.

Why multi-tenant SaaS is fertile ground

Every list/detail endpoint needs a tenancy check: does this user_id / org_id own the row? Missing that filter once is enough. Sequential integers make enumeration easy; leaked UUIDs from emails, exports, or sibling APIs work just as well.

What proof looks like

A shipped finding should show:

  • Authenticated as user A
  • Request targeting user B’s object
  • Response proving unauthorized read or mutation
  • Sensitive fields redacted in customer UI as needed

“IDs look sequential” without a successful cross-user call is a lead, not a proof-backed alert. PandaONE maps confirmed IDOR-class issues to the Authentication finding category.

Prevention checklist

  • Assert ownership or role on every object load
  • Centralize tenancy filters in the data layer
  • Automated tests that expect 403/404 on cross-user access
  • Rate-limit and monitor enumeration patterns

See also how attackers exploit SSRF and AI penetration testing. Validate your APIs with domain verification before authorized scanning — Scan your domain when you're ready.

Featured on ScrollLaunchFeatured on CodeHype