How ke1thli/ctf-web-idor works
This is a Flask employee-management CTF challenge demonstrating IDOR. A user registers or logs in, can inspect profiles, obtains an administrator’s internal ID from a profile, requests that employee’s API token, then presents the token to access the flag. The route handlers and persistence helpers are excerpted; template rendering and database initialization are visible there too. The README documents the exploit workflow. The graph omits deployment machinery and does not infer unshown template or database behavior.
Main entry points: database.py User data access · app.py Profile access · templates Page templates · init_db.py Schema and admin seed
Components 11
Web application
- Register and login
app/app.py - Dashboard
app/app.py - Profile access
app/app.py - Profile editing
app/app.py - Token API
app/app.py - Admin flag gate
app/app.py
Persistence
- User data access
app/database.py - Schema and admin seed
app/init_db.py - SQLite user store
app/database.py
User interface
- Page templates
app/templates
Other components
- User
Connections 19
- User → Register and login: registers or logs in
app/app.py - Register and login → User data access: checks or creates user
app/app.py - User → Dashboard: opens dashboard
app/app.py - Dashboard → Page templates: renders dashboard
app/app.py - User → Profile access: opens profile
app/app.py - Profile access → User data access: looks up user ID
app/app.py - Profile access → Page templates: renders profile
app/app.py - Profile access → Token API: supplies employee ID
README.md - User → Profile editing: edits own profile
app/app.py - Profile editing → User data access: updates user
app/app.py - Profile editing → Page templates: renders edit form
app/app.py - User → Token API: requests token
app/app.py - Token API → User data access: looks up employee ID
app/app.py - User → Admin flag gate: presents admin token
app/app.py - Admin flag gate → User data access: checks admin token
app/app.py - Admin flag gate → Page templates: renders flag page
app/app.py - User data access → SQLite user store: reads and writes
app/database.py - Schema and admin seed → SQLite user store: creates and seeds
app/init_db.py - Schema and admin seed → Schema and admin seed: runs at startup
app/app.py