Skip to content
Open redirect Write-up Beginner

Open Redirect in Password Reset Flow Leading to Token Exposure

The password reset endpoint accepted an attacker-controlled redirectUri and appended the reset token to it, so a crafted domain received the token. An attacker could capture the token and reset the victim's password, leading to account takeover.

medium.com

Published on medium.com

Free Article Link: Click for free!

Ehtesham Ul Haq, on medium.com

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

The redirectUri parameter was not strictly validated, allowing a domain like evil.com.target.com that merely ends with the trusted domain to be accepted.

Impact

An attacker could capture the reset token and change the victim's password, leading to account takeover, and the link still looks like it belongs to target.com, aiding phishing.

What the attacker needed

A valid email address on target.com; ability to intercept the reset request; victim clicks the reset link

The fix

The redirect should be strictly whitelisted to known good URLs and the entire domain validated, not just the suffix, and reset tokens should not be placed in query strings.

How it was found

  1. Initiate a password reset for a valid email on target.com.
  2. Intercept the request to the endpoint /auth/forgot-password.
  3. Modify the redirectUri parameter to a malicious crafted domain.
  4. Submit the request.
  5. Observe that the password reset email contains a malicious link pointing to the attacker's domain with the token attached.

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, the site emails you a special link with a secret code that lets you set a new password. This report found that the site would put that secret code onto whatever web address the requester asked for, even an attacker's address. So an attacker could ask for a reset for your account, receive the email with the code sent to their own site, and then use the code to change your password.

What is Open redirect?

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.