# 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 ([[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|agentoffense]], [[raw/siteguarding.com/bola-in-auto-financing-applications-case-study-15620|SiteGuarding]]). Expect manual work: a human has to decide where an object is referenced and what should be swapped ([[raw/aon.com/finding-more-idors-tips-and-tricks-416|Aon]]). ### Identity matrix Build four token contexts before testing, each owning objects: | Context | Axis covered | |---|---| | A — victim, tenant 1 | baseline owner | | B — same role, tenant 1 | **horizontal intra-tenant** (most missed: many apps check "same org" and stop) | | C — tenant 2 | cross-tenant ([[Multi-Tenant Isolation]]) | | D — lower-priv / unauthenticated | vertical ([[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 ([[raw/medium.com/the-user-was-removed-the-access-wasn-t-12436|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 ([[raw/thexssrat.medium.com/the-three-request-idor-method-how-i-find-broken-access-control-before-13001|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 ([[raw/cheatsheetseries.owasp.org/idor-prevention-cheat-sheet-3064|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 ([[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|agentoffense]], [[raw/bugcrowd.com/how-to-find-idor-vulnerabilities-for-large-bounty-rewards-3058|Bugcrowd]]). **Path authorized, body trusted** — the most common modern miss: ```http 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 ([[raw/jrobineau.com/bola-your-api-checks-the-url-but-misses-ids-in-the-json-body-15618|jrobineau]]). ### Request-shape mutations | Mutation | Example | |---|---| | 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 swap | GET-protected route reachable unprotected via POST | | Content-type swap | framework parses alternate body type through a different path | | Old API version | `/v1/` still lacks the check fixed in `/v3/` | | Static keyword | replace `me`/`current` with your numeric ID, then victim's | | ID added to a list call | `POST /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|Protocall]]) | | Empty/invalid body | `POST /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|oxo]]) | Sources: [[raw/intigriti.com/idor-a-complete-guide-to-exploiting-advanced-idor-vulnerabilities-inti-2796|Intigriti]], [[raw/weekly-bugbounty-content.beehiiv.com/broken-access-control-advanced-idor-exploitation-4163|Weekly Bug Bounty]], [[raw/aon.com/finding-more-idors-tips-and-tricks-416|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 ([[raw/0xsinsber.medium.com/the-hidden-idor-vulnerability-in-me-api-endpoints-12891|/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 ([[raw/weekly-bugbounty-content.beehiiv.com/broken-access-control-advanced-idor-exploitation-4163|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 ([[raw/community.protocall.ch/post-idor-hidden-posts-readable-by-id-listing-filter-bypass-15812|Protocall]]). - **Low-traffic features:** draft autosave, mark-as-read, unsubscribe — not the main "send" path ([[raw/intigriti.com/idor-a-complete-guide-to-exploiting-advanced-idor-vulnerabilities-inti-2796|Intigriti]]). - **Private vs public objects:** start from user-scoped data (`/users/<id>/creditcard/details`) rather than public product/review objects ([[raw/aon.com/finding-more-idors-tips-and-tricks-416|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 ([[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|agentoffense]]). - **Error bodies count.** A 403/422 that echoes fields of the denied object is a disclosure ([[raw/oxo.is/idor-allows-user-to-access-report-details-via-reference-json-endpoint-15811|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 ([[raw/zyt00nax0x.medium.com/idor-in-app-api-enduserapp-profile-userid-cross-account-pii-disclosure-15809|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 ([[raw/siteguarding.com/bola-in-auto-financing-applications-case-study-15620|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 ([[raw/rohit443.medium.com/idor-on-password-change-to-full-account-takeover-4373|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 | Tool | Use | |---|---| | 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|Autorize]], [[raw/levelblue.com/manual-and-semi-automated-testing-for-idors-using-burp-suite-4379|LevelBlue]]) | | AuthMatrix, Auth Analyzer | user × 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|Doyensec]]) | | Burp Intruder / ffuf | numeric ID sweeps ([[raw/portswigger.net/testing-for-idors-portswigger-burp-docs-4380|PortSwigger docs]], [[raw/dev.to/how-to-find-idor-vulnerabilities-the-bug-bounty-hunter-s-practical-gui-2793|dev.to guide]]) | | IDOR-Scanner | passive numeric-field detection, active increment + size/200 diff ([[raw/github.com/idor-scanner-burp-suite-extension-for-automated-idor-detection-4744|IDOR-Scanner]]) | | ReproCase | deterministic reproduced/not_reproduced verdicts with fresh accounts ([[raw/github.com/reprocase-prove-idor-bola-role-and-cors-findings-with-fresh-test-accou-15622|ReproCase]]) | | ExploitSpec | turns 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|ExploitSpec]]) | 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 ([[raw/cyberkendra.com/researcher-used-ai-to-find-500000-worth-of-bugs-across-google-s-intern-9027|Cyberkendra]]). See [[Authorization Testing Automation]]. ## Related - [[Insecure Direct Object Reference]] - [[BOLA in APIs]] - [[Predictable Identifiers]] - [[Second-Order and Multi-Step IDOR]] - [[IDOR to Account Takeover]] - [[Authorization Testing Automation]] - [[Broken Access Control]] - [[Multi-Tenant Isolation]] - [[Burp Suite Extensions]] - [[Bug Bounty Methodology]] ## Sources - [[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|BOLA/IDOR testing: the multi-account object-swap harness]] - [[raw/cheatsheetseries.owasp.org/idor-prevention-cheat-sheet-3064|IDOR Prevention Cheat Sheet]] - [[raw/aon.com/finding-more-idors-tips-and-tricks-416|Finding More IDORs – Tips and Tricks]] - [[raw/bugcrowd.com/how-to-find-idor-vulnerabilities-for-large-bounty-rewards-3058|How-To: Find IDOR Vulnerabilities for Large Bounty Rewards]] - [[raw/intigriti.com/idor-a-complete-guide-to-exploiting-advanced-idor-vulnerabilities-inti-2796|IDOR: A Complete Guide to Exploiting Advanced IDOR Vulnerabilities]] - [[raw/weekly-bugbounty-content.beehiiv.com/broken-access-control-advanced-idor-exploitation-4163|Broken Access Control: Advanced IDOR Exploitation]] - [[raw/thexssrat.medium.com/the-three-request-idor-method-how-i-find-broken-access-control-before-13001|The Three-Request IDOR Method]] - [[raw/jrobineau.com/bola-your-api-checks-the-url-but-misses-ids-in-the-json-body-15618|BOLA: your API checks the URL but misses IDs in the JSON body]] - [[raw/0xsinsber.medium.com/the-hidden-idor-vulnerability-in-me-api-endpoints-12891|The Hidden IDOR Vulnerability in /me/ API Endpoints]] - [[raw/medium.com/the-user-was-removed-the-access-wasn-t-12436|The User Was Removed. The Access Wasn't.]] - [[raw/siteguarding.com/bola-in-auto-financing-applications-case-study-15620|BOLA in auto financing applications: case study]] - [[raw/rohit443.medium.com/idor-on-password-change-to-full-account-takeover-4373|IDOR on Password Change to Full Account Takeover]] - [[raw/dev.to/how-to-find-idor-vulnerabilities-the-bug-bounty-hunter-s-practical-gui-2793|How to Find IDOR Vulnerabilities: The Bug Bounty Hunter's Practical Guide]] - [[raw/blackhatethicalhacking.com/maximizing-idor-detection-with-burp-suite-s-autorize-4378|Maximizing IDOR Detection with Burp Suite's Autorize]] - [[raw/levelblue.com/manual-and-semi-automated-testing-for-idors-using-burp-suite-4379|Manual and semi-automated testing for IDORs using Burp Suite]] - [[raw/blog.doyensec.com/introducing-session-switcher-swap-burp-sessions-with-one-click-11406|Introducing Session Switcher]] - [[raw/portswigger.net/testing-for-idors-portswigger-burp-docs-4380|Testing for IDORs (PortSwigger Burp docs)]] - [[raw/github.com/idor-scanner-burp-suite-extension-for-automated-idor-detection-4744|IDOR-Scanner: Burp Suite Extension]] - [[raw/github.com/reprocase-prove-idor-bola-role-and-cors-findings-with-fresh-test-accou-15622|ReproCase]] - [[raw/pazent.github.io/exploitspec-bola-idor-regression-tests-from-bounded-redacted-har-input-11961|ExploitSpec — BOLA/IDOR regression tests]] - [[raw/cyberkendra.com/researcher-used-ai-to-find-500000-worth-of-bugs-across-google-s-intern-9027|Researcher Used AI to Find $500000 Worth of Bugs Across Google's Internal APIs]] - [[raw/oxo.is/idor-allows-user-to-access-report-details-via-reference-json-endpoint-15811|IDOR allows user to access report details via reference.json endpoint ($15000)]] - [[raw/community.protocall.ch/post-idor-hidden-posts-readable-by-id-listing-filter-bypass-15812|Post IDOR: hidden posts readable by ID, listing filter bypass]] - [[raw/zyt00nax0x.medium.com/idor-in-app-api-enduserapp-profile-userid-cross-account-pii-disclosure-15809|IDOR in /app-api/enduserapp/profile/{userId} — Cross-Account PII Disclosure]]