A Classical Account Takeover Case via Multiple Bypasses
The password reset feature built the reset link from the user-supplied Host header, so an attacker could poison the link sent to a victim. By finding the origin server behind a CDN and abusing a weak host validation regex, the attacker could make the poisoned link point at a server they controlled and take over the account.
Published on kamilonurozkaleli.com
Recently I found a password reset/recovery flaw in a program at Synack. The vulnerability is the classical password reset link manipulation via Host Header Injection but rather than the vulnerability itself, the way how I managed to exploit it might be interesting.
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 link from the untrusted Host header, and the host validation regex lacked an end anchor so crafted hostnames still matched.
Impact
An attacker could poison the password reset link and take over a victim's account, though the CDN's host header protection had to be bypassed first.
What the attacker needed
Victim triggers a password reset; attacker can reach the origin server; attacker controls a hostname matching the regex
The fix
The host validation should be corrected so it only accepts exact allowed hostnames, and direct access to origin assets behind the CDN should be restricted.
How it was found
- Collect subdomains of the target company and send requests with the target Host header to the login page.
- Identify subdomains that return the same login page, revealing the origin server behind the CDN.
- Access the origin directly to bypass the CDN's host header protection.
- Use a crafted host value that still matches the weak regex validation.
- Trigger the password reset so the link is generated from the attacker-controlled host.
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 ask a site to reset your password, it emails you a link. The site builds that link partly from a value your browser sends called the Host header, which says which site name you are visiting. If the site trusts that value, an attacker can make the emailed link point to their own server, and when the victim clicks it the attacker learns the reset token and can take over the account.
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.