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 (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 (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 |
| 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 |
| 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 |
| 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 |
| 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 |
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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 (Aikido).
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 generatedGROWI 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 (GROWI).
Harvesting unguessable IDs
“UUID is a locator”, not a secret (SiteGuarding). Common leak points:
- Public profile/author links — PortSwigger lab: Carlos’s GUID in blog author links →
/my-account?id=<guid>→ his API key (PortSwigger lab). - Registration/reset/lookup oracles —
POST /api/leadswith an existing email returned the victim’s lead ID in alead_already_verifiederror, feedingPUT /api/lead/<id>/phone-number(PenTester Nepal); a payment page’s email field returned the encrypted user ID (rohit443). - Share links — Snapchat Spotlight IDs visible in share URLs (Snapchat); Ryot access-link IDs in public share URLs (Ryot); AI chat conversation UUIDs in
?conversation=(GraphQL AI chat). - Other endpoints’ responses — over-returning responses chain into new routes; one leaked foreign ID started a chain in a Laravel audit (jrobineau).
- Unsubscribe forms, in-app messages, Wayback Machine, search engines (Intigriti); exports, notification emails, PDFs, JS bundles, logs, referrers, support tooling (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 (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) (agentoffense).
- Never put object IDs in client-readable authorization tokens; use opaque, signed, short-lived, session-bound tokens (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(profile IDOR) orroom_was_finishedvsroom_not_found(Protocall) let attackers map the ID space. - Encryption is not authorization: never expose an encrypt/encode service for the same identifiers your APIs accept (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
- IDOR Prevention Cheat Sheet · original
- IDOR on Password Change to Full Account Takeover · original
- BOLA: Enumerating an Entire Employee Directory Through a Predictable ID · original
- I Changed One Number in a URL and Read Another Customer's PAN, Aadhaar and Card PIN · original
- IDOR via predictable checkout IDs: lab based on a real report · original
- How a Guessable Number Exposed Every Meta AI User's Private Prompts · original
- How to Find IDOR Vulnerabilities: The Bug Bounty Hunter's Practical Guide · original
- Course-tencent-cloud IDOR · original
- IDOR in the medical report viewer · original
- Exploiting UUIDs in Account Takeover: Pentester's Guide · original
- BOLA/IDOR testing: the multi-account object-swap harness · original
- Predicting MongoDB ObjectId() continuously in Rocket.Chat · original
- GROWI IDOR: read revisions of pages you cannot view · original
- BOLA in auto financing applications: case study · original
- PortSwigger: User ID controlled by request parameter, unpredictable IDs · original
- Tackling IDOR on UUID based objects · original
- Delete anyone's Snapchat Spotlight content remotely ($15,000) · original
- Ryot 10.5.6 authorization bypass (IDOR) · original
- How an GraphQL IDOR leaked AI conversation History · original
- BOLA: your API checks the URL but misses IDs in the JSON body · original
- IDOR: A Complete Guide to Exploiting Advanced IDOR Vulnerabilities · original
- Laravel Temporary Signed URLs: Invalid Signature, Expiry, and IDOR · 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
- Intel Inside: How a Cracked JWT Key led to Full Account Takeover · original
- EUSurvey authorization bypass (IDOR) · original