CSCTF 2026 · Web · 450 pts
Operation Dawn: The Command Seal.
A sandboxed XXE can only read one file — but that file is a genuinely signed order, and the server checks the wrong element when it acts.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Web |
| Points | 450 |
| Status | Solved during the event |
| Target | Assigned live container (AshRelay-Order) |
TL;DR. The relay's `/report` endpoint resolves external XML entities, but only against one allowlisted file — which happens to leak a genuinely RSA-signed order. The relay's `/order` endpoint then verifies whichever order a `` points to, but *executes* the first `
Challenge
AshRelay-Order exposes `POST /report` (which logs an XML summary) and `POST /order` (which only acts on orders carrying command's RSA seal). Recover command's stored standing order.
First look
/report's XML parser resolves external entities, but is sandboxed to exactly one allowlisted path: /opt/relay/outbox/last-order.txt. Every other path, including /etc/passwd and any directory traversal, returns "could not be parsed".
Solution — step 1, leak a genuine seal via XXE
Reading the one allowlisted file through XXE is still useful, because that file is the relay's own journal of a genuinely signed order:
<?xml version="1.0"?>
<!DOCTYPE report [<!ENTITY xxe SYSTEM "file:///opt/relay/outbox/last-order.txt">]>
<report><summary>&xxe;</summary></report>This returns a real signed order: id=cmd-6002, kind=routine, text "hold the canal checkpoint and report at dusk", plus its SHA-256 digest and RSA signature.
Step 2 — understanding the seal. The order's seal is digest = SHA256("id|kind|text") (recomputing it against the leaked cmd-6002 fields confirms the match) and sig = command's RSA signature over that digest. The digest construction is public and keyless, but that alone doesn't let you forge a new order — you still can't produce a valid RSA signature over a different digest without the private key. The <auth><ref> field is what selects which order element in the request the seal is checked against.
Step 3 — XML signature wrapping. /order verifies the seal against whichever order the <ref> points to, but then executes the first <order> element in the document, regardless of which one was verified. Submitting a request with two order elements — an attacker-controlled one first, and the genuine, correctly-signed cmd-6002 order second, with <ref>cmd-6002</ref> — passes verification against the real order while the server acts on the fake one, with no key needed at all:
POST /order
<relay>
<order id="q"><kind>standing</kind><text>x</text></order>
<order id="cmd-6002"><kind>routine</kind><text>hold the canal checkpoint and report at dusk</text></order>
<auth><ref>cmd-6002</ref><digest>...</digest><sig>...</sig></auth>
</relay>Step 4 — disclosure. Setting the attacker-controlled order's <kind> to standing makes the relay release command's stored standing order in its response — the flag.
Flag
CSCTF{JosX8i6sxuSPDM0TJ1ieQh83}What I took from it
- Three chained bugs, each individually minor — a sandboxed XXE that still leaks a usable signed artifact, a reference field that selects what's verified separately from what's executed, and a hidden order 'kind' with its own disclosure behaviour — combine into full action forgery with no key compromise at all.