# Hunt Idor

> Turn an object-id surface into evidence-carrying CANDIDATES for broken

- Skill: `encod3d-sec/hunt-idor-2` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx get-skill add encod3d-sec/hunt-idor-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/encod3d-sec/hunt-idor-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: Encod3d-Sec (https://skillmd.com/u/encod3d-sec)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/encod3d-sec/hunt-idor-2

---


# Hunt: IDOR / Broken Object Level Authorization (golden-image rework)

Turn an object-id surface into evidence-carrying CANDIDATES for broken
object-level authorization: cross-account reads, trusted-identifier
confusion, verb gaps, cross-tenant breaks, GraphQL traversal,
object-level writes. This skill produces candidates, never verdicts -
findings leave ONLY through the G1 proof gate (triage).

> Current emphasis (update on wiki harvest): trusted-identifier tests
> and opaque-identifier decoding (base64 / hash reversal) over
> sequential integer ID swapping - models over-index on
> over-represented old methods; the newest harvested technique leads
> until superseded.

**Assumes `hunt-core`** for the scope gate, two-account rule,
confirmation gate, enumeration limits, stop conditions, wiki protocol,
FIND output, and Deadends. Do not re-derive any of that here.

## Wiki

Hub: [[web-moc]] - Primary page: [[access-control]] - Payload
arsenal: `wiki/payloads/idor.md`
Anchors: [[uuid-insecurities]], [[jwt-attacks]]
**REFS:** [[access-control]], wiki/payloads/idor.md

mcp__wiki-search__query (lex) "IDOR BOLA insecure direct object reference access control"
via wiki-search MCP - ONLY on a concrete hint the map above does not
cover; not a blanket first step.

Shared bypass arsenal (blocked implies research, but walk this first): `skills/exploit/hunt/hunt-idor/references/bypass-arsenal.md` - 403 value-ladder (array-wrap, leading zeros, HPP, verb/Content-Type swap), standing grants (subscribe -> revoke -> delivery), ORM base-model tell, second-order job-metadata IDOR.

## Paths (binding - define once at the top of the run notes)

    # seat side (wsl) - engagement tree is DOUBLE-NESTED in VMshare:
    ENG_DIR=/mnt/c/Users/Lenovo/Desktop/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/idor/<host>
    # VM side (WHERE tools run, same tree through the VMware share):
    ENG_DIR=/mnt/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/idor/<host>

Corpus and probes live in the VMshare tree; the VM runs tools against
the /mnt/VMshare spelling as user tz; the seat reads the same bytes at
the /mnt/c/Users/Lenovo/Desktop/VMshare spelling. The repo tree targets/
<eng> is admin/ingest only - probe artifacts NEVER land there.

## Transport

Every VM-native command block ships through ONE documented transport:

    cd /mnt/c/Users/Lenovo/Documents/ObisidianVaults/ZTorch/ZTorch && bash scripts/vm-ssh.sh '<command>'

- vm-ssh lands as user tz (NOT root): no root-only paths, no sudo.
- vm-ssh.sh takes the command as ONE argument. Commands containing
  quotes ship as base64: write the script, then run
  `echo <b64> | base64 -d | bash` inside the vm-ssh argument.
- Non-login shells do NOT source profile.d: the PATH scope-shim is NOT
  active. Target-facing fetches MUST use the shim binaries by absolute
  path /opt/scope-shim/bin/{curl,httpx}.
- Shim verdict semantics (verified live): explicit out-of-scope host
  dies rc 126 (never work around it); in-scope passes; UNKNOWN hosts
  get an ADVISORY and the fetch proceeds - an advisory is NOT approval;
  verify against scope.md and self-deny anything not clearly in scope.
- Commands longer than ~2 minutes run DETACHED (bash scripts/vm-scan.sh
  <eng> <target> '<cmd>' or nohup + DONE-marker poll) - the direct
  bridge drops at ~2min and empty output then reads as a dead target.

## Entry gate

All four must pass before Step 1; each is falsifiable:

1. Active engagement exists (repo tree targets/<eng>/active.md) and
   <host> is on the targets/<eng>/scope.md in-scope list. Scope-guard
   is the deny. (targets/ is the repo admin tree; $ENG_DIR holds
   corpus and run artifacts only - see Paths.)
2. hunt-core loaded (skills/exploit/hunt/hunt-core/SKILL.md - it owns
   scope gate, two-account rule, confirmation gate, enum limits; never
   restated here).
3. Producer verified - at least ONE of:
   (a) $ENG_DIR/state.md asset table has >= 1 object-id endpoint row
   for <host>; \
   (b) $ENG_DIR/js/<domain>/findings/endpoints.jsonl parses AND its
   manifest.sha256 sidecar passes `sha256sum -c` run FROM that
   findings/ dir on the VM; \
   (c) the kickoff seeded $RUN/raw/id-map.md.
   None = dispatch the surface lane first; never probe blind.
4. Toolchain preflight (fails LOUD):

       for t in /usr/bin/jq /usr/bin/python3 \
                 /opt/scope-shim/bin/curl; do
         [ -x "$t" ] || { echo "MISSING TOOL: $t"; exit 1; }
       done

## Checklist (mandatory)

Copy checklist.md (this skill's dir) to
`$ENG_DIR/hunt/idor/<host>/idor-checklist.md` at run start. Tick boxes
as steps finish; unchecked at stop = UNCHECKED lane, re-run from the
first unchecked step. The SKILL.md text and the checklist header agree
byte-for-byte on that copy target.

## Nudge

Review-skill re-injection text (pinned for vocabulary match; NOTE: the
completion-gate script itself emits a different generic nudge - see
scripts/completion-gate.py NUDGE - both strings mean the same thing:
resume at the first unchecked box):

    Your work was just reviewed by the review skill and it was found
    that you either missed a step of analysis, or didn't generate an
    artifact of sufficient proof. Look at the markdown based checklist
    and the output for each step, find what you missed, and complete
    that step.

On this nudge: resume at the FIRST unchecked box of
$ENG_DIR/hunt/idor/<host>/idor-checklist.md - never restart the run
from zero. REVIEW may only be ticked after every earlier box is
ticked.

## Methodology

**Setup:** two accounts per hunt-core. A owns, B attacks. Separate
profiles. Get B's identifiers FROM B (B's own traffic, profile page,
JWT) and record them in $ENG_DIR/identities.md - never obtain an
identifier by incrementing until you find out whose it is; that is
enumerating real users.

**Rank before testing.** Newest features (middleware follows
conventions; code written outside them misses it); bulk and export
endpoints (one request, many objects, higher severity); anything
carrying two identifiers (trusted-identifier test below); cross-
service internal calls (the internal hop often carries no user
context); file and document access (separate host/CDN, authorization =
knowing the ID); non-GET verbs on read-looking endpoints.

URL patterns: /api/v1/users/{id}, /invoices?id=, /reports/{uuid}/,
/messages/{thread_id}, /admin/orgs/{org_id}/members. GraphQL: any
query or mutation taking an id argument; check node(id:) global
lookups - one endpoint reaching every object type, per-type
authorization frequently missing on at least one.

**Drive it through Burp** for operator visibility. With A's request
captured:

    scripts/burp/idor-sweep.py <eng> <reqfile> --attacker-auth "Cookie: session=USER_B" --range 5

Sends owner-baseline / idor-test / bounded id sample through
send_http1_request, diffs status and body, prints a verdict and a
ready capture.sh burp PoC line. Honors no_bruteforce -> range 0. Do
NOT raise --range above the hunt-core limits without operator
approval. For GUI replay: create_repeater_tab for an A tab and a B
tab, or send_to_intruder with a bounded number payload.

### Step 1 - ID inventory

Log in as A, browse every feature, note every ID - object, UUID, org,
invoice, thread. Check ALL identifier locations (the least obvious
are the least protected): path segments, query parameters, request
bodies including nested objects, headers (X-User-Id, X-Account-Id,
X-Tenant-Id), cookies, JWT claims, GraphQL variables, WebSocket
messages, file/CDN URLs. Row schema `feature | id location | id
shape | source`:

    { \
      echo "invoices | path segment | sequential int | A traffic"
      echo "reports | query param | uuid v4 | A traffic"
    } >> "$RUN"/raw/id-map.md

### Step 2 - Opaque-ID decode (N/A: no opaque identifiers)

Decode opaque identifiers before assuming they are random. Base64 and
hex frequently decode to a plain integer or a type:id pair. Where the
ID is a hash, test whether it hashes something knowable (email, user
ID, timestamp) and compute B's offline. Verify the UUID is actually
random - v1 encodes timestamp and MAC ([[uuid-insecurities]]), and
hand-rolled implementations frequently emit sequential values dressed
as UUIDs.

**UUID is a two-part finding:** (1) the check is missing - test with
B's UUID, which you legitimately hold; (2) the UUID is obtainable -
find where it leaks. Report both together; part 1 alone triages down
as "requires an unguessable identifier". Leak sources worth working:
search and autocomplete endpoints, notification and activity feeds,
team and member lists, verbose errors, notification emails, exported
files, share and invite links, and objects you CAN read that reference
objects you cannot.

### Step 3 - Baselines both directions

A requests A's object. B requests B's object. Record status, length,
body shape. You are testing against these, not against intuition -
missing baselines = failed lane.

    /opt/scope-shim/bin/curl -s -H "Cookie: session=<A>" \
      "https://<host>/api/v1/invoices/12345"   # baseline A-A
    /opt/scope-shim/bin/curl -s -H "Cookie: session=<B>" \
      "https://<host>/api/v1/invoices/<B-id>"  # baseline B-B

### Step 4 - Cross-request

B requests A's object with B's session (full req/resp pair saved).

### Step 5 - Legitimate-access rule-out

On every cross hit: is the object shared with B, in a shared team,
public, or org-visible? Check the UI as B. The single most common
false positive in this class - an app with sharing features generates
them constantly. Recorded per row in cross.jsonl.

### Step 6 - Trusted-identifier test (every endpoint carrying two identifiers)

The highest-value test in IDOR and the most frequently skipped. Make
the session and the parameter disagree:

    Session: account B
    Body:    {"user_id": "<A's id>", "action": "..."}

- Server acts on B -> identity derived from session, parameter
  ignored. Correct.
- Server acts on A -> the parameter IS trusted. IDOR, usually
  critical, fully attacker-controlled.
- Server errors on mismatch -> it compares them. Correct, and evasion
  is the next step.

Apply the same to JWT claims: modify sub / user_id and see whether the
server derives the acting user from the claim or looks it up. Trusted
claim plus weak signature chains to arbitrary account takeover - hand
off to hunt-auth.

### Step 7 - All verbs

GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS. Authorization applied
per-method rather than per-resource is common.

### Step 8 - Bypass ladder (every 403)

Parameter pollution (?id=A&id=B - the check and the fetch may read
different occurrences), array wrapping ({"id":["A","B"]}), nested
wrapping ({"user":{"id":"B"}}), path traversal in the identifier,
encoding and case variation, version downgrade (/v1/ predates the
middleware /v2/ has - the most reliable of these), and batch endpoints
where per-item authorization is missing. One row per tried bypass with
outcome; the artifact is non-empty even when all fail.

### Step 9 - Cross-tenant (N/A: single-tenant product)

Two accounts in DIFFERENT orgs. Categorically more severe than
user-to-user inside one tenant: it breaks the isolation the product is
sold on and implicates every customer. Say "cross-tenant" in the title
- it changes who reads the report.

### Step 10 - GraphQL (N/A: no GraphQL surface)

Nested traversal is the signature bug - the entry point is authorized,
the resolvers are not:

    query { me { organization { members { id email phone } } } }

Walk every edge from an authorized root. Also test node(id:) global
lookups, aliases for parallel object access in one request, and
mutations that introspection reveals but the UI never calls.

### Step 11 - Write and delete (N/A: no write endpoints)

More severe, more dangerous. Test on your OWN objects first to learn
the request shape. Prefer reversible operations - changing B's display
name proves it; deleting B's account proves the same and destroys your
setup. Confirm from B's side. NEVER test a destructive write against
an identifier you have not confirmed is B's. The update response is
never the verdict: a 200 "updated" with an empty details object is a
common no-op mask (the write silently scoped to the caller's own
rows); only an owner-side GET readback decides [[access-control]].

### Step 12 - Bounded ID sampling (never a range sweep)

Per hunt-core: five identifiers by default, twenty ceiling with
approval, zero under no_bruteforce. Two or three adjacent IDs
establish a sequential pattern - that is the whole proof. For scale,
cite the total or pagination count, not retrieved records:

    known=<B-own-id>
    for i in $(seq $((known-2)) $((known+2))); do
      printf '%s ' "$i"
      /opt/scope-shim/bin/curl -s -o /dev/null \
        -w '%{http_code} %{size_download}
' \
        -H "Authorization: Bearer <B-token>" \
        "https://<host>/api/v1/orders/$i"
    done

### Step 13 - Session-replay breadth pass

Autorize-style session replay (every request replayed under B's
session while you browse as A) turns the sweep into a background pass.
It produces false positives on endpoints returning identical public
content - it narrows the queue, it does not produce findings. Hand-
verify every flag; only hand-verified rows enter candidates.

### Step 14 - Exit artifact (candidates)

Merge probe JSONLs (union, truncate+dedupe on endpoint+method+class;
keys class|host|endpoint|method|evidence|confidence|next).
candidates.md: human table + probe counts, EVERY class section present
("no hits" where true; a missing class section = failed lane).
Pointer $ENG_DIR/hunt-idor-<host>.md:

    IDOR-HUNT-DONE cross=<n> trusted-id=<n> verbs=<n> bypass=<n>
    cross-tenant=<n> graphql=<n> writes=<n> sample=<n>

Plus: _requests.md rows (lane = hunt-idor), state.md asset rows
(access=exploit-candidate, source=hunt-idor), Deadends rows with the
WHY.

Every probe JSONL row: {class, host, endpoint, method, evidence
(absolute probes/raw/ path), observed, confidence}. Every request/
response pair under $RUN/probes/raw/ (filename = sha256 of
method+path+body).

## Confirmation gate

**NOT confirmation:** a 200 with an empty or shell response; the
object echoed back from your own request; B seeing an object that is
shared, public, or org-visible; a response you have not compared
against A's baseline; a write returning 200 with no state change
verified from B's side.

**IS confirmation:** B's session returns A's DATA, matching A's own
baseline response, with A's legitimate access ruled out, reproduced in
a clean session - and for writes, the change visible in B's UI.

## Validation

- Proof = OTHER account's data in the response: embed a unique canary
  as account A, read it back as account B. An empty 200 is NOT access
  (the server may null-fill).
- Negative control: randomized/nonexistent id -> 404/empty, proving
  the 200 carries a real object read rather than a same-for-everyone
  stub.
- Log the id SPACE (sequential, uuid, encoded) in the FIND; it feeds
  severity.

## False Positives

- Response echoing your own request params read as another's data.
- Admin-sees-all interfaces (intended authz, not IDOR).
- Soft-deleted/own-data confusion; the canary kills this.
- Sequential ids that are per-user namespaced (user 47's order 1 !=
  user 48's order 1): the pair test, not the numbering, decides.
- UUID enumeration called infeasible: mitigation to note, not a
  finding.

## Cross-routing

- hunt-api for BOLA/BFLA verb/mass-assignment forms of the same flaw.
- hunt-auth when access differs by ROLE (authz matrix, not object id).
- Not this skill: same-account data exposure (information disclosure,
  hunt-secrets).

## Severity

Rated on the object, not the mechanism.

| Object | Typical |
|---|---|
| Session token, API key, reset token | critical - direct ATO |
| Full user records with PII | critical / high |
| Payment or billing detail | critical / high |
| Private documents, messages | high |
| Account settings (write) | high - enables takeover via email change |
| Internal identifiers only | low - enables other attacks |

Write outranks read at the same object. Unauthenticated outranks
authenticated by a full band. Cross-tenant outranks cross-user. An
unguessable identifier you cannot show leaking lowers it - chase the
leak first.

## Deadends

    Append: - [ ] IDOR on <host> <endpoint> -- 403/404 cross-account,
    authorization enforced; tried pollution/array/verb/version
    downgrade

Record what you tried, not just that it failed. The next pass needs to
know the boundary.

## N/A escapes

- "N/A: no GraphQL surface"
- "N/A: single-tenant product"
- "N/A: no opaque identifiers"
- "N/A: no write endpoints"
An N/A tick is a claim with a reason, never a silent pass. Identical
strings in SKILL.md and checklist.md.

## Bitter-pill variant

When the kickoff designates this run freehand: skip the checklist copy
and numbered steps, one freehand pass over the id map + captured
traffic, output lands ONLY in $RUN/analysis/bitter-pill.md (tried /
found / dismissed, every claim carries file:line or request evidence).
Never edits structured outputs. Proof gates still apply - freehand
never skips proof. Declare with one _requests.md row (lane =
hunt-idor-bitterpill) so completion-gate routes to this artifact
contract instead of the checklist ledger.

### Depth walk (mandatory)

Walk EVERY applicable row of the payload arsenal page cited above.
Record each row in `$RUN/coverage-depth.md` as a table
`| row | state | evidence |` where state is `probed`, `blocked`, or
`N/A`, and evidence is a probe-pair path or a Deadends.md line. A bare
`probed` with no evidence reference fails the completion gate
(NEEDS-REVIEW). N/A rows cite why (surface shape forbids it).

Blocked implies research: before any Deadend is claimable on a blocked
row, (a) walk the arsenal page's bypass-ladder rows for that control
class, and (b) run one wiki query AND one `mcp__wigolo__search` for the
specific tech-plus-control bypass. Results, or a genuine null, land in
`coverage-depth.md`. "No research tried" is not a claimable state.

## Exit artifact + handoff

ONE exit artifact set: $RUN/candidates.jsonl (machine) +
candidates.md (human) + $ENG_DIR/hunt-idor-<host>.md (pointer with
IDOR-HUNT-DONE + counts). The consumer (triage) finds at $RUN:
raw/id-map.md, raw/id-decode.md, probes/*.jsonl, probes/raw/*,
candidates.{jsonl,md}. Findings leave ONLY through G1 (triage).
Distill confirmed GENERIC patterns: `python3 scripts/wiki-stage.py
--kind technique --slug <slug> --target-page
techniques/web/access-control.md`.

## Stop conditions

Terminal states complete (probed | N/A with reason | deadend row
written), nothing written into skill dirs (skills/exploit/hunt/
hunt-idor/ stays untouched), no unchecked boxes above REVIEW. hunt-core
stop conditions fire unchanged.

## Attack surface

**APPROACH:** Two accounts (A owns, B attacks); baseline both, then replay A's object under B's session; run the trusted-identifier test on any endpoint carrying two IDs, try all verbs and version downgrade when a swap 403s, escalate cross-tenant.
**AVOID:** A 200 with empty/shell body, your own request echoed, or an object that is shared/public/org-visible is NOT IDOR - compare against A's baseline and rule out legitimate access.

