IDOR Testing Methodology

A repeatable multi-identity swap-and-diff loop: capture every object-touching request as the owner, replay it with a non-owner’s session, and prove whether the server made a subject-to-object decision.

How it works

IDOR can’t be found by a scanner holding one token: it needs knowledge of the data model and at least two valid identities that own real objects. Hunters with two accounts find it; pipelines with one service token don’t (agentoffense, SiteGuarding). Expect manual work: a human has to decide where an object is referenced and what should be swapped (Aon).

Identity matrix

Build four token contexts before testing, each owning objects:

ContextAxis covered
A — victim, tenant 1baseline owner
B — same role, tenant 1horizontal intra-tenant (most missed: many apps check “same org” and stop)
C — tenant 2cross-tenant (Multi-Tenant Isolation)
D — lower-priv / unauthenticatedvertical (Function Level Authorization, Privilege Escalation)

Add a revoked context: an identity that legitimately held access, captured IDs, then was removed. One researcher kept reading a private page’s member list (emails, permission levels) via a documented-but-unused GET /api/page/{pageId}/info after the admin removed them (The User Was Removed).

Core loop (per object-touching request)

  1. Baseline 2xx with the owner.
  2. Replay identical request with non-owner token + owner’s object ID.
  3. Diff status, body, length, headers, timing — not just status.
  4. Re-fetch as owner to see if state changed (writes can “fail” yet commit).

TheXSSRat runs the same “three requests + matrix” on every endpoint and logs the result (Three-Request Method); OWASP’s prescription is identical: users A/B, objects owned by each, swap references across read, create, update, delete, export and admin operations (OWASP IDOR Cheat Sheet).

Techniques / payloads

Where IDs live (swap each independently)

Path segment, query string, JSON body, form field, multipart part, headers (X-User-Id, X-Tenant-Id), cookies, GraphQL variables/inline args, batch array elements (agentoffense, Bugcrowd).

Path authorized, body trusted — the most common modern miss:

PATCH /documents/d-123            # A owns d-123: check passes
Authorization: Bearer <A>
{"project_id": "p-999"}           # B's project: only existence is validated

Response embeds B’s project (name, owner email). Laravel exists:projects,id and DB foreign keys validate existence, not ownership; Postgres FK checks bypass RLS, so the cross-account link is written even under RLS (jrobineau).

Request-shape mutations

MutationExample
HTTP parameter pollution?id=mine&id=victim — first, last or concatenated wins
JSON globbing[1234,1235], {"id":{"id":1235}}, true, "*", "%", 00001235, -1, 1235.0, "1234,1235"
Method swapGET-protected route reachable unprotected via POST
Content-type swapframework parses alternate body type through a different path
Old API version/v1/ still lacks the check fixed in /v3/
Static keywordreplace me/current with your numeric ID, then victim’s
ID added to a list callPOST /api/user/posts normally filters hidden posts; adding "post_id":"<hidden id>" returns them ([[raw/community.protocall.ch/post-idor-hidden-posts-readable-by-id-listing-filter-bypass-15812
Empty/invalid bodyPOST /reports/{id}/reference.json with {}: read the error body for object data ([[raw/oxo.is/idor-allows-user-to-access-report-details-via-reference-json-endpoint-15811

Sources: Intigriti, Weekly Bug Bounty, Aon. Wildcards/booleans on update/delete endpoints can hit many rows: test carefully.

/me/ routes are not self-authorizing: if the handler takes collection_id and calls db.get_collection(id) with no owner check, the prefix is decoration (/me/ endpoints). A current endpoint that rejects swaps may still lead to a sibling that doesn’t: one hunter’s denied profile swap led to an unguarded 2FA-removal endpoint (Weekly Bug Bounty).

Prioritization

  • Writes over reads. PUT/PATCH/DELETE and “read-shaped POSTs” (CSV/XLSX export, PDF render, report generation, share-link creation, thumbnails, search) carry the damaging findings. A 403 that still mutates, fires a webhook or queues an email is a finding.
  • Nested routes: /orgs/{orgId}/projects/{projectId}/files/{fileId} often validates orgId membership then loads fileId globally — keep your parents, swap only the child.
  • Batch endpoints: send [own, victim, own], move the victim to first/last; look for 207/partial success and non-rolled-back writes.
  • Object state flags: after the owner hides, blocks you, disables comments or deletes an object, retry read, comment and react by ID. Protocall enforced none of these on per-object endpoints (Protocall).
  • Low-traffic features: draft autosave, mark-as-read, unsubscribe — not the main “send” path (Intigriti).
  • Private vs public objects: start from user-scoped data (/users/<id>/creditcard/details) rather than public product/review objects (Aon).

Evidence discipline

  • 403 vs 404 consistency. Either is defensible; inconsistency (/invoices/{id} → 404 but /invoices/{id}/pdf → 403) is an existence oracle. On GraphQL compare data, not status (failures return 200 + errors).
  • False negatives to rule out: cached responses, soft-deleted/archived rows skipping the owner filter, 200-empty-body hiding a successful write, expired tokens (401 looks like a pass) — automate token refresh (agentoffense).
  • Error bodies count. A 403/422 that echoes fields of the denied object is a disclosure (oxo).
  • Run both directions and controls. A→B and B→A, plus a non-existent ID (404), no session (401) and own ID (200), to show the result is ID-driven and to note any enumeration oracle (profile IDOR).
  • Use your own accounts only; prove with an empty test object. A missing check on a KYC draft is High even with no real passport downloaded (SiteGuarding).
  • Severity hinges on ID reachability. Bugcrowd triage asked one hunter for a remote way to obtain the victim’s (encrypted) user ID before accepting a password-change IDOR (rohit443). See Predictable Identifiers.

Checklist

  • ≥2 same-role accounts per tenant + second tenant + low-priv + revoked identity
  • Object model mapped (OpenAPI, Postman, JS bundles/source maps, mobile traffic, GraphQL introspection, archived versions)
  • Every ID location swapped independently, every method
  • Body/foreign IDs on writes checked, not just path IDs
  • Nested child swap, batch position swap, old versions, alt methods/content-types
  • Full response diff + owner re-read after writes
  • 403/404/timing consistency between sibling routes
  • Token refresh automated; caches and soft-deletes excluded

Tooling

ToolUse
Autorize (Burp)replays every proxied request with a low-priv cookie; flags enforcement status ([[raw/blackhatethicalhacking.com/maximizing-idor-detection-with-burp-suite-s-autorize-4378
AuthMatrix, Auth Analyzeruser × request matrix; parallel sessions with per-session CSRF extraction
Session Switcher (Doyensec)named sessions swapped in-editor, auto-updated from proxy traffic ([[raw/blog.doyensec.com/introducing-session-switcher-swap-burp-sessions-with-one-click-11406
Burp Intruder / ffufnumeric ID sweeps ([[raw/portswigger.net/testing-for-idors-portswigger-burp-docs-4380
IDOR-Scannerpassive numeric-field detection, active increment + size/200 diff ([[raw/github.com/idor-scanner-burp-suite-extension-for-automated-idor-detection-4744
ReproCasedeterministic reproduced/not_reproduced verdicts with fresh accounts ([[raw/github.com/reprocase-prove-idor-bola-role-and-cors-findings-with-fresh-test-accou-15622
ExploitSpecturns a confirmed BOLA into a RED→GREEN→STABLE CI regression test from HAR/cURL ([[raw/pazent.github.io/exploitspec-bola-idor-regression-tests-from-bounded-redacted-har-input-11961

LLM-driven probing works when findings are replayable: Brutecat fed ~1,500 Google API discovery docs to Claude as MCP tools with an IDOR/BAC brief, and accuracy passed 50% only after clustering endpoints, decoding error codes and attaching replayable operation IDs (Cyberkendra). See Authorization Testing Automation.

Sources