DL·SYS
Contact ↗

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.

XXEXML signature wrapping
EventCSCTF 2026, Operation Dawn (online jeopardy)
CategoryWeb
Points450
StatusSolved during the event
TargetAssigned 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 `` element in the request regardless of which one was verified — so submitting a forged order first, followed by the genuine signed one, gets the forged order executed under a signature that was never checked against it.

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

FlagCSCTF{JosX8i6sxuSPDM0TJ1ieQh83}

What I took from it