Insecure Direct Object Reference
The server resolves an object from a client-controlled reference (ID, UUID, filename, token, slug) and acts on it without deciding whether the authenticated subject may perform that action on that specific object. CWE-639, under OWASP A01:2025 Broken Access Control, and API1 (BOLA) in the API Top 10.
What it is
OWASP lists three ingredients: an object (account, document, ticket, transaction), a reference to it (ID, UUID, account number, token, slug, filename), and a missing object-level authorization check (OWASP IDOR Cheat Sheet, OWASP). The trust boundary that breaks is between who you are and what this object is. Authentication succeeds and the route-level role check passes, but nobody asks “is invoice 1002 yours?” MDN’s Express example shows the canonical bug: the handler checks req.isAuthenticated() but not req.session.userId === req.params.id (MDN).
The name points at the wrong fix. “Direct reference” suggests making references indirect or unguessable. The defect is the missing subject→object decision, and a UUID in the path doesn’t change whether that decision happens (agentoffense, /me/ endpoints). The bug persists because authorization is applied per route while each object read/write needs its own decision. Find-by-id ORMs (Order.find(params[:id])) make the unscoped query the default, and ownership assumptions get reused across workflow steps that weren’t designed together (Aikido).
Axes (PortSwigger):
- Horizontal: same role, another user’s object. The classic IDOR.
- Vertical: lower-privileged principal reaches a higher-privileged object. This overlaps Function Level Authorization.
- Cross-tenant: another organization’s object. See Multi-Tenant Isolation.
Why it matters
Impact ladder, low → high:
- Metadata / existence oracle: 403-vs-404 differences reveal which IDs exist.
- Single-record read: profile, order, receipt (Directorist receipts).
- Mass PII enumeration: sequential IDs mean the whole table. An HR endpoint returned a full employee directory with tax IDs (CVSS 9.8) (employee directory). Medical records via document IDs (CVE-2026-103089) (patient records).
- Integrity: edit or delete others’ objects. Snapchat Spotlight deletion paid $15,000 (Snapchat); Facebook album deletion paid $12,500 (Facebook album); LatePoint transaction modification (LatePoint).
- Availability across tenants: Cube Studio users could delete other tenants’ inference pods (Cube Studio).
- Credential / account takeover: password, email, PATs, passkeys, IMAP passwords. See IDOR to Account Takeover.
- Privilege escalation: editing another tenant’s permission scopes (GraphQL org check), or a teacher resetting admin passwords (openSIS).
Severity drivers: ID reachability (sequential vs leaked vs unguessable), authentication requirement, read vs write, data class (PII/KYC/medical/credentials), blast radius (one row vs table vs tenant). Payout tracks demonstrated business impact, not CVSS. A GraphQL alias DoS paid $12,500, while an IDOR exposing every user’s profile (CVSS 7.1) was triaged Informative in 2021, was still exploitable in 2025, and paid $0 as a duplicate ($0 IDOR). Prevalence: one tracker counts 143 IDOR reports/writeups from 2024–2026, 34 rated High or Critical (SecureHyperloop); IDOR was the most common class in Max’s bug bounty program (213 flaws) (Max BB).
How it works
| Variant | Mechanism | Page |
|---|---|---|
| Classic parameter swap | ?id=1001 → 1002; path, query, body, header, cookie | IDOR Testing Methodology |
| API object-level (BOLA) | route authorized, object not; path vs body ID; GraphQL multi-path resolvers; batch items | BOLA in APIs |
| Predictable / leaked references | sequential ints, ObjectId, encoded ints, v1 UUIDs, Relay IDs; UUIDs harvested from share links and oracles | Predictable Identifiers |
| Second-order / multi-step | stored ID trusted later; final workflow step unchecked; grants outlive revocation | Second-Order and Multi-Step IDOR |
| Static-file reference | /static/12144.txt chat transcripts with incrementing filenames ([[raw/portswigger.net/idor-portswigger-web-security-2730 | PortSwigger]]); CVE-2023-4836 WordPress User Private Files ([[raw/hadrian.io/insecure-direct-object-reference-idor-a-deep-dive-3069 |
| AI-object IDOR | conversations, prompt revisions, skills, memory/RAG refs; agent confused deputy | IDOR in AI Applications |
| Account takeover | identity/credential objects referenced by client ID | IDOR to Account Takeover |
Where to find it
- Endpoints: anything with
id,uid,pid,*_id,uuid,sn,slug,filename, in params, headers and cookies too (Bugcrowd). User-scoped nouns are the best start:/users/<id>/creditcard/details(Aon). - Features: exports (CSV/XLSX/PDF), report generation, share links, invites, attachments, comments, wishlists, bookings/checkouts, payments/refunds, follow/subscribe, integrations/webhooks, draft autosave, “mark as read” (agentoffense, Intigriti).
- Code smells:
Model.find(params[:id]);exists:validation without owner;UPDATE … WHERE id=?without tenant; base model withoutuser_id(Nginx UI CVE-2026-33030); a read helper reused for delete (Vikunja CVE-2026-33312); one resolver in a family missing the check (EveryDocs, jrobineau, Meteroid, Nginx UI, Vikunja). - Platforms: WordPress AJAX/REST handlers missing
current_user_can('edit_post', $post_id)(TaxoPress CVE-2025-14371) (TaxoPress); LearnPress Wishlist exposesuser_idthrough a REST route guarded only by a publicwp_restnonce (LearnPress). - Hidden surfaces: undocumented RPC (Google
batchexecute) (Google Classroom), deprecated endpoints (Fleet), documented-but-unused API routes (The User Was Removed), internal APIs exposed through mined keys (Brutecat/Google).
How to test
- Identities: A (victim) and B (peer, same tenant), C (other tenant), D (low-priv/unauth), plus a revoked identity, each owning real objects.
- Map the object model: OpenAPI, Postman, JS bundles, mobile traffic, GraphQL schema, archived versions. Log every ID that appears.
- Core loop: owner baseline → replay with non-owner token + owner’s ID → diff status/body/length/headers/timing → re-read as owner.
- Swap each ID location independently: path, query, body, foreign keys in body, headers, cookies, GraphQL vars, batch elements.
- Mutate request shape: HPP, JSON arrays/objects/wildcards, method and content-type swaps, old API versions,
me→ numeric ID. - Chase reachability: decode encoded IDs and harvest UUIDs from share links, errors and public profiles (Predictable Identifiers).
- Follow IDs through workflows: later steps, async jobs, revocation (Second-Order and Multi-Step IDOR).
- Prove minimally: own accounts only, empty test objects, a reproducible request pair.
Full loop, evidence rules and tooling are in IDOR Testing Methodology.
Checklist
- Horizontal, cross-tenant, vertical and post-revocation contexts
- Read, update, delete, export, share, admin operations per object
- Body/foreign IDs on writes, not only path IDs
- GraphQL: every resolver path to each type (
node, typed, traversal, mutation payloads) - Batch: victim at first/middle/last position; partial success
- Nested routes: own parent + foreign child
- 403/404/timing parity between sibling routes
- Cache, soft-delete, expired-token false negatives excluded
Exploitation and escalation
- Enumeration at scale: sequential or derivable IDs turn one bug into a full dump (Predictable Identifiers).
- Write IDORs → integrity/availability: deletions, re-parenting credential folders (TeamPass) (TeamPass), cancelling other events’ attendees (Attendize CVE-2026-132773) (Attendize), messaging another account’s attendees for phishing (CVE-2026-132774) (Attendize).
- Credential objects → ATO: see IDOR to Account Takeover.
- Tenant boundary → Multi-Tenant Isolation failure: ZITADEL CVE-2025-64431, MailWatch CVE-2026-85749, Chatwoot cross-tenant hooks (ZITADEL, MailWatch, Chatwoot).
- Chaining: a CL.TE request-smuggling desync turned a harmless IDOR into adding data to a victim’s account (
/addCard) (Hipotermia); IDOR + CSRF (bblabs). See Vulnerability Chaining. - Business-logic framing: tie the bug to money or workflow takeover. Billing-arrangement modification in a payment extension API (payment extension); the “$0 vs $12,500” lesson (business logic matters).
Bypassing defenses
| Defense | Why it fails |
|---|---|
| UUIDs / “unguessable” IDs | leaked via share links, author pages, errors, other responses ([[raw/sagar-bhattarai.github.io/portswigger-user-id-controlled-by-request-parameter-unpredictable-ids-12599 |
| Encoded / “opaque” tokens | base64 JSON {"user_id":…,"report_id":…} with no signature ([[raw/medium.com/idor-in-the-medical-report-viewer-13543 |
| Path-ID check only | body/foreign IDs validated for existence only; Postgres FK checks bypass RLS ([[raw/jrobineau.com/bola-your-api-checks-the-url-but-misses-ids-in-the-json-body-15618 |
| Check on one resolver/version/method | GraphQL node path, /v1, POST/alt content-type unprotected ([[raw/dev.to/graphql-bola-one-object-many-paths-and-how-to-prove-the-gap-14345 |
| Input-shape validation | arrays, nested objects, wildcards, padded/negative/decimal IDs, HPP ([[raw/weekly-bugbounty-content.beehiiv.com/broken-access-control-advanced-idor-exploitation-4163 |
| Encrypted IDs | the app exposes its own encoder: POST …/EncodeString encrypts any username, and /api/v1/application/EncUserID returns the matching account (PII, password-related fields, security questions, PINs) ([[raw/d0loreh4z3.medium.com/encrypted-id-s-no-problem-15808 |
| Deny-but-describe | the 403/422 path still serializes the object: HackerOne’s /reports/{id}/reference.json returned private report details in context.subject of the error ([[raw/oxo.is/idor-allows-user-to-access-report-details-via-reference-json-endpoint-15811 |
| Visibility filter on listings only | hidden posts drop out of feeds, but per-object endpoints and a post_id parameter on the listing call return them; blocks, allow_comments=false and soft-deletes are not enforced either ([[raw/community.protocall.ch/post-idor-hidden-posts-readable-by-id-listing-filter-bypass-15812 |
| Signed URLs | prove integrity and expiry, not authorization ([[raw/medium.com/laravel-temporary-signed-urls-invalid-signature-expiry-and-idor-14774 |
| App-capability tokens | check the app’s capability, not the user’s ownership (Facebook album) ([[raw/masimshahzad.medium.com/facebook-idor-deleting-any-photo-album-case-study-15023 |
| WAF / gateway / rate limit | requests are authenticated and well-formed; ownership lives in the DB; aliases and batches beat per-request limits ([[raw/sycope.com/idor-vulnerability-detection-through-http-traffic-analysis-4162 |
Real-world cases
- HackerOne —
POST /reports/{id}/reference.jsonwith{}leaked private report details in the error body, $15,000, H1 #3862641 (oxo). - Protocall —
POST /api/room/token/user {"room_id":2716}minted a full LiveKit join JWT (roomJoin,roomCreate, 5 h) for any private or scheduled room; the waiting room said “not allowed” while media already flowed; distinctroom_was_finished/room_not_founderrors mapped every room (room takeover). Hidden, comments-disabled and deleted posts were readable and commentable by ID (post IDOR). - Freedit < 0.9.9 (CVE-2026-134678) —
POST /post/edit/:pidskipped ownership and lock checks for Private-inn posts; members overwrote any post by sequential ID and re-attributed it (advisory). /app-api/enduserapp/profile/{userId}— authentication without authorization returned any user’s profile PII (CWE-639); 200 vs 404userNotFounddoubled as an enumeration oracle (writeup).- Novapay wallet (practice app) —
POST /api/transfertrusted bodysenderId, so funds moved out of other accounts; invoices readable by ID (writeup). - Snapchat —
DeleteStorySnaps(ids:)deleted any Spotlight, $15,000, H1 #1819832 (oxo, HackerOne). - Facebook — any visible album deletable via Graph API with a first-party token, $12,500 (2015) (case study, four lines); editing friends’ post dates, $538 (timeline date).
- Meta AI — near-sequential prompt-revision IDs exposed others’ prompts and outputs, $10,000 (Meta AI).
- Google — Classroom
batchexecutesubmission-ID IDOR (Classroom); Brutecat’s AI-driven internal-API sweep, >$500k (Cyberkendra). - Rocket.Chat — unauthenticated file read via Livechat token + ObjectId prediction, H1 #3687142 (Aikido).
- Featurebase — client-asserted
userId→ ATO across many programs’ feedback portals (Featurebase). - Bookly CVE-2026-93399 — unauthenticated order-ID → token → booking disclosure/deletion, 60k+ installs (Sentrium).
- Foreman CVE-2026-86322 — forge PATs for any user (Foreman).
- Frappe/ERPNext CVE-2026-66000/66058/66059 — Document Follow object/field/lifetime failures (Robin Roy).
- Xibo CVE-2026-50542 / CVE-2026-52729 — layout status read; action PUT/DELETE without ACL (Xibo read, Xibo write).
- Tutor LMS GHSA-c873-m8w7-q26f — subscriber reads paid content, quiz keys, admin PII (Tutor LMS); Academy LMS cross-student quiz answers (Academy LMS).
- VitaFit CVE-2026-54377 — predictable IDs + account enumeration → body-composition reports (VitaFit).
- Head Start TTADP — cross-region read/write (GHSA-9r9x-g862-525c, GHSA-q859-79hf-rpr3) (r3vpwnx).
- CommCare formplayer GHSA-qjg7-cgv8-3c43 — cross-project form sessions; fixed with
@ValidateSessionOwner(CommCare). - School admissions —
/print-form.php?app_number=exposed admission PII (admissions). - DreameHome cloud API < 2026-10-14 —
POST /smart-app/meari-cloud/redirectAndLoginselected the Meari camera account from a caller-supplieduidwithout matching it to theDreame-Authtoken, handing over the victim’s Meari identity and session (live video, mic audio, speaker, recordings); uids came from public forum profiles and an email-to-uid lookup (GHSA-7mmp-qpv4-2q5v).POST /dreame-user-iot/token/rtc2(CVE-2026-49964) issued an Agora RTC token for any device DID + owner UID, letting the attacker join and publish into the device’s live-video channel (GHSA-3pfg-cg22-v3rr). See IDOR to Account Takeover. - EUSurvey ≤ 1.6 (GHSA-x6m3-wr5v-92pc) —
GET /preparepublishedcontribution/{id}(contribution PDF handler) looked up responses by sequential DB ID and skipped the normal access checks; unauthenticated enumeration of private survey answers (advisory). See Predictable Identifiers. - rConfig Core 8.0.0–8.2.12 / Pro < 8.4.0 (CVE-2026-135695) —
UserController::updateaccepted any user id, so an authenticated user set an administrator’s password and logged in as them (advisory). See IDOR to Account Takeover. - Microsoft Clarity (CVE-2026-113824, critical) — CWE-639 authorization bypass through a user-controlled key allowing network privilege elevation; advisory gives no further detail (advisory).
Prevention
- Scope every lookup to the subject. Rails:
@current_user.projects.find(params[:id]), notProject.find(params[:id])(OWASP IDOR Cheat Sheet). Make the unscoped query hard to write: repository methods that require a subject/tenant argument, backed by RLS (agentoffense). - Subject from the session/token only. Never trust a client
user_id, tenant header or unverified subdomain. Keep multi-step identifiers in the session (OWASP, APISecurity.io). - Validate every received ID for existence and ownership in the same query, including foreign keys in bodies. RLS doesn’t cover FK writes (jrobineau).
- Central PEP/PDP, default deny: framework-native (Spring
AuthorizationManager, ASP.NETIAuthorizationHandler, Pundit/CanCanCan, DRFget_queryset+ django-guardian, NestJS + CASL) or a policy engine (OPA, Cedar, OpenFGA/SpiceDB, Cerbos, Casbin) (agentoffense). See Authorization Policy Engines. - GraphQL: authorize in the business layer so
node, typed and nested paths share one decision (GraphQL BOLA). - Random public IDs (UUIDv4/128-bit) as defense in depth only. Don’t put object IDs in unsigned client tokens (OWASP, medical report viewer).
- Authorize before you load-and-serialize. Denial and validation errors must not echo the object (oxo). Apply visibility rules (hidden, blocked, deleted, comments-off) in the shared object loader, not only in list queries (Protocall). Gate token issuance for downstream systems (media, chat) on membership (Protocall rooms).
- Consistent denial: pick 403 or 404 and apply it everywhere, with no error-text or timing differences (agentoffense).
- CI negative tests: persona A requests persona B’s object for every object-touching endpoint, and writes are re-read (ExploitSpec). See Authorization Testing Automation.
- Detection: alert on per-session 401/403 spikes and sequential ID walks. WAF signatures won’t see IDOR (Sycope).
Tools
Burp Autorize, AuthMatrix, Auth Analyzer, Session Switcher (Doyensec), Burp Intruder / ffuf for ID sweeps, IDOR-Scanner (IDOR-Scanner), IDOR-Forge (IDOR-Forge), ReproCase (ReproCase), ExploitSpec, PwnFox (container tabs per identity), InQL / Clairvoyance / graphw00f for GraphQL, kiterunner / Arjun for route and parameter discovery, CyberChef for decoding IDs. See Burp Suite Extensions.
Sub-pages
- IDOR Testing Methodology — multi-identity swap-and-diff loop, ID locations, request mutations, evidence rules, tooling
- Predictable Identifiers — ID schemes (sequential, ObjectId, encoded, UUID versions, Relay) and harvesting unguessable IDs
- BOLA in APIs — OWASP API1 framing, REST/GraphQL/RPC patterns, API-specific root causes and cases
- Second-Order and Multi-Step IDOR — stored references, workflow-step gaps, grant lifetime, stale-state checks
- IDOR to Account Takeover — credential, reset, token, passkey and 2FA objects as ATO paths
- IDOR in AI Applications — conversations, prompt revisions, skills, memory refs, agent confused deputy
Related elsewhere: Broken Access Control, Function Level Authorization, Multi-Tenant Isolation, Authorization Testing Automation, Privilege Escalation, Mass Assignment, GraphQL Authorization Flaws, OWASP API Security Top 10, Account Takeover, Authorization Security, API Security.
Sources
- IDOR Prevention Cheat Sheet · original
- IDOR - OWASP Foundation · original
- IDOR - MDN Web Security · original
- IDOR - PortSwigger Web Security · original
- BOLA/IDOR testing: the multi-account object-swap harness · original
- The Hidden IDOR Vulnerability in /me/ API Endpoints · original
- IDOR Vulnerability Explained: Why IDOR Persists · original
- Directorist = 8.10.7 IDOR to payment receipt disclosure · original
- BOLA: Enumerating an Entire Employee Directory Through a Predictable ID · original
- CVE-2026-103089: When a Document ID Exposes Another Patient's Records · original
- Delete anyone's Snapchat Spotlight content remotely ($15,000) · original
- Snapchat: Delete anyone's content spotlight remotely. · original
- Facebook IDOR: Deleting Any Photo Album (Case Study) · original
- How Four Lines of Code Could Delete Any Facebook Photo Album · original
- LatePoint = 5.7.6 IDOR to transaction modification · original
- Cube Studio CVE-2026-111671 cross-tenant IDOR · original
- GraphQL IDOR: How a Missing Org Check Let Me Edit Another Tenant's Permissions · original
- openSIS 9.3 insecure direct object reference (IDOR) · original
- The $0 IDOR That Was Worth More Than a $12,500 P1 · original
- The $0 IDOR that was worth more than a $12,500 P1: business logic matters · original
- IDOR bug bounty writeups and disclosed reports · original
- Max's Bug Bounty: Two Hundred Thirteen Flaws · original
- Insecure Direct Object Reference (IDOR) - A Deep Dive · original
- How-To: Find IDOR Vulnerabilities for Large Bounty Rewards · original
- Finding More IDORs – Tips and Tricks · original
- IDOR: A Complete Guide to Exploiting Advanced IDOR Vulnerabilities · original
- EveryDocs Core authorization bypass · original
- BOLA: your API checks the URL but misses IDs in the JSON body · original
- Meteroid before 2.2.0 cross-tenant authorization bypass · original
- CVE-2026-33030: Nginx UI Authorization Bypass · original
- CVE-2026-33312: BOLA in Vikunja Project · original
- CVE-2025-14371: TaxoPress IDOR · original
- LearnPress Course Wishlist 4.1.2 IDOR · original
- How I found an IDOR in Google Classroom · original
- Fleet authorization bypass in deprecated endpoint · original
- The User Was Removed. The Access Wasn't. · original
- Researcher Used AI to Find $500000 Worth of Bugs Across Google's Internal APIs · original
- TeamPass folder re-parenting authorization bypass · original
- Attendize EventOrdersController authorization bypass · original
- Attendize cross-account authorization bypass · original
- CVE-2025-64431: IDOR in ZITADEL Organization API · original
- Cross-tenant quarantine IDOR in MailWatch (CVE-2026-85749) · original
- Chatwoot: a hook on someone else's inbox (IDOR) · original
- HTTP Request Smuggling IDOR - Hipotermia · original
- Wizard Takeover ATO (IDOR + CSRF) lab · original
- IDOR and Business Logic Flaw in a Payment Extension API · original
- PortSwigger: User ID controlled by request parameter, unpredictable IDs · original
- Tackling IDOR on UUID based objects · original
- IDOR in the medical report viewer · original
- Course-tencent-cloud IDOR · original
- GraphQL BOLA: one object, many paths · original
- Broken Access Control: Advanced IDOR Exploitation · original
- Laravel Temporary Signed URLs: Invalid Signature, Expiry, and IDOR · original
- IDOR Vulnerability Detection Through HTTP Traffic Analysis · original
- [$538] IDOR allows friends to edit the date on their friends' timeline posts on Facebook
- How a Guessable Number Exposed Every Meta AI User's Private Prompts · original
- Predicting MongoDB ObjectId() continuously in Rocket.Chat · original
- Account Takeover Across Multiple Programs via Featurebase Integration · original
- Critical Bookly IDOR: booking disclosure and deletion · original
- Foreman PersonalAccessTokensController IDOR · original
- ERPNext's Document Follow feature exposed unauthorized data · original
- Xibo IDOR on GET /layout/status/{id} (CVE-2026-50542) · original
- Xibo IDOR on PUT/DELETE /action/{id} (CVE-2026-52729) · original
- Tutor LMS IDOR leaks paid course content, quiz keys and PII · original
- How I Found a Cross-Student IDOR in Academy LMS · original
- CVE-2026-54377: VitaFit Cloud API IDOR · original
- Cross-region IDOR in Head Start TTADP · original
- Cross-project form-session IDOR in CommCare formplayer · original
- Breaking Down Two Simple Vulnerabilities That Exposed A School's Admission Records · original
- API1:2019 - Broken object level authorization · original
- ExploitSpec — BOLA/IDOR regression tests · original
- Introducing Session Switcher · original
- IDOR-Scanner: Burp Suite Extension · original
- IDOR-Forge · original
- ReproCase · original
- IDOR allows user to access report details via reference.json endpoint ($15000) · original
- Post IDOR: hidden posts readable by ID, listing filter bypass · original
- Private room takeover via sequential room_id (IDOR) · original
- Encrypted ID’s ? No Problem. · original
- Freedit before 0.9.9 authorization bypass in edit_post_post · original
- IDOR in /app-api/enduserapp/profile/{userId} — Cross-Account PII Disclosure · original
- BAC In Novapay wallet · original
- DreameHome cloud API insecure direct object reference (2) · original
- DreameHome cloud API insecure direct object reference · original
- EUSurvey authorization bypass (IDOR) · original
- rConfig authorization bypass through user-controlled key · original
- Microsoft Clarity authorization bypass through user-controlled key (critical) · original