# Predictable Identifiers > Object references whose values can be guessed, derived, decoded or harvested; they turn a missing ownership check from "needs a victim ID" into mass enumeration. Unguessable IDs raise the cost of finding a victim's ID but don't fix the missing check. ## How it works An IDOR needs two things: a missing object-level check and a way to get a valid foreign reference. Identifier design only affects the second. OWASP calls complex IDs **defense in depth**, never a replacement for the check ([[raw/cheatsheetseries.owasp.org/idor-prevention-cheat-sheet-3064|OWASP IDOR Cheat Sheet]]). In practice, ID reachability decides severity: triage will downgrade or hold a report until you show a remote way to obtain the victim's ID ([[raw/rohit443.medium.com/idor-on-password-change-to-full-account-takeover-4373|rohit443]]). ## ID schemes and how they fall | Scheme | Weakness | Example | |---|---|---| | Sequential integer | walk ±1; whole table in one loop | `idPersonnal` 5741 → full employee directory incl. tax IDs, CVSS 9.8 in a pentest ([[raw/infosecwriteups.com/bola-enumerating-an-entire-employee-directory-through-a-predictable-id-11974|employee directory BOLA]]); `GET /profile?user_id=2` on an AI-generated finance demo app exposed PAN/Aadhaar/card PIN ([[raw/medium.com/i-changed-one-number-in-a-url-and-read-another-customer-s-pan-aadhaar-12597|SwarnaVault]]) | | Internal sequential ID behind an unguessable link | the share link is random, but an API takes the internal integer | Protocall private rooms: `room_id` 2716 sent to the token endpoint yielded a full join token with no invite ([[raw/community.protocall.ch/private-room-takeover-via-sequential-room-id-idor-15813|Protocall]]); Freedit post IDs (CVE-2026-134678) ([[raw/github.com/freedit-before-0-9-9-authorization-bypass-in-edit-post-post-15810|Freedit]]) | | Sequential ID outside a forged token | token carries email/role but the account ID rides in the path | `/dashboard/{ID}` walked with a forged JWT until it matched the forged email ([[raw/infosecwriteups.com/intel-inside-how-a-cracked-jwt-key-led-to-full-account-takeover-15877|Intel/CBSE]]) | | Short numeric space | brute the space | 4-digit checkout IDs (0000–9999), unauthenticated `GET /api/checkout/:id` → buyer PII, $500 on HackerOne ([[raw/bblabs.es/idor-via-predictable-checkout-ids-lab-based-on-a-real-report-13717|bblabs]]) | | Near-sequential event IDs | edit/regenerate creates a new ID next to others | Meta AI prompt-edit IDs → other users' prompts and generated output, $10,000 ([[raw/medium.com/how-a-guessable-number-exposed-every-meta-ai-user-s-private-prompts-13878|Meta AI]]) | | MongoDB `ObjectId()` | 4-byte timestamp + 5-byte per-process random + 3-byte counter | see below | | Encoded integers | base64/hex/Sqids wrapping a counter | `/api/orders/MTIzNDU2` = base64("123456") ([[raw/dev.to/how-to-find-idor-vulnerabilities-the-bug-bounty-hunter-s-practical-gui-2793|dev.to guide]]); Course-tencent-cloud SNs are Sqids-encoded sequential order IDs with the **default key** → unauthenticated refund previews (CVE-2026-129469) | | Unsigned client token | "opaque" blob is readable JSON | medical report link was base64 `{"user_id":1485,"report_id":9416}`, no signature or session binding ([[raw/medium.com/idor-in-the-medical-report-viewer-13543|medical report viewer]]) | | Encrypted IDs with a public encoder | the app's own `EncodeString` endpoint encrypts any chosen username | feed the output to `EncUserID` → account records ([[raw/d0loreh4z3.medium.com/encrypted-id-s-no-problem-15808|encrypted IDs]]) | | Hashes of low-entropy input | `md5("hello")`-style IDs | precompute over the input space ([[raw/dev.to/how-to-find-idor-vulnerabilities-the-bug-bounty-hunter-s-practical-gui-2793|dev.to guide]]) | | UUIDv1/v2 | timestamp (100 ns) + MAC; time-window prediction | decode version nibble after the second hyphen; v3/v5 are deterministic from namespace+name ([[raw/medium.com/exploiting-uuids-in-account-takeover-pentester-s-guide-4389|UUIDs in ATO]]) | | Relay global IDs | base64 `TypeName:pk` | decode, change pk, re-encode; type prefix maps the model (`Invoice`, `ApiKey`, `AuditLog`) ([[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|agentoffense]]) | | UUIDv4 / random 128-bit | not guessable, but **leaked** | see harvesting | ### MongoDB ObjectId prediction (Rocket.Chat) Rocket.Chat served `/file-upload/{fileId}` with an authorization path that read `rc_rid`/`rc_token` from the query string (Livechat room) while the file was looked up by path ID — so any Livechat visitor token could authorize any file. Livechat is enabled by default and its unauthenticated upload API stays reachable even when the widget hides the input. Brute-forcing the 5-byte random field is ~1 trillion values, so the attack anchors instead: upload one file anonymously, read its ObjectId (same process → same random field), then walk timestamp back in seconds and counter back by small deltas. Reported via HackerOne #3687142; fixed in 8.5.1 / 8.4.4 / 8.3.6 / … / 7.10.13 ([[raw/aikido.dev/predicting-mongodb-objectid-continuously-in-rocket-chat-10181|Aikido]]). ```python ts = int(probe_id[0:8], 16) # seconds since epoch rand5 = probe_id[8:18] # constant per process counter = int(probe_id[18:24], 16) # increments per ObjectId generated ``` GROWI had the same primitive: pair a viewable page ID with a predictable ObjectId **revision ID** from a page you can't see; fixed by binding revision to page in v8.0.7 ([[raw/github.com/growi-idor-read-revisions-of-pages-you-cannot-view-12753|GROWI]]). ## Harvesting unguessable IDs "UUID is a locator", not a secret ([[raw/siteguarding.com/bola-in-auto-financing-applications-case-study-15620|SiteGuarding]]). Common leak points: - **Public profile/author links** — PortSwigger lab: Carlos's GUID in blog author links → `/my-account?id=<guid>` → his API key ([[raw/sagar-bhattarai.github.io/portswigger-user-id-controlled-by-request-parameter-unpredictable-ids-12599|PortSwigger lab]]). - **Registration/reset/lookup oracles** — `POST /api/leads` with an existing email returned the victim's lead ID in a `lead_already_verified` error, feeding `PUT /api/lead/<id>/phone-number` ([[raw/medium.com/tackling-idor-on-uuid-based-objects-pentester-nepal-4386|PenTester Nepal]]); a payment page's email field returned the encrypted user ID ([[raw/rohit443.medium.com/idor-on-password-change-to-full-account-takeover-4373|rohit443]]). - **Share links** — Snapchat Spotlight IDs visible in share URLs ([[raw/oxo.is/delete-anyone-s-snapchat-spotlight-content-remotely-15-000-idor-via-gr-13720|Snapchat]]); Ryot access-link IDs in public share URLs ([[raw/github.com/ryot-10-5-6-authorization-bypass-idor-14633|Ryot]]); AI chat conversation UUIDs in `?conversation=` ([[raw/medium.com/how-an-graphql-idor-leaked-ai-conversation-history-and-got-me-500-boun-15310|GraphQL AI chat]]). - **Other endpoints' responses** — over-returning responses chain into new routes; one leaked foreign ID started a chain in a Laravel audit ([[raw/jrobineau.com/bola-your-api-checks-the-url-but-misses-ids-in-the-json-body-15618|jrobineau]]). - Unsubscribe forms, in-app messages, Wayback Machine, search engines ([[raw/intigriti.com/idor-a-complete-guide-to-exploiting-advanced-idor-vulnerabilities-inti-2796|Intigriti]]); exports, notification emails, PDFs, JS bundles, logs, referrers, support tooling ([[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|agentoffense]]). ## Signed URLs are not authorization A Laravel `temporarySignedRoute()` signature proves the path/query weren't modified and enforces expiry; anyone holding the link can still use it, and a signed-in user can still walk `/invoices/15` → `/invoices/16` unless a policy denies it. Read signed values with `$request->query()`/route params, not `input()`/`all()`/`$request->email` ([[raw/medium.com/laravel-temporary-signed-urls-invalid-signature-expiry-and-idor-14774|Laravel signed URLs]]). ## Defenses - Ownership check on every lookup; IDs only make enumeration expensive. - Random UUIDv4 / 128-bit public IDs as defense in depth (OWASP API1:2023 lists them *alongside* the check) ([[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|agentoffense]]). - Never put object IDs in client-readable authorization tokens; use opaque, signed, short-lived, session-bound tokens ([[raw/medium.com/idor-in-the-medical-report-viewer-13543|medical report viewer]]). - Don't use `ObjectId()`, Sqids/Hashids with default keys, or UUIDv1 as access secrets. - Remove existence oracles in signup/reset/lookup flows, and in object endpoints: 200 vs 404 `userNotFound` ([[raw/zyt00nax0x.medium.com/idor-in-app-api-enduserapp-profile-userid-cross-account-pii-disclosure-15809|profile IDOR]]) or `room_was_finished` vs `room_not_found` ([[raw/community.protocall.ch/private-room-takeover-via-sequential-room-id-idor-15813|Protocall]]) let attackers map the ID space. - Encryption is not authorization: never expose an encrypt/encode service for the same identifiers your APIs accept ([[raw/d0loreh4z3.medium.com/encrypted-id-s-no-problem-15808|encrypted IDs]]). ## Related - [[Insecure Direct Object Reference]] - [[IDOR Testing Methodology]] - [[BOLA in APIs]] - [[IDOR to Account Takeover]] - [[IDOR in AI Applications]] - [[Password Reset Vulnerabilities]] - [[Excessive Data Exposure]] ## Sources - [[raw/cheatsheetseries.owasp.org/idor-prevention-cheat-sheet-3064|IDOR Prevention Cheat Sheet]] - [[raw/rohit443.medium.com/idor-on-password-change-to-full-account-takeover-4373|IDOR on Password Change to Full Account Takeover]] - [[raw/infosecwriteups.com/bola-enumerating-an-entire-employee-directory-through-a-predictable-id-11974|BOLA: Enumerating an Entire Employee Directory Through a Predictable ID]] - [[raw/medium.com/i-changed-one-number-in-a-url-and-read-another-customer-s-pan-aadhaar-12597|I Changed One Number in a URL and Read Another Customer's PAN, Aadhaar and Card PIN]] - [[raw/bblabs.es/idor-via-predictable-checkout-ids-lab-based-on-a-real-report-13717|IDOR via predictable checkout IDs: lab based on a real report]] - [[raw/medium.com/how-a-guessable-number-exposed-every-meta-ai-user-s-private-prompts-13878|How a Guessable Number Exposed Every Meta AI User's Private Prompts]] - [[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/github.com/course-tencent-cloud-idor-14775|Course-tencent-cloud IDOR]] - [[raw/medium.com/idor-in-the-medical-report-viewer-13543|IDOR in the medical report viewer]] - [[raw/medium.com/exploiting-uuids-in-account-takeover-pentester-s-guide-4389|Exploiting UUIDs in Account Takeover: Pentester's Guide]] - [[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|BOLA/IDOR testing: the multi-account object-swap harness]] - [[raw/aikido.dev/predicting-mongodb-objectid-continuously-in-rocket-chat-10181|Predicting MongoDB ObjectId() continuously in Rocket.Chat]] - [[raw/github.com/growi-idor-read-revisions-of-pages-you-cannot-view-12753|GROWI IDOR: read revisions of pages you cannot view]] - [[raw/siteguarding.com/bola-in-auto-financing-applications-case-study-15620|BOLA in auto financing applications: case study]] - [[raw/sagar-bhattarai.github.io/portswigger-user-id-controlled-by-request-parameter-unpredictable-ids-12599|PortSwigger: User ID controlled by request parameter, unpredictable IDs]] - [[raw/medium.com/tackling-idor-on-uuid-based-objects-pentester-nepal-4386|Tackling IDOR on UUID based objects]] - [[raw/oxo.is/delete-anyone-s-snapchat-spotlight-content-remotely-15-000-idor-via-gr-13720|Delete anyone's Snapchat Spotlight content remotely ($15,000)]] - [[raw/github.com/ryot-10-5-6-authorization-bypass-idor-14633|Ryot 10.5.6 authorization bypass (IDOR)]] - [[raw/medium.com/how-an-graphql-idor-leaked-ai-conversation-history-and-got-me-500-boun-15310|How an GraphQL IDOR leaked AI conversation History]] - [[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/intigriti.com/idor-a-complete-guide-to-exploiting-advanced-idor-vulnerabilities-inti-2796|IDOR: A Complete Guide to Exploiting Advanced IDOR Vulnerabilities]] - [[raw/medium.com/laravel-temporary-signed-urls-invalid-signature-expiry-and-idor-14774|Laravel Temporary Signed URLs: Invalid Signature, Expiry, and IDOR]] - [[raw/community.protocall.ch/private-room-takeover-via-sequential-room-id-idor-15813|Private room takeover via sequential room_id (IDOR)]] - [[raw/d0loreh4z3.medium.com/encrypted-id-s-no-problem-15808|Encrypted ID’s ? No Problem.]] - [[raw/github.com/freedit-before-0-9-9-authorization-bypass-in-edit-post-post-15810|Freedit before 0.9.9 authorization bypass in edit_post_post]] - [[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]] - [[raw/infosecwriteups.com/intel-inside-how-a-cracked-jwt-key-led-to-full-account-takeover-15877|Intel Inside: How a Cracked JWT Key led to Full Account Takeover]]