A player connects with nc, lands in an ANSI terminal on Omega, and has a broker
in front of them selling a Spectre clearance code for 45,000 credits. The honest
work available pays 18,000. Closing that gap is the challenge.
I wrote Manual Override for CSAW '26. It is a raw-TCP interactive service, not a web app: about 4,400 lines of Python 3.12 using nothing but the standard library, rendering a full-screen text UI over a socket, with another 2,800 lines of tests behind it. There are four stages, and each one is a different kind of problem — a puzzle, a race, an accounting constraint, and a replay bug.
recording80×24 · 2.9s
What the player is up against #
Twelve salvage crates sit in a yard, each worth 1,500 credits once its mag-lock is bypassed. Twelve times 1,500 is 18,000. The clearance costs 45,000. No crate pays twice, and the gel merchant loses you money if you trade with real credits. So the intended solve is not "grind harder" — the economy is closed by design, and I have tests that say so. The player has to find the duplicate payout, launder it, and then break the datapad it buys.
Stage 1: a circuit board you have to actually read #
Each crate opens a 66×18 mag-lock board: nine pairs of nodes, each pair joined by one trace, with a ten-second timer. Submit the two letters that a trace connects.
recording80×24 · 3.9s
The interesting work here was making the board resistant to automation without making it unfair, because a solver that guesses is a solver that skips the stage:
- The geometry is the only signal. Node icons are never sent with their pair pre-matched, there is no draw-then-overwrite, and colour never distinguishes one real trace from another — every real-trace cell uses the same escape sequence. Reading the board means following the traces.
- Pairing is independent of position. A nearest-neighbour guess recovers about 5% of individual pairs, which is chance, and 0% of whole boards.
- The decoys have no loose ends. Dim background traces never touch a node or a real trace, keep a one-cell gap from each other, and are either closed loops or end in terminator pads. A solver cannot separate real from decorative by hunting for dangling strokes.
- Animations carry no board data. The jack-in scan plays over an empty board before the board frame is sent, and the timer is armed only afterwards. While a board is up, partial redraws never write inside the board rectangle.
The last point is the one I was most worried about, because it is the kind of
thing that is easy to get right once and then break in a refactor. So it is a
test: tests/test_render.py checks the frames cell by cell, and also that
nothing is ever written to column 80. A validator re-derives the whole pairing
from the rendered character grid alone — never from generator internals — and
runs on every board the server produces; a board that fails regenerates. The
reference solver's parser is written independently of that validator, and the two
are cross-checked on 1,000 boards.
Stage 2: one await in the wrong place #
The payout is the only place in the service where state is checked, something is awaited, and then the state is updated. Trimmed to the shape that matters:
python
async def _payout(world, session, crate, on_flash):
c = session.account.crates[crate - 1]
# 1. Check.
if c.state is CrateState.OPENED:
return PayoutResult.ALREADY_OPENED
# 2. Flash, then the deliberate gap.
on_flash()
await asyncio.sleep(config.PAYOUT_DELAY) # 1.5 s
# 3. Pay.
if not c.paid_once:
session.account.credits_permanent += config.CRATE_VALUE
c.paid_once = True
result = PayoutResult.PERMANENT
else:
session.account.credits_temporary += config.CRATE_VALUE
result = PayoutResult.TEMPORARY
# 4. Mark opened.
c.state = CrateState.OPENED
return resultAn account may hold three concurrent sessions. If all three solve the same crate and submit their final pair within the 1.5-second window, all three pass the check at step 1 and all three get paid. The first payout is permanent; the rest are temporary.
Two things about this I think are worth more than the bug itself.
It is deterministic. asyncio is single-threaded and cooperative, so whether a session gets paid depends only on whether its submission lands before the first payout flips the crate at +1.5 s. It does not depend on scheduler luck, core count, or how loaded the box is. The same inputs give the same result on a laptop and on competition infrastructure — which, for a timing challenge that hundreds of people will hit at once, is the difference between a challenge and a coin flip.
Nothing else in the codebase has this shape. Every other state change —
merchant trades, the broker purchase, the travel wipe, login, opening a board,
every datapad transition — is a plain synchronous function, so no other coroutine
can interleave. That is also a test: it parses the modules with ast and fails
if game.py contains any await, or if the payout module has more than one
coroutine or more than one await. The handshake module gets the same treatment,
with negative cases — await after the call, check-await-update, two awaits, a
second coroutine — to prove the test actually fails on them.
Stage 3: laundering, and why the numbers are exactly what they are #
Duplicate credits land as temporary and can only be spent at one place: the omni-gel merchant in the yard, at 100 credits a unit. Travelling wipes whatever temporary credit is left, atomically, before the shuttle animation plays. The buyer in Afterlife pays 75 a unit, in permanent credits.
So with three sessions: 12 permanent payouts (18,000) and 24 temporary (36,000). Spend all 36,000 on gel → 360 units. Travel, sell at 75 → 27,000 permanent. 18,000 + 27,000 = 45,000, which is the price of the clearance to the credit.
The round trip loses 25% on purpose. That is what keeps the economy closed: it is only profitable on credits that were free, so laundering real earnings just burns them. The whole table is encoded as tests:
| Path | Spendable at the broker |
|---|---|
| Honest play, no race | 18,000 |
| Race, but travel before laundering | 18,000 |
| Gel round trip on permanent credits | loses money |
| Race, 2 sessions, laundered | 31,500 |
| Race, 3 sessions, laundered | 45,000 |
| Race, 4 sessions, laundered | 58,500 |
Two sessions top out below the price, so three is the floor. Three is also the default, and at three there is nothing left over — buying the datapad leaves the account at zero, so every crate's race has to land and the stage-4 attempt has to be right the first time. Raising the cap to four restores a 13,500-credit buffer and a few retries. I shipped the tighter number.
And the clearance is not the flag. It is an encrypted datapad.
Stage 4: rewinding the lag compensation #
The datapad is an ME1-style ring bypass: four nested rings, each with a one-cell
gap travelling its perimeter at its own fractional speed. An arrow sits on a
crossing cell. in moves it through the current ring, but only if that ring's
gap is on the cell under the arrow at that moment.
recording80×24 · 10.2s
A plain in is hopeless on purpose: the server waits a random 0–400 ms
"omni-tool handshake" before evaluating it, against a window the gap occupies for
about 1.28 ticks at 60 ticks per second. But the HUD shows SYNC 009e — the
current tick, in hex — and in takes an optional argument:
python
def ring_in_synced(self, session, token):
"""`in <sync>`: no delay, evaluated at tick `sync`."""
...
sync = int(token, 16)
now = self.ring_tick(att)
if sync > now:
return Outcome(False, "omni-tool: sync from the future rejected")
if now - sync > config.RING_SYNC_MAX_AGE:
return Outcome(False, "omni-tool: stale sync rejected")
return self._evaluate(session, att, sync)A synced move has no handshake delay and is evaluated against the ring state at
the tick it names. Future syncs are rejected. Syncs older than the
lag-compensation window are rejected. Inside that window there is deliberately no
requirement that syncs increase — so you can watch the rings, fit each one's
motion, and replay the most recent tick at which its gap sat on the crossing
cell. That is the bug, and the HUD in the recording above shows it happening:
current tick 009e, ring breached at 0040.
The parts I had to get right for that to be a real vulnerability rather than a coin flip:
- Replay has to be exact. The ring simulation is pure: positions are integers
in thousandths of a cell,
cell(t) = floor(pos(t)), and speed, direction and start come fromsecretsper attempt. Any past tick in the window evaluates exactly as it was drawn. Speed is capped at 1 cell/tick so a gap can never skip the crossing cell, and a test checks that every generated ring crosses at least once per lap. - Every frame belongs to one tick. The
SYNCvalue and every gap drawn in a frame come from the same tick, so a frame is a usable sample. The jack-in intro draws the rings without gaps before tick 0, so no parameter is on the wire before the attempt's clock starts. - The window has a floor.
RING_SYNC_MAX_AGEdefaults to 300 ticks against a slowest-ring lap of about 260, because below that a slow ring can have no in-window alignment at all and the stage becomes unsolvable. - Probing is free; being wrong is not. Future and stale syncs are soft rejects: the attempt survives, so a player can map the window safely. Only a misaligned sync inside the window removes the override. So is a timeout, and so is disconnecting mid-attempt — without that last rule a brute-forcer could drop the link during the handshake delay to dodge its failures.
The discovery path #
help lists in with no arguments and never mentions sync. What teaches the
argument is the error messages: in <not hex> answers malformed sync token, a
value ahead of the clock answers sync from the future rejected, and one too far
back answers stale sync rejected. Between them they say what the argument is,
and — more usefully — what is and isn't checked.
Measuring the thing it is supposed to stop #
The handshake delay is the only defence against a timing-only attacker, so I
measured what it actually buys instead of asserting it. tests/bruteforce.py
plays the worst case: it reads each attempt's true ring parameters out of server
memory and fires an unsynced in timed so the middle of the handshake delay
lands on the middle of ring 1's aligned window. With the delay set to zero it
hits 200/200, which confirms its aim is exact and the delay is the only thing in
its way. Then, 2,000 single-ring trials per path:
| Path | Hits | p (ring) | 95% upper | p⁴ | upper⁴ |
|---|---|---|---|---|---|
| Localhost, 16 cheaters | 111/2000 | 0.0555 | 0.0664 | 9.5e-6 | 2.0e-5 |
| Localhost, 64 cheaters | 85/2000 | 0.0425 | 0.0523 | 3.3e-6 | 7.5e-6 |
| 100 ms ± 50 ms proxy, 64 | 113/2000 | 0.0565 | 0.0675 | 1.0e-5 | 2.1e-5 |
The prediction was p ≈ 0.053 — a gap sits on the crossing cell for 1/v ticks, 1.28 on average, against the 24-tick spread the handshake introduces — so p⁴ ≈ 8e-6 for all four rings. The measurements agree, and every 95% upper bound is at least 4× under the 1e-4 I was aiming for. Added latency doesn't help the attacker, because the handshake delay already dominates the jitter.
Keeping it solvable, and keeping it bounded #
Account creation asks for a 23-bit proof of work, which costs a couple of seconds and makes mass account creation expensive. The screen shows the exact check and a two-line Python command that solves it, split inside its parentheses so pasting both rows runs as-is in bash — I did not want the proof of work to be the puzzle.
The rest of the abuse surface is bounded by construction rather than by rate limits bolted on afterwards:
- Boards come from a pre-generated pool filled by worker processes, so generation (~20 ms) never stalls the event loop, and a per-account limit of three opens a second keeps the drain below the pool's refill rate.
- A payout always runs to completion as its own task and holds its session's slot until it finishes, even if the client drops — so you cannot free a slot mid-payout, log a fresh session in, and collect an extra claim.
- Abandoning a board by disconnecting counts as a failure, with the same five-second cooldown as a wrong answer.
- The displayed reward decays after six seconds, but the amount paid is always the flat 1,500. The decay is cosmetic, which is also a test.
Does it hold up #
I re-ran the reference solver against a local instance while recording the clips on this page. One run, default configuration, three sessions:
| Stage | Time |
|---|---|
| Setup (proof of work, account, 3 sessions) | 2.5 s |
| Stages 1+2 (12 boards × 3 sessions, and the race) | 44.7 s |
| Stage 3 (launder, travel, buy the datapad) | 3.0 s |
| Stage 4 (watch 55 ring frames, four synced moves) | 9.6 s |
| Total | 59.8 s |
Ledger: 18,000 permanent and 36,000 temporary before laundering, 45,000 at the broker, 0 after the purchase. The datapad decrypted on the first attempt.
The ring watch is the variable part: the solver waits for the slowest ring to pass its crossing cell at least once after tick 0, which can be up to 4.3 s. Other runs of the same build came in between 57 and 60 s.
That is consistent with the fuller runs I did while building it: 20/20 solves against a local server and 8/8 through a proxy injecting 100 ms ± 50 ms, with nothing slower than 86 s. Latency barely touches stage 4, because frames carry their own tick and a synced move is evaluated at that tick rather than on arrival. It costs stage 1 a round trip per board, and that is all.
The floor on stages 1+2 is not solving speed: it is 36 board opens at three a
second (~12 s) plus twelve 1.5-second payout windows (18 s). The rest is the
animations, which cost about 22 s across a full run — ANIMATIONS=0 takes a
localhost solve down to roughly 40 s.
Running it #
The service ships as a Docker image that contains only the server package — the solver, the tests and the author notes never make it into the running container.
bash
FLAG='csaw{demo}' docker compose up --build -d # serves on :1337
nc 127.0.0.1 1337The flag is injected through the FLAG environment variable at deploy time and is
never committed. Every limit and number in the design is an environment variable
with a documented default, including the ones that would quietly break the
economy if you changed them — which is why the invariant table above is a test
and not a comment.