entity relations: html entities, and a line decoder that lost a reading it already had

huntress ctf 2026, day 8 · warmups · all three modes

tools used: decoding search engine and timed-attempt pipeline.

the prompt was one line: "the browser understands. do you?" the new encoding was html character references, &#NN; per character, the form a browser turns back into text without being asked.

the key insight: nothing new had to be decoded. the registry's escape reader already passed text through an html unescape, so the single and the time trial fell to the day-7 solver. the mastery bundle exposed a ranking bug instead: on short entity chunks the correct reading tied with copies of the raw text and was dropped before the combination search ever saw it.

challenge shape

one answer field per blob: the slug that the final non-empty decoded line tells you to submit. the single and the time trial delivered one blob; the mastery delivered a zip of 38 blob-NN.txt files under one clock, one per answer set.

artifact anatomy

the single and the time trial were one line: the whole sentence as decimal references, &#78;&#105;&#99;&#101; for Nice and so on, with no hex (&#x4e;) or named (&amp;) forms. every mastery blob uses the numbered-line layout from day 2: NN<tab>chunk lines, each chunk encoded on its own. on day 8 a blob had eight lines, and line k carried day k's encoding: base64, rot13, hex, binary groups, decimal, octal, percent escapes, and then the new one:

08	&#97;&#110;&#100;&#32; ...      # illustrative: decimal character references

the message is split evenly across the lines, so each chunk is short: about a dozen characters of plain text per line on day 8.

extraction method

the per-line decoder collects every printable single-transform reading of each line, keeps the best few per line by english score, and searches combinations in descending total score until the joined text carries a slug on its last line. the escape reader turns \x4e, N and octal escapes, or html references when the text has no backslash, back into characters:

def escapes(text: str) -> str:
    out = text
    for _ in range(ESCAPE_ROUNDS):          # to a fixed point: &amp;#97; -> &#97; -> a
        step = ESCAPE.sub(_unescape, out) if "\\" in out else html.unescape(out)
        if step == out:
            break
        out = step
    if out == text:
        raise ValueError("noop")
    return out

for an entity line that reading is correct and printable. the problem was the ranking around it.

validation and answer formatting

the slug is accepted only from the final non-empty line of a decoding that also reads as english. its shape now comes from the question's own syntax text (three words, a two-digit number) rather than a constant, so a changed shape is read from the question instead of failing the match. the answer is the slug as written.

failed approaches and pivots

the per-line candidate list was cut to the best four readings by english score. an english score counts known words, and a twelve-character chunk of ordinary text often contains none, so most readings of a short line score zero. for an entity line the zero-score readings included the raw text itself (plain), plus rot13 and atbash of it: entity text has almost no letters, so both return an identical or near-identical copy. those three copies filled the list ahead of the real reading, which also scored zero, and the combination search never saw it. the solver then fell back to a full breadth-first peel over the whole blob, which had a depth limit but no node limit and ran for minutes.

the fix has four parts:

automation across modes

the same solver read all three modes. we then replaced the per-line ranking with a scorer that looks at the whole message. a beam grows the message line by line, every reading of every line appended to every kept hypothesis, and scores the result with letter-pair log-probabilities, including the pair that spans a line boundary:

for line in options:                       # options: (name, text, inner score)
    grown = [
        (score + inner + _char_cost(last, text[0]), text[-1], (*path, j))
        for score, last, path in beams
        for j, (_, text, inner) in enumerate(line)
    ]
    beams = _prune(grown, width=64, per_state=6)

a three-letter chunk is judged by how it continues the text before it, which no per-line score can do. pruning keeps at most six hypotheses per final character, since hypotheses that end alike score alike from there on and would otherwise fill the beam with near twins. the letter-pair table and the word list are committed files, so every machine ranks the same way. lines without numbers decode in file order through the same beam, and a line that needs two transforms is tried only after every single-transform reading has failed.

on day 8 we also added decoders for the representations a browser or a style sheet would read: unicode escapes (\u{61}, %u0061, U+0061), css escapes (\61 ), nato words, seven-bit binary groups and utf-16 text inside base64.

lessons

solve times

public scoreboard · day 8 finish: top 10

  • 0:04.1single#3 of 239 solvers
  • 0:05.7time trial#2 of 219 solvers
  • 12:43.6mastery#40 of 214 solvers
  • #7team day finishof 177 teams that cleared it, in 12:43.6
  • #2single 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 2s 1 0
mastery 12m38s 5 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 no deadline 0.5s -
mastery no deadline 12m37s -

the game master served both winning attempts from its untimed pool: the saved assignments carry run_for_time: false and deadline: null, and the board left both modes unranked. that is why the mastery attempt stayed open for the twelve minutes the fix took.

where we got stuck

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

{generated by a clanker}