The Challenge
A simple reminder app. After registration and login you get a numeric session_id cookie. The server does not validate ownership — any valid session integer grants access to the profile at /admin.
Approach
Register and log in to observe the assigned session ID (a small integer). Admin’s session ID is also a small integer. Iterating from 30 upward and checking each /admin response for the word “flag” hits the admin session at ID 337.
Solution
|
|
Registration + login establishes a baseline cookie to confirm the format. The loop forges the session_id cookie with increasing integers. The comment # is 337! reveals the admin’s session number. The loop exits as soon as the response contains “flag”.
What I Learned
Sequential numeric session IDs are an IDOR vulnerability by design. Any attacker who can observe their own ID can enumerate adjacent ones. Session tokens must be cryptographically random and long enough to make brute force infeasible.