webview bridge: a caesar shift on the answer text itself

huntress ctf 2026, day 7 · mobile android · all three modes

tools used: android apk toolkit and timed-attempt pipeline.

the apk's story was a javascript bridge exposed to an untrusted origin. as on every earlier day, the answer itself lived in the puzzle asset, assets/huntress_puzzle.json, encoded with the codec the asset names. day 7's codec was caesar with an integer key.

the key insight: this caesar shift is applied to the characters of the answer text directly. our keyed codecs had assumed a base64 layer under any keyed byte step (true for day 4's xor), so the declared codec failed and the answer came from the fallback key search instead.

challenge shape

one field, the answer code (ANS- followed by 16 hex digits). the single and time trial delivered one apk; the mastery three, each with its own key.

artifact anatomy

{"schema": "huntress.mobile.puzzle.v1", "day": 7,
 "codec": "caesar", "data": "<shifted text>", "key": <integer>}

every character of the answer was shifted up by key code points: with a key of 10, A becomes K and - becomes the digit seven, so the data is printable but not base64 (it contains characters such as ] and >). keys varied per variant, from 3 to 18 across our five apks.

by hand:

answer = bytes((b - puzzle["key"]) % 256 for b in puzzle["data"].encode("latin-1")).decode()

extraction method

the codec name is an alias for the keyed add step, which undoes an upward shift by subtracting the key from every byte. what changed on day 7 is the input to that step. the day 7 fix base64-decoded a keyed step's input only when the text fit the base64 alphabet; day 9 replaced that test (see the day 9 post) with apk._byte_sources, which hands the step every byte reading of undecoded data plus the raw text, and lets the answer shape pick:

def _byte_sources(text, decoded):
    if decoded:                       # an earlier step already made bytes
        return [text.encode("latin-1")]
    out = []
    for fn in BYTE_READINGS:          # base64, url-safe base64, hex
        try:
            out.append(fn(text.strip()))
        except (binascii.Error, ValueError):
            continue
    return [*dict.fromkeys(out), text.encode("latin-1")]

with that, caesar decodes directly. before it, the declared chain produced nothing answer-shaped, and the decoder fell back to trying every single-byte key with each keyed operation over the raw data until the result matched the answer shape. that fallback found add with the right key in a few milliseconds, so the flag was never at risk, but a fallback hides how well the declared codec is understood.

validation and answer formatting

every decode, declared or searched, must produce exactly the answer shape (ANS- plus 16 hex digits) or it is rejected. the decoder reports when it had to search, so a codec that only works by search stays visible.

failed approaches and pivots

none that cost time. the declared codec failed silently into the search on every mode; it was noticed in the logs and fixed on day 7.

automation across modes

the same decode handled every key; the key is read from the asset, never assumed. the time trial and mastery were each answered about a second after the artifact arrived (1.3s and 0.8s on the clock).

lessons

solve times

public scoreboard · day 7 finish: top 3

  • 0:04.7single#2 of 210 solvers
  • 0:08.1time trialfirst blood, +2.6 s
  • 0:11.0masteryfirst blood, +2.0 s
  • #3team day finishof 179 teams that cleared it, in 4:44.3
  • #1single orderof the day's 5, 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 1s 1 0
time trial 4s 1 0
mastery 3s 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 9.0s 1.3s 7.7s
mastery 10.0s 0.8s 9.2s

where we got stuck

flags: single, time trial, and mastery [redacted].

{generated by a clanker}