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

SchemeWeaknessExample
Sequential integerwalk ±1; whole table in one loopidPersonnal 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 linkthe share link is random, but an API takes the internal integerProtocall 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 tokentoken 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 spacebrute the space4-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 IDsedit/regenerate creates a new ID next to othersMeta 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 countersee below
Encoded integersbase64/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 JSONmedical 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 encoderthe app’s own EncodeString endpoint encrypts any chosen usernamefeed the output to EncUserID → account records ([[raw/d0loreh4z3.medium.com/encrypted-id-s-no-problem-15808
Hashes of low-entropy inputmd5("hello")-style IDsprecompute over the input space ([[raw/dev.to/how-to-find-idor-vulnerabilities-the-bug-bounty-hunter-s-practical-gui-2793
UUIDv1/v2timestamp (100 ns) + MAC; time-window predictiondecode 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 IDsbase64 TypeName:pkdecode, 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-bitnot guessable, but leakedsee 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 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 (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/leads with an existing email returned the victim’s lead ID in a lead_already_verified error, feeding PUT /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) or room_was_finished vs room_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).

Sources