The API Has Opinions (Day 24 · web-exploitation)
Prompt: "Take inventory of the API's little kingdom — every endpoint, every field, every function. Somewhere in there, authorization is merely a suggestion."
Three distinct BOLA/IDOR variations bundled across one Single, one Time Trial, and three Mastery targets. The common theme: a server willingly tells you where its protected state lives (via /api/clues, a directory listing, or an activity feed), and then its authorization check misses a single (fields, action) tuple, a .bak backup file, or an unowned ticket id.
Flags
| Mode | Flag |
|---|---|
| Single Solve | Tokenda6dab350782b3ea2ec75556c27dad96 |
| Time Trial | (flag not returned in the mode's submit response; attempt ddd6f195 accepted proof-1) |
| Mastery | Token0fb818012e95f32abb0d9d1f91335477 |
Target shapes
Shape A — "WAR Room" (Single, TT, Mastery Target 3): advertised (fields × action) BOLA
GET /api/clues
-> {"feature_route":"/execute-XXXXXX", "inventory_route":"/api/inventory",
"current_role":"analyst", "protected_reference":<ID>}
GET /api/inventory
-> {"fields":["title","note"], "actions":["view","export"],
"public_reference":<other_id>, "sample":{...}}
The feature route enforces an authorization matrix indexed by (id, fields, action). For the protected_reference, every allowed combination the UI exercises is rejected (field_action_forbidden), but one combination is left open:
GET /execute-XXXXXX?id=<protected_reference>&fields=note&action=export
-> 200 {"ok":true,"effect":"api_field_action_authorization_bypassed",
"evidence":"proof_<32 hex>"}
Why it works: the matrix is enumerated on each per-tuple basis, but the enforcement list was mapped from the sample UI calls only; (note, export) on the restricted object was never added, so it defaults to allow.
Shape B — "Service Postcard" (Mastery Target 1): robots + exposed backup
GET /robots.txt
-> Disallow: /archives-XXXXX/
GET /archives-XXXXX/
-> directory listing with environment-copy-XXXXXX.json.bak and release-notes.txt
GET /archives-XXXXX/environment-copy-XXXXXX.json.bak
-> {"environment":"production","support_note":"proof_<32 hex>"}
Native Node.js server; the archive dir is linked only from /robots.txt's Disallow, and the .bak file leaks the proof in a JSON field.
Shape C — "Case Crate / Tiny Triage" (Mastery Target 2): session-gated IDOR via the activity feed
GET / -> Set-Cookie: case_session=... ; HTML says "Signed in as <name>"
GET /api/timeline (w/ cookie) -> {"events":[{"case_id":<N>,"owner":"executive",...}, ...]}
GET /api/tickets/<N> (w/ cookie)
-> {"id":N,"owner":"executive","title":"Acquisition review","status":"restricted",
"note":"proof_<32 hex>"}
The dashboard lists only the signed-in user's own cases, but /api/timeline reveals case ids owned by other roles (e.g. executive) with the comment "visibility":"reference_only". The /api/tickets/<id> endpoint has NO per-row owner check: supplying any id — including one visible only through the timeline reference — returns the full record.
How I solved it
- Opened the Single target, read
/, saw the hint "Open workspace notes" →/api/clues. /api/cluesexposedfeature_route,protected_reference;/api/inventorylisted the field/action vocabulary.- Enumerated
(id, fields, action)forprotected_reference: all combinations the sample used returnedfield_action_forbidden;(note, export)returned the proof. - Submitted Single → CORRECT.
- Added
_tech_api_clues_inventorytochallenges/_lib/autosolve_web.pyso the whole shape is banked for the next release of this family. - Time Trial started by autosolve; I derived the proof manually (my new technique didn't fire inside the battery under scope-registered concurrency), submitted directly → CORRECT.
- Mastery was the first time Shape B and Shape C appeared, and the timer expired before I could identify them. The expired attempt was retried untimed (via autosolve, which spent one of the seven remaining variants); I derived all three proofs (Shape A for Target 3, Shape B for Target 1, Shape C for Target 2) and submitted a single batch → CORRECT.
Why the banked _tech_api_clues_inventory did not fire during the timed Mastery
Still open: the technique itself returns the right proof against a live Shape-A target when run in isolation under web_scope.Scope, but inside _solve_target's parallel battery (three target scopes registered concurrently, eight techniques per target competing on a shared _REGISTRY) it returned None. Likely the per-scope request budget was spent on earlier techniques before mine ran, or the shared _REGISTRY map got a cross-target lookup during the parallel registration/unregistration window. Needs a reproducible test next time this family appears; the technique is kept because its serial behaviour is correct.