$ cat writeup.md…
$ cat writeup.md…
broncoctf2026
Task: Flask login API that performs all authentication on the client side. Solution: read /api/config to leak the credentials, then bypass auth entirely by POSTing {\"authenticated\":true} to /login (server trusts the client-asserted flag) and reuse the session cookie on /flag.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
I just finished developing my very first API to handle secure logins to my very own website! To keep things extra secure, I won't even tell you my username, so now there's really no way you can hack me!
A Flask login page (Server header Werkzeug/3.1.8 Python/3.14.6) where all
authentication logic lives in client-side JavaScript. Two fatal flaws let us
authenticate without knowing (or even needing) any credentials.
GET / returns an HTML login form plus inline JavaScript that:
/api/config and stores data.username / data.password.if (u === leakedUser && p === leakedPass)).POST /login with JSON body { "authenticated": true }
and follows data.redirect on success.Inline JS excerpt:
fetch('/api/config').then(res=>res.json()).then(data=>{ leakedUser = data.username; leakedPass = data.password; ... if (u === leakedUser && p === leakedPass) { fetch('/login', { method:'POST', headers:{'Content-Type':'application/json'}, body: JSON.stringify({ authenticated: true }) }) .then(res=>res.json()).then(data=>{ if(data.success) window.location.href = data.redirect; }) } });
Two flaws:
...
$ grep --similar