$ cat writeup.md…
$ cat writeup.md…
fortid2026
Task: candy-shop web app with a frontend gateway (403 on /staff/preview) and a Python BaseHTTP backend; a version header selects strict vs lenient framing. Solution: CL.TE request smuggling via 'Transfer-Encoding: chunked, chunked' + X-Client-Version: 1 to bypass the gateway, then Jinja2 SSTI on the staff preview to read the recipe file.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
We do not have the original task text. The task presented a candy-shop web application ("Sticky Sweets") reachable over TLS, with a hidden staff preview endpoint and hints about "delivery mode" and "more than one encoding".
The target is a TLS-only HTTP service exposing a candy-shop order form. The goal is to reach a protected internal route (/staff/preview) that the frontend refuses to proxy, exploit the template renderer behind it, and read the recipe file that holds the flag.
Public surfaces:
GET / — "Sticky Sweets" order form. Its JavaScript submits POST /order with X-Client-Version: 2, Content-Type: application/x-www-form-urlencoded, and a single field order.GET /robots.txt — leaks the internal route and the field name:
# Staff preview accepts a form field named message.
User-agent: *
Disallow: /staff/preview
GET/POST /staff/preview — the frontend answers 403 Forbidden; the backend is never asked.Comparing responses reveals two distinct servers:
HTTP/1.1 with no Server/Date header and always closes after one response.HTTP/1.0 responses as Server: BaseHTTP/0.6 Python/3.12.15 (Python's http.server).The 403 is issued by the gateway for the exact raw target /staff/preview. Appending anything to the target (/staff/preview?x=1, /staff/preview/, //, /./, %2e, case variants) makes the gateway pass the request through to the backend, which then exact-matches and returns its own 404 Not found. That is the classic signature of a front ACL on a raw path token plus a separate backend router — two independent HTTP parsers, i.e. a smuggling setup.
...
$ grep --similar