Challenge
An AI chatbot web app built with Flask. Normal users can chat; admins get more features.
Approach
- Source map leak: The frontend JS has a
.mapfile exposed at/static/app.js.map. It reveals the source, including an API endpoint/api/v0/adminand comments mentioning the JWT secret. - Legacy endpoint:
GET /api/v0with headerX-Dev-Mode: 1returns a JWT signed with the leaked secret. - Forge admin JWT: Use the leaked secret to sign a JWT with
{"role": "admin"}. - SSTI: The admin chat endpoint passes user input directly into a Jinja2
render_template_string()call. Send{{config}}to confirm, then:
| |
Flag
boroCTF{pub1ic_k3y_g0es_both_ways}