The Challenge
A password-reset endpoint at /change-password.php accepts a token query parameter to identify which account to reset. The token scheme has no signature, no expiry, and no randomness.
Approach
The token is base64(username). For the admin account:
|
|
Pass this as ?token=YWRtaW4= to trigger the admin reset flow. The server trusts the token, identifies the account as admin, and returns the flag.
Solution
|
|
base64.b64encode("admin".encode()).decode() produces YWRtaW4=. The GET request returns the response body containing the flag.
What I Learned
Password-reset tokens must be opaque, cryptographically random, single-use, and short-lived. A token that encodes the username in base64 provides zero security — base64 is recoverable and the token can be forged for any account without any secret material.