Vulnerability class

How to prove an IDOR is real, and that your fix closed it

Updated

An IDOR is proven when a request carrying account A's session returns account B's object. The fix is verified only when a foreign id and a nonexistent id produce identical responses — otherwise you have changed the error, not the access check.

Where this class of bug actually lives in an API that looks up objects by id

  • Direct object references. /api/invoices/1003, ?userId=12, {"accountId":"..."}. Sequential ids make it trivial; UUIDs only make it slower, since the id usually appears legitimately somewhere the attacker can see.
  • Sibling routes. The detail route is guarded and the export, PDF, share or preview route is not. Same object, different handler.
  • Nested resources. /orgs/<mine>/projects/<yours> passes the parent check and never checks the child's owner.
  • Bulk endpoints. A POST taking ids: [...] that filters nothing returns the subset that exists, across tenants.

What to try first

  1. Create two accounts in different tenants and record one object id from each.
  2. Request A's object with B's session. Then request an id that cannot exist, with the same session, and compare status, headers and body length.
  3. Repeat for every verb: GET, PATCH, DELETE, and the export or download variant.
  4. Try the id in a body field and in a query parameter, not just the path.

A reproduction you can keep

The comparison is the whole test. Two requests, one session, two ids:

Foreign id versus nonexistent id
# B's session. 1003 belongs to A.
curl -sS -o foreign.txt -w '%{http_code} %{size_download}\n' \
  https://staging.example.com/api/invoices/1003 \
  -H 'Authorization: Bearer ***'

# an id that does not exist
curl -sS -o missing.txt -w '%{http_code} %{size_download}\n' \
  https://staging.example.com/api/invoices/999999999 \
  -H 'Authorization: Bearer ***'

# the test: these two lines must be identical
# vulnerable: 200 412  /  404 61
# fixed:      404 61   /  404 61

What "fixed" has to look like

Scope the query by the caller's tenant so the foreign id resolves to nothing. The honest pass condition is byte-identical responses for the foreign id and the nonexistent id; a 403 for one and 404 for the other still confirms the record exists.

Where people get this wrong

  • Cancelling result, not the query. Redaction after the fetch leaves timing and error differences an attacker can read.
  • Fixing the detail route and leaving the export route is the most common incomplete fix.
  • Testing only with the owner's session. The bug exists in the other direction, so you must hold the wrong session.

What Offense does here

Offense runs an agent swarm against your app in a disposable sandbox, keeps the request, the identity and the vulnerable response as evidence, and replays the same attack after the fix so the retest is a control comparison rather than a green check. It does not read your source and it does not patch your code: the finding goes to your coding agent with the reproduction attached. The hosted workspace is invite-only — join the waitlist — and the free dependency audit in /install needs no account.

Questions this page answers

What is the difference between IDOR and BOLA?

Nothing functional. BOLA is the OWASP API Security name for the same class: an object accessed by its id without an authorization check.

Does using UUIDs fix an IDOR?

No. It changes guessing into discovery. The id still appears in links, emails and API responses, and the missing check is still missing.

Written by Offense Research, reviewed December 2, 2026. Correct something? Email imran@offenseresearch.com.