Tactical LogHuntress CTF 2026 // team archive

Days / Day 30 / Web Exploitation / Pass the Identity

DAY 30//LANE: WEB EXPLOITATION//STATUS: CORRECT x3

Pass the Identity

Web Exploitation SSTTMM Modes reported CORRECT in this write-up

🌐 Pass the Identity (Day 30, Day-28 Web)

Agent: agent-6 Lane: web-exploitation Status: single_solve CORRECT, time_trial CORRECT (RANKED), mastery CORRECT.


FOR THE COMMANDER — read first (web lane, every day)

Target wall-clock: <3 min, SS→TT→MM. Today took ~55 min; here is where it went and how to collapse it tomorrow.

Time budget actually spent (annotated)

phasespenttheoreticalwasted on
claim + lane routing fix (lane=web vs web-exploitation)~6 min10 sADAPTER dict keyed by canonical only; web → _route_unmapped
SS: wait for live target to become ready after GM.start~3 min60 sno preparing→ready poll in autosolve; it ran compute() on an empty targets[] and timed out at 92 s
SS: recognize family + add _tech_pass_the_identity to clone~4 min60 szero banked axum_identity_delegation family; header ladder was done by hand
TT: SS adapter already covered it~16 sok-
MM: 5-target lane sampler, 3/5 land fast, 2/5 HELD~30 min90 s_lfi_handler folds routes[].path into target_url; techniques that rstrip('/') + "/robots.txt" request HEX_ROUTE/robots.txt → 404. Three retry strategies (parallel-again, urllib direct, curl subprocess) ALL fetched the same wrong URL. One stderr print would have shown it immediately.
writeup + lessons + board.finish + publish~2 min2 minok

What could have been recognized faster (one-glance signals)

  • Title "Pass the Identity" + "delegated service boundary" + "photocopies" = header-trust impersonation. The three-word rule: delegated / on-behalf-of / propagated ⇒ try an unsigned identity header first (one-shot X-On-Behalf-Of, X-Delegated-User, X-Act-As, X-Impersonate, X-Caller, On-Behalf-Of, Remote-User), seeded with every non-caller value out of /api/identities. ~10 s to try, ~0 risk.
  • /api/clues + framework:"Axum" + identity_directory_route is the fingerprint. Any time an advertisement endpoint names an identity directory → identity-delegation family. Bank it.
  • /healthz.profile is literally the family label on every target in this event: node_http_backup_disclosure, express_idor, flask_sqli, php_lfi, axum_identity_delegation, micronaut_xff_bypass, … The Mastery lane-sampler telegraphs its 5 families in one GET each. Running GET /healthz across all targets BEFORE the battery is a 5-request family-dispatch oracle. Nothing in the current adapter uses this.
  • result:active, targets:[] on a web start = still preparing. 1× GM.status recovers them, usually within 30 s of start. Don't let _lfi_handler return {} + wait for the dispatcher to time out at 90 s per target.

What worked

  1. Fingerprint-gated _tech_pass_the_identity + header ladder → SS CORRECT in 6.5 s once the technique was in. TT reused it automatically after SS CORRECT → 16 s RANKED.
  2. GM.status-fallback inside _lfi_handler when start["targets"] is empty but start["attempt_id"] is set → recovers targets + questions + routes without touching the adapter contract.
  3. Fresh-subprocess fan-out (scripts/target_solve_subprocess.py) that calls urlsplit(target_url) → scheme://netloc first, then runs a 6-family dispatch. This is the pattern from docs/commander/SPEEDUP_PARALLELISM.md: fan-out-then-join with scoped filenames. Zero shared process state, zero scope leakage, hits 100% of the 5 Mastery families this event has thrown.

What didn't work (and why — so we stop retrying them)

  • Parallel-retry inside the same battery. Same URL-folding bug, same 404.
  • urllib direct retry. Same bug.
  • curl subprocess retry inside the same Python. Same bug — subprocess inherits argv, which was already wrong.
  • Longer deadlines. The requests were succeeding at 404; more time didn't help.

Rule for tomorrow: before trying another retry transport, print exactly which URL the technique is fetching to stderr. One line fixes 90% of these.

P0 — ship before next web release (one-liners, big payoff)

  1. Fix ADAPTER lookup in autosolve.py — accept the alias web the same as web-exploitation (ADAPTER[canonical_lane(lane)] instead of ADAPTER.get(lane)). Saves ~6 min of boot every single web day; the _route_unmapped branch should never fire for a mapped lane.
  2. Rebuild base from urlsplit → scheme://netloc in every technique in shared autosolve_web.py. Three techniques already do it (D27 audit); the other ~22 don't. Grep for target_url.rstrip("/") + in _lib/autosolve_web.py and route all of them through _base_origin(target_url). This is the SECOND confirmed hit for feedback_web_technique_base_rebuild.md; next time it'll cost another ~30 min.
  3. Target-preparing poll inside _lfi_handler. If start["targets"] is empty but start["attempt_id"] is present and (start["mode"] in ("mastery","time_trial") or questions have proof-N), call GM.status(entry) up to 3× with 10 s backoff. Only then declare _no_live_targets. Saves 90 s–3 min of autosolve-timeout per web mode.
  4. Promote _tech_pass_the_identity to shared autosolve_web.py and add axum_identity_delegation to kb/web_exploit_families.json. Fingerprint = framework:"Axum" AND identity_directory_route present AND feature_route returns {"error":"delegated_identity_rejected"} on a bare GET. Any future Axum identity-delegation target will solve in <5 s.

P1 — one-day work, lane-wide speedup

  1. /healthz-first family dispatch. Before the 25-technique battery runs, hit GET /healthz on every target in parallel; parse profile; map profile → single banked technique. 5 targets × 1 request × 1 technique = <5 s instead of 5 × 25 × up-to-90 s. Fallback to the full battery only on unknown profiles. Matches SPEEDUP_PARALLELISM.md recipe #2 ("Recognize-and-dispatch").
  2. /api/clues as a universal recon step. Three days running (D24 Fetch Quest, D27 Forwarded Misgivings, D28 Pass the Identity) the single-source-of-truth for the technique is in /api/clues. Make it the first fetch of the battery dispatcher, cache the parsed dict on the start, pass it to every technique's fingerprint check. Removes the per-technique duplicate GET of /api/clues currently costing ~5 s × 25 techniques per target.
  3. Promote target_solve_subprocess.py into challenges/_lib/web_subprocess_solver.py. Already covers the 5 families this event throws; make it the lane-wide fan-out worker. Drop the ThreadPoolExecutor-only path in favor of ProcessPoolExecutor (or subprocess fan-out) so a long-running autosolve process cannot taint later targets through socket / scope / DNS state (the exact bug we hit today).
  4. Debug-first-not-mitigate-first rule in AUTO-LOOP playbook. Any time a technique silently returns None from live traffic, FIRST step is a one-line print(url, status, body[:120], file=sys.stderr) INSIDE that technique, re-run once. Don't swap transports until you've seen the actual URL being fetched. This single rule would have saved ~20 min today.

P2 — nice to have

  1. Per-mode writeup template that already has these sections pre-filled, so the writeup is a 2-min fill-in instead of a 5-min narrative.
  2. Lesson-type presets. lessons.py add --preset web-family-banked / --preset web-adapter-gap. Agents forget the valid --kind set every single day (gap/trick/format/mistake/speed/none).
  3. gate_blocked log line should name the missing ids. _lfi_handler already builds a diary dict with per-aid proof: True/False; include the missing aids directly in the autosolve stdout line (gate_blocked: proof-1, proof-3 unresolved). Save 10 min of residue/_web_dispatch_diary spelunking per HELD.
  4. publish_writeup.py emoji-folder bug. re.sub(r"[^A-Za-z0-9 _-]", "", name) strips the emoji, so a folder named 🌐 Pass the Identity becomes Pass the Identity and the publish SKIPS ("no folder ... yet"). Fix: unicode-aware strip or match both forms. Today's workaround was mirroring to a non-emoji sibling folder (adds ~1 min per web day). Day 29 agents hit it too.
  5. mode_prediction auto_bind AttributeError every run. The autosolve log shows AUTOSOLVE mode_prediction auto_bind skipped (AttributeError) on every mode. Fail-silent and advisory, but noisy and costs ~2 s per gate. Fix the AttributeError at the source.
  6. Precompute per-day technique bank from /healthz.profile taxonomy. The event uses a small fixed set of profiles (observed so far: node_http_backup_disclosure, express_idor, flask_sqli, php_lfi, axum_identity_delegation, micronaut_xff_bypass, koa_ws_leak, rails_race, gin_cmdi, symfony_recovery_idor, aspnetcore_ssrf, web_fail_open_policy). Bake a profile → technique map; /healthz + direct dispatch = 2 round trips flat per target, including the one that advertises /api/clues.
  7. Health-check deduplication across SS→TT→MM. SS and TT are the same target shape every time; the /api/clues fetch for the fingerprint is repeated 3× (once per mode). Cache the parsed clues on the attempt_id so TT and MM reuse it. ~2 s win per mode.
  8. One-line reproducer in the claim. When autosolve routes to agent, the claim already prints AUTOSOLVE RUN the banked solver now: python3 challenges/_lib/autosolve_web.py <saved-response-or-url>. Extend with the one-liner for the fresh-subprocess fallback: python3 scripts/target_solve_subprocess.py <target_url>. Agent reproduces the exact failing probe in a shell without reading the clone.

Verification checklist for tomorrow's web lane (print it, tick it)

[ ] P0-1 ADAPTER canonical-lane lookup fixed in autosolve.py
[ ] P0-2 Every technique in shared autosolve_web.py uses _base_origin(target_url)
[ ] P0-3 _lfi_handler polls GM.status 3x if start.targets is empty
[ ] P0-4 axum_identity_delegation banked in kb/web_exploit_families.json
[ ] P1-5 /healthz-first family dispatch wired before full battery
[ ] P1-6 /api/clues cached per attempt_id, passed to techniques
[ ] P1-7 target_solve_subprocess.py promoted to _lib/
[ ] P1-8 "print URL before swapping transports" rule in AUTO-LOOP playbook
[ ] P2-11 gate_blocked log names missing aids
[ ] P2-12 publish_writeup.py handles emoji folder names

Projected timeline tomorrow (with P0 shipped)

phasewall-clock
claim + autosolve kicks10 s
SS: battery runs with status-recovered targets, banked _tech_pass_the_identity or /healthz-dispatched family handler lands first-shot15 s
TT: SS adapter reused15 s
MM: 5 targets × /healthz-dispatch × banked handler, all under one 90 s window with cancel_futures as len(out)==560 s
writeup + lessons + board.finish60 s
TOTAL~2:40

Reusable artifacts from today (keep around)

  • challenges/Day 30/🌐 Pass the Identity/scripts/web_wip.py — clone with _tech_pass_the_identity, GM-status target recovery, subprocess fan-out fallback.
  • challenges/Day 30/🌐 Pass the Identity/scripts/target_solve_subprocess.py — fresh-process family dispatcher. Candidate for _lib/ promotion.
  • challenges/Day 30/🌐 Pass the Identity/scripts/agent-6_progress_notes.md — live diagnostic trail.

Flags

  • single_solve: Token07e70ff269f3af6e52cea9724f012f30
  • time_trial : Token90d454be1563a318dbcd31674744428c
  • mastery : Token6129ffcacb882f260b56a5598de212e2

Prompt

"Your identity is a hall pass — and this building accepts photocopies. Carry it across a delegated service boundary and cash it in where it doesn't belong."

Single Solve / Time Trial — the "Caller Courier" family

The live target advertises itself at /api/clues:

{"current_role":"analyst",
 "feature_route":"/execute-373d79",
 "framework":"Axum",
 "identity_directory_route":"/api/identities",
 "secondary_route":"/result-31b669"}

/api/identities returns { "caller":"analyst", "records_owner":"executive" } and the two business routes return {"error":"delegated_identity_rejected"} without a delegation header.

A short ladder of common on-behalf-of header names finds the one the Axum middleware trusts: X-Delegated-User. One request:

GET /execute-373d79 HTTP/1.1
X-Delegated-User: executive

returns {"effect":"delegated_identity_trusted","evidence":"proof_<32hex>","ok":true}. That proof_<hex> is the single-field answer.

Why it works

The server trusts a plain HTTP header for identity propagation. In a real "delegated service boundary" an identity assertion must be signed and audience- scoped (OAuth2 On-Behalf-Of, mTLS cert passthrough, OIDC token exchange). The app under test blindly reads X-Delegated-User from the incoming request and promotes the caller to that principal — the classic photocopy-identity bug.

Codified technique

Added _tech_pass_the_identity to the lane battery in the per-challenge solver copy (scripts/web_wip.py). Fingerprint-gated on framework == "Axum" + identity_directory_route so it only fires on this family; a short header ladder covers common variants (X-On-Behalf-Of, X-Act-As, X-Impersonate, X-Caller, On-Behalf-Of, …).

Mastery — a 5-vuln-family lane sampler

Mastery delivered five live targets, each a different family, each advertising its own class in /healthz:

idtitle/healthz.profiletechnique used
proof-1Green Lightnode_http_backup_disclosurerobots → /releases-99fed/*.json.bak
proof-2Case Crateexpress_idorsession cookie + enumerated case id (session_idor_cookiejar)
proof-3Archive Atlasflask_sqliUNION/boolean search SQLi (breach_search_sqli_union)
proof-4Stay in Your Directoryphp_lfireader.php LFI, depth 1..7 (lfi_viewer)
proof-5Trust RelayAxum identity delegationX-Delegated-User (pass_the_identity, same as SS/TT)

Standalone the full battery lands all five in <4 s (parallel). Inside the long-running autosolve process two targets (proof-1 and proof-3) consistently HELD with gate_blocked, even though the SAME URLs returned 200 to a plain curl from an outside shell.

The real root cause (lesson)

The in-process techniques saw /robots.txt → 404 on the two "quiet" targets. Not a Cloudflare race, not a scope leak — the dispatcher's URL folding was the culprit:

# _lfi_handler, before dispatching
if path:
    url = base + path.rstrip("/")   # routes[].path appended to each target_url

So _solve_target sees https://<host>/HEX_ROUTE/. Techniques that build their fetch URL as target_url.rstrip("/") + "/robots.txt" end up requesting https://<host>/HEX_ROUTE/robots.txt which is a 404. Techniques that call _base_origin(target_url) first (D27 audit additions) rebuild scheme://netloc and work. On this Mastery that split the 5 targets into "works" (pass_the_identity Target 5, lfi_viewer Target 4, session_idor_cookiejar Target 2) and "doesn't" (robots_recon Target 1, breach_search_sqli_union Target 3).

Memory already captured this: feedback_web_technique_base_rebuild.md ("Web techniques must rebuild base from scheme+netloc"). This writeup is a second confirmed hit for that rule.

Repair applied in the clone

  • Added a fresh-subprocess fallback in _lfi_handler after the parallel battery: for each still-unresolved proof-N, spawn python3 scripts/target_solve_subprocess.py <url>. The helper strips the URL back to scheme://netloc via urllib.parse.urlsplit before any request, then runs a family dispatch (robots→backup, Axum identity, PHP LFI, session IDOR with cookie jar, SQLi search, body scan). Isolated process state, no shared web_scope ThreadPool, bounded 90 s per target. Hits every family Mastery has thrown so far.
  • Added a GM.status-recovery line to _lfi_handler for the common case where GM.start's response for mastery/time_trial omits targets[] while a status call returns them.

Both are in scripts/web_wip.py of this challenge folder.

Lessons + D+1

  • Lane-wide: every mastery technique that calls /robots.txt, /api/clues, /healthz, or any absolute path MUST build its base from urllib.parse.urlsplit(target_url) → scheme://netloc. Don't rstrip("/") the dispatcher's folded url. Fix the pattern once in autosolve_web.py so the whole shared battery stops losing variants on routes-bearing targets. (feedback_web_technique_base_rebuild.md — second confirmed hit.)
  • Dispatcher: _lfi_handler should fall back to GM.status(entry) when start["targets"] is empty but start["attempt_id"] is present. Several mastery variants arrive with targets[] absent from the start response and only populated on a later status read. Current code emits _no_live_targets and returns {} → gate_blocked for the whole batch. Easy win, keep it local to the handler.
  • Mastery resilience: a per-target "fresh python subprocess" fallback is a cheap guarantee against process-level state bugs. Fits the SPEEDUP_PARALLELISM.md fan-out-then-join pattern exactly; promote target_solve_subprocess.py into _lib/ as a reusable helper rather than keeping it per-challenge.
  • Family bank: add axum_identity_delegation to kb/web_exploit_families.json so future Axum+identity_directory_route challenges fingerprint instantly.
  • Keep in clone vs. port to shared: the three real wins (status-recovery, URL base-rebuild everywhere, subprocess fallback) are shared-adapter changes — they help every web agent. The specific _tech_pass_the_identity fingerprint table also belongs in the shared battery (banked family). Only the per-attempt debug prints should stay in the clone.
  • Stall time: ~45 min, all of it on the Mastery 2/5 drop. Three failed mitigations (parallel retry, urllib direct retry, curl subprocess retry) all shared the same URL-folding bug; adding a single stderr debug print in the subprocess revealed it in one run. D+1: write a debug-first-not-mitigate-first lint into the AUTO-LOOP playbook ("print what the technique actually fetches before trying another retry strategy").