Exploiting Time-Sensitive Vulnerabilities: A Practical Walkthroug
The password reset token generation relied on time-based inputs and was not bound to the username, so two parallel reset requests from different sessions could receive the same token. An attacker could then change the username in the reset link to take over another account, including the admin.
While working through the PortSwigger Web Security Academy labs, I recently completed the “Exploiting Time-Sensitive Vulnerabilities” lab. This challenge demonstrates how subtle cryptographic and timing flaws in password reset mechanisms can lead to full account takeover — even without traditional race conditions.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the reset token was generated from predictable time-based data and was not bound to the user or session, allowing token reuse across accounts.
Impact
An attacker could obtain a valid reset token for another user and take over their account, including the admin account, leading to full application compromise.
What the attacker needed
Access to the password reset feature; ability to intercept and modify requests; a valid account to initiate reset
The fix
Password reset tokens should be cryptographically secure and bound to both the user and the session, and time-based inputs should not be used alone.
How it was found
- Intercept the GET and POST password reset requests and send them to Repeater.
- Duplicate the POST forgot-password request and group both POST requests for coordinated execution.
- Remove the session cookie from the GET request to force a new session ID and CSRF token, then apply these to one POST request and change its username to the target admin account.
- Send both POST requests in parallel to trigger the time-based flaw.
- Use the received reset link, change the username parameter in the URL to the admin account, set a new password, and log in.
- Access the admin panel and delete the target user to complete the lab.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you forget your password, a website sends a special link with a secret code (a token) to prove it is you. Here, the code was made using the current time and was not tied to the specific user, so two requests made at the same moment could get the same code. By changing the username in the link, an attacker could use that code to reset someone else's password.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.