$ cat writeup.md…
$ cat writeup.md…
FortID CTF 2026
Task: Flask EUDI wallet gate; only certain issuing_country values reach the flag image. Solution: abuse the leaked verifier key plus FortID playground Issuer/Wallet to self-issue a PID with the allowed issuing_country, then feed the resulting verifier session id to the app's IDOR /flag/<id> route.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
All EU citizens get free education, free healthcare, and a free flag!
The handout is a Flask / gunicorn app that gates access to a private/flag.svg image behind an EUDI (European Digital Identity) wallet verification. A live instance is reachable at https://<instance>.inst10.ctf.fortid.com. The app exposes:
GET / and GET /flag — landing page.POST /flag — starts a verification session against the FortID Verifier Service (https://evs.fortid.com) and renders a QR code.GET /verification-session/<id>/status — polls a verifier session and returns the status / redirect URL.GET /flag/<verification_session_id> — if the session reports VERIFICATION_SUCCEEDED and the presented claims pass the country allowlist, returns the flag image as an embedded base64 data: URL.GET /unsuccessful/<id> — failure page.Goal: satisfy the country check and retrieve the flag image (flag format FortID{...}).
The handout (app.py, config.yml, Dockerfile, docker-compose.yml, templates/) reveals the whole trust model.
Leaked verifier API key. config.yml stores verifier.api_key: 9LFHJCyxgzDjMsFLUf2FfpiI9ZLTlaLi (fallback for FORTID_VERIFIER_API_KEY) and verifier.base_url: https://evs.fortid.com. This is a FortID playground key, so the same public playground services can be driven by the attacker.
Naive country check. blocked_countries is a deny-list enumerating essentially every ISO 3166-1 alpha-2 code. evaluate_country_claims() accepts a claim only when its issuing_country is a valid ISO code not in the deny-list. In practice the deployed instance admits the Norwegian PID (issuing_country = NO) that we can mint ourselves; every other country is blocked.
No ownership binding on sessions (IDOR / trust confusion). app.py:
flag_result() (GET /flag/<verification_session_id>) calls load_verification_result(verification_session_id), which performs GET {base_url}/verification-session/status/{id} with the app's own API key for any user-supplied id.verification_status() does the same for /verification-session/<id>/status....
$ grep --similar