reflection maze: an unknown codec name, read by its answer's shape
huntress ctf 2026, day 19 · mobile android · all three modes
tools used: android apk analysis and timed-attempt pipeline.
the prompt framed the day as reflective dispatch across generated call graphs, and each case asked for the backend answer code. underneath, every apk carried the same puzzle asset the category has used since day 1.
the key insight: the call graph is decoration. the answer comes from assets/huntress_puzzle.json, whose codec names how data is encoded; the single named a codec we had never seen (reflection), and a reading that has the answer code's shape is the answer whatever the name. here the first reading, the data as stored, already had it.
challenge shape
single 1 field one apk, the case's answer code
time trial 1 field one apk
mastery 5 fields five apks, one answer code each
artifact anatomy
reflection_maze.apk
AndroidManifest.xml
classes.dex
assets/huntress_puzzle.json {"schema": "huntress.mobile.puzzle.v1",
"day": 19, "codec": "...", "data": "..."}
META-INF/...
the mastery's five apks had the same layout with earlier days' codecs, one per set: xor with an integer key (day 4), hex, split, native, and reflection again. the time trial was reflection too.
extraction method
the decoder maps a codec name to a chain of steps (a table of aliases: base64, rot13, reverse, keyed ciphers, kdf-derived keys). a name the table does not know is not an error: it maps to no steps, so the data is checked as stored first; only if that fails does a keyed search run (every single-byte key, then 2-4 byte keys recovered from the ANS- prefix), then a breadth-first peel through every transform. a reading counts only when it matches the answer's pattern from the question's syntax.
try:
steps = steps_for(codec) # `reflection`: no entry
except ValueError:
steps = [] # so the data as stored comes first
for out in chain(steps, data, puzzle):
if ANSWER.fullmatch(out): # ANS-[0-9A-F]{16}
return out
keyed = keyed_peel(data) # never reached on day 19
for reflection the first check matched: data was the code in clear. to see it yourself, unzip -p reflection_maze.apk assets/huntress_puzzle.json prints the json, and its data is already ANS- plus sixteen uppercase hex digits.
validation and answer formatting
the answer pattern is strict (a fixed prefix and a fixed-length code), so a wrong step almost never produces a match; a reading that does not match is discarded, never submitted.
automation across modes
the time trial and mastery set 5 were reflection again and took the same as-stored check, as did the native set; xor and hex resolve by the alias table and split by its parts reader. the searches only run when no reading has the shape.
lessons
- a codec name is a hint, not a contract: when the output has a strict shape, check the data as stored first, then search, and let the shape decide.
- do not add an alias the grader has not confirmed: the as-stored check already answers the name, and a guessed alias could shadow a better reading.
solve times
public scoreboard · day 19 finish: top 3
- 0:03.1singlefirst blood, +1.1 s
- 0:04.8time trialfirst blood, +1.7 s
- 0:06.5masteryfirst blood, +2.6 s
- #3team day finishof 153 teams that cleared it, in 17:56.2
- #1single orderof the day's 8, by our flag time
from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.
from when we started working on the mode to its flag.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 0.6s | 1 | 0 |
| time trial | 0.7s | 1 | 0 |
| mastery | 0.5s | 1 | 0 |
the clock
server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.
| mode | time available | time used | time left |
|---|---|---|---|
| time trial | 50.0s | 0.7s | 49.3s |
| mastery | 170.0s | 0.5s | 169.5s |
where we got stuck
- nowhere: every mode's first attempt was correct.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}