CSCTF 2026 · Web · 425 pts
Operation Dawn: The Standing Order.
A home-rolled SHA1 cookie signature forges an admin role, which opens an SSRF whose IP blocklist a short-form address slips right past.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Web |
| Points | 425 |
| Status | Solved during the event |
| Target | Assigned live container |
TL;DR. The session cookie's signature is plain `SHA1(secret || data)`, not real HMAC — vulnerable to length extension. Forging a cookie with `role=admin` appended unlocks an internal relay-probe (SSRF) feature whose IP blocklist catches every obvious loopback representation except the short-form IPv4 address `127.1`, which the HTTP client still resolves as localhost.
Challenge
Reach an internal provisioning service behind a relay's SSRF-guarded probe feature, starting from an unauthenticated guest session.
Solution — forging admin
The initial cookie is session=hex(payload).sig, decoding to user=guest&role=operator. The signature is exactly SHA1(secret || data) — a construction, not real HMAC, and therefore vulnerable to the same length-extension property as SHA-256 in Countersign. With no library for this hash available, a from-scratch Python SHA1 length-extension implementation worked, brute-forcing the unknown secret key length from 0 to 64 bytes and appending &role=admin to the payload.
The forgery lands at key length 16, producing a cookie that returns 200 on /relay (previously 403 for the operator role).
Solution — SSRF and the bypass
/relay as admin reveals GET /relay/probe?target=<url>, which discloses an internal provisioning service at http://127.0.0.1:9091/order. The literal string 127.0.0.1 is blocklisted ("relay target refused"), as are localhost, ::1, and both the decimal (2130706433) and hex (0x7f000001) integer forms of the loopback address — those trigger a different failure, suggesting they're parsed and rejected rather than simply unrecognized.
The bypass is the short-form IPv4 address 127.1 — a valid, standards-permitted shorthand for 127.0.0.1 that the blocklist's string/pattern matching doesn't recognize, but that the underlying HTTP client's address resolver still happily treats as localhost. GET /relay/probe?target=http%3A%2F%2F127.1%3A9091%2Forder reaches the internal provisioning node and returns the flag as the raw response body.
Flag
CSCTF{c6D0WM6LrN7D5rjyEhEqv2at}What I took from it
- An SSRF blocklist built from a list of known loopback representations is only as complete as that list — IPv4's many valid shorthand forms (like `127.1`) are exactly the kind of equivalent-but-unlisted representation that slips through string-based filtering while still resolving correctly.