--- name: hunt-idor description: IDOR/BOLA and tenant isolation testing with controlled identities, ownership controls, reproducible protected-content evidence and root-cause deduplication. --- # Investigate object authorization An identifier or HTTP 200 is a lead. Unauthorized access requires an established policy, a controlled resource, a valid non-entitled identity and observed impact. Use the engagement's scope, request budget and permitted actions throughout. ## Establish the policy and fixtures 1. Read the supplied scope and source when available. Identify the route or resolver, its authorization check and the resource's intended visibility. 2. Use two controlled accounts. Record their roles, tenants and session validity. Create disposable objects containing a synthetic owner-only canary. Establish ownership through fixture creation or an entitled control, never the ID shape. 3. Record the public/shared baseline. A public preview, deliberately shared object or administrative permission is not an object-authorization bypass. ## Run the differential Capture these requests with exchange IDs and report-safe artifact references: | Check | Required observation | | --- | --- | | Session validity | Each account can reach its own expected authenticated resource | | Entitled control | Owner can read the test object and its protected canary | | Non-entitled test | Other account requests that same object | | Repeat | A distinct request independently reproduces the protected-content exposure | | Negative control | The same operation is denied on a comparable non-entitled resource | | Missing object | A known absent synthetic object distinguishes absence from denial | Use `httpflow` sessions for isolated actors and `compare_actors` for the owner and missing-object read controls. That action alone is not the full proof: capture the independent repeat, session-validity and policy evidence separately. Stop and record rate limits, stale sessions, errors and unavailable controls accurately. Do not count those responses as successful repetitions. Promote `authorization_review` through `tool_help` when its schema is not visible. Use it to review recorded read observations offline. Supply declared identities/resources, `confirmed_absent`, and observations with actual exchange IDs, outcomes and report-safe protected-data labels. Follow `next_offset` to inspect all matrix pairs. It flags missing proof and fixture contradictions; it does not authenticate captures or independently validate a vulnerability. Its evidence-supported pair count is not a distinct-root-cause count. ## Explore related surfaces with a hypothesis Trace the same object through REST, GraphQL fields, exports, downloads and API versions where the source or observed navigation indicates a reachable surface. Test horizontal, vertical and tenant boundaries separately. Keep each untested surface visible. Prioritize paths with differing authorization middleware rather than repeating a scan of already equivalent endpoints. For an authorized write test, use a disposable object, record before/after state from the entitled account, and verify restoration. A success response or returned object does not prove a write took effect. Avoid test-account deletion or changes to the authentication configuration needed by the assessment. Treat interrupted writes as indeterminate and reconcile actual state before retrying. ## Resolve and report Reject public/shared access, empty bodies, expired sessions, cache artifacts and differences limited to volatile metadata. Reconcile any claim that a resource is both absent and returned. If a control is unavailable, record the missing proof and keep the candidate inconclusive. For a confirmed issue, preserve minimal synthetic proof, route/resolver source references, preconditions, actual protected bytes or state change, reproduction steps, remediation and remaining uncertainty. Deduplicate by the failed invariant, boundary, operation and shared code path; retain affected endpoints as symptoms. Assign severity from the demonstrated consequence and required privileges. Do not promote an IDOR to Critical through hypothetical enumeration, PII or takeover. Retest the fix on a fresh deployment and repeat the negative controls. --- ## Identifier taxonomy — predictability is a property of the scheme Ownership is proven with fixtures, never inferred from the ID shape. But the shape tells you where to look and what the impact ceiling is once a missing check is confirmed on your own objects. | Scheme | What to test | | --- | --- | | Sequential integer | Neighbouring IDs (`±1`, `±100`) of your own objects; gaps reveal creation volume. Enumeration is trivial *if* a check is missing. | | Timestamp / UUIDv1 | v1 embeds MAC + 60-bit timestamp: IDs minted near a known time are bracketable. Extract the timestamp from one of your own IDs and bound the window. | | UUIDv4 / random | Not guessable. The bug is never prediction — it is a missing ownership check on an ID learned from a legitimate surface (see below). | | Hashed identifier | Hash of a *predictable* input (email, username, sequential int) is predictable. Recompute the hash of your second account's known attributes and compare with its real ID. Unsalted fast hashes (MD5/SHA1) of low-entropy inputs are a dictionary, not a secret. | | Composite key | `tenant/object`, `user:doc`, slug+id pairs. Test each component independently: swap the object half, then the tenant half; many checks validate one component only. | | Encoded (base64 etc.) | Decode your own IDs first. Encoding is not encryption; the decoded structure usually reveals the row above. | ## Where identifiers hide The REST path parameter is the surface everyone tests. IDs also travel in: - **Request bodies** — JSON fields on POST/PUT (`{"owner_id": …}`, nested `items[].id`), including fields the UI never renders (mass-assignment adjacent: a body-supplied owner often overrides the session owner). - **Headers and cookies** — `X-User-Id`, tenant headers, workspace cookies set at login and trusted thereafter. - **GraphQL** — node IDs (`node(id: …)`), relay global IDs (base64 of `Type:pk` — decode yours), IDs inside nested fields and connection edges, and mutations that take an object ID the query path checks but the mutation path does not. - **WebSockets** — subscribe messages naming channels/rooms/object IDs; authorization is often checked at connect, not per-subscription. - **Exports and generated artifacts** — CSV/PDF exports, signed download URLs, report IDs, share links: the export job frequently runs under a different, weaker authorization path than the screen that requested it. - **Batch and bulk endpoints** — `POST /bulk/get` with an ID array, multi-get, and "expand" parameters: per-item checks are the first thing batch implementations skip. Test a mixed array: your object + your second account's object in one call. - **Secondary references** — activity feeds, notifications, search results, webhooks and emails leak other objects' IDs. Harvest IDs only from your own two accounts' surfaces; that is enough to run the differential. ## Differentials that find the unchecked path Run the same two-account differential from the fixture section across every axis; a check present on one axis and absent on another is the classic root cause. | Axis | Test | | --- | --- | | Verb | Owner-only object via GET, then PUT/PATCH, then DELETE on a *disposable* object. Read checks are common; write and delete checks are forgotten more often, and a successful DELETE of your other account's canary is unambiguous. | | Version | Replay the request against `/v1`, `/v2`, mobile and internal API hosts. Deprecated versions keep the old middleware. | | Representation | Same object as page, `.json`, export, print view, embed/oEmbed. Alternate renderers often skip the controller's check. | | Actor state | Anonymous, expired session, and the second account. Distinguish "any logged-in user" from "anyone on the internet" in the report — they are different severities. | | Direct vs nested | `/objects/{id}` vs `/users/{me}/objects/{id}` with mismatched pairs: your user segment + other account's object segment, and the reverse. | ## BOLA, IDOR, BFLA — name the failed invariant precisely - **IDOR / BOLA** (object level): the actor is entitled to the *function* but not to *this object*. Horizontal (same role, another user's object) and tenant (another organisation's object) are the same invariant. - **BFLA** (function level): the actor is not entitled to the function at all — a low-role account invoking an admin operation, whatever object it names. Test admin functions with your low-role account and *its own* object ID: if it succeeds, the failure is function-level, not object level, and usually ranks higher. - **Vertical object access** (a support/agent role reading objects outside its assigned scope) sits between the two; state which entitlement was missing rather than forcing a label. Deduplicate by the failed invariant and shared code path, per the report section above — ten endpoints behind one unchecked resolver are one finding with ten symptoms. ## Indirect references Not every reference is an ID in a URL: - **Filenames and paths** — `/files/invoices/2026/1042.pdf`, avatar and attachment paths, `?file=` parameters. Predictable storage paths behind a CDN may have no server left to check anything; test your second account's canary file path unauthenticated as well as cross-account. - **Slugs and vanity names** — mutable, guessable, sometimes recycled to a new owner; check what a recycled slug exposes of the previous owner. - **Tokens in URLs** — share/reset/invite tokens are object references with an expiry policy instead of a session check: test expiry, reuse, and whether the token survives the state change it authorised. ## Impact framing — rate the object, not the verb Assign severity from the demonstrated object's sensitivity, with your own canary standing in for the class: | Object class | Framing | | --- | --- | | Public-adjacent (profile names, avatars) | Low; often by-design — confirm the policy before reporting | | Private content (messages, documents, orders) | High when read cross-account at scale of the ID scheme | | Financial / regulated (invoices, payouts, health, KYC) | High–Critical; cite the data class, not a record count you did not enumerate | | Credential material (API keys, reset tokens, session data) | Critical path: object access converts to account access — demonstrate with your own second account's key only | | Write/delete on the above | One band above the equivalent read, proven on disposable fixtures | Never enumerate real users' objects to size the impact. State the ID scheme, the space it implies, and the canary proof; that is sufficient and it is all the program authorised. ## False-positive traps - The "other account's" object was deliberately shared, public, or in a shared workspace both accounts belong to — re-check the fixture policy. - Same body returned but it is *your own* object: the server ignored the supplied ID and served the session object. Compare canary bytes, not status codes. - A 200 with an error envelope, empty list, or redacted fields — the check ran late, not never. Report redaction gaps as their own (lesser) issue only if protected fields actually appear. - CDN or cache served the owner's earlier response to the second account. Repeat with cache-busting and confirm the origin response differs. - Sequential IDs on a *global* object type (countries, public products) where no ownership exists by design. ## Reporting checklist ``` [ ] Policy and intended visibility stated, with source/scope reference [ ] Two controlled accounts; canary object created by the owner account [ ] Entitled control, non-entitled test, independent repeat, negative control, and missing-object control all captured with exchange IDs [ ] Axis of failure identified (verb / version / representation / path) [ ] Invariant named: BOLA (object), BFLA (function), or tenant boundary [ ] Identifier scheme and its predictability stated from evidence [ ] Impact framed by object sensitivity; no real-user enumeration [ ] Sibling surfaces (GraphQL, export, batch, websocket) tested or explicitly listed as untested [ ] Fix stated: server-side ownership check on every access path, indirect reference maps where IDs must stay unguessable ```