How Phising Attacks Can Takeover Accounts Using Password Reset Poisioning Attack
The password reset email built its link from the request's Host header, so an attacker could point the reset link at a domain they control. When the victim clicked the emailed link, the reset token was sent to the attacker's server, letting the attacker reset the victim's password and take over the account.
Published on systemweakness.com
Hello guys, this is Sarath D, I am electronics & communication engineer and working as a penetration Tester. So here i am sharing my knowledge to beginners in this field.
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 application generated the password reset URL from the untrusted Host header instead of a fixed, configured domain.
Impact
An attacker could capture a victim's reset token and take over the account, provided the victim clicks the poisoned link.
What the attacker needed
Victim clicks the emailed link; attacker controls a server/domain; ability to intercept requests
The fix
The reset link should be built from a fixed, configured domain rather than the Host header, and the Host header should be validated against an allowlist.
How it was found
- Request a password reset for a username and capture the request.
- Change the Host header to a domain the attacker controls.
- Forward the request and check the email; the reset link now points at the attacker's domain.
- Confirm the token is valid by swapping the attacker domain back to the real domain.
- As the attacker, request a reset for the victim with the Host header set to the attacker's server.
- When the victim clicks the emailed link, the token is logged on the attacker's server and used to reset the password.
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 a password, a site emails you a special link containing a secret code (a token) that proves it is you. This site built that link using a value the visitor's browser sends called the Host header, which says which website is being requested. Because the site trusted that value, an attacker could make the email point to their own server, so the secret code arrived at the attacker instead of the real site.
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.