Password Reset link hijacking via Host Header Poisoning
Concrete5 used the Host header when generating password reset links, so an attacker could poison the link to point to their own server. When the victim clicked the emailed link, the reset token was sent to the attacker, who could then change the victim's password.
- Fixed in under an hour
- Disclosed after 30 days
Summary
Concrete5 uses the Host header when sending out password reset links. This allows an attacker to insert a malicious host header, leading to password reset link / token leakage.
Impact
The victim will receive the malicious link in their email, and, when clicked, will leak the user's password reset link / token to the attacker, leading to full account takeover.
Reproduction
1.) Open up Firefox and Burp Suite.)
2.) Visit the forgot password page (/index.php/login/concrete/forgot_password)
3.) Enter the victim's email address and click Reset and Email Password
4.) Intercept the HTTP request in Burp Suite & change the Host Header to your malicious site / server.
Example:

5.) Forward the request and you'll be redirected to your server.
The victim will then receive a password reset e-mail with your poisoned link.

If the victim clicks the link, the reset token will be leaked and the attacker will be able to find the reset token in the server logs. The attacker can then browse to the reset page with the token and change the password of the victim account!
This can also be reproduced using the curl command
curl -i -s -k -X $'POST' \
-H 'Host:sxcurity.pro' -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0' -H $'Content-Type: application/x-www-form-urlencoded' -H $'Referer: http://<TARGET>/index.php/login/callback/concrete/forgot_password' -H $'Upgrade-Insecure-Requests: 1' \
-b $'<COOKIES>' \
--data-binary $'ccm_token=1494113992%3A02eb0471b7b6e3a498ba7e6b57573b04&uEmail=hacker1337%40mailinator.com&resetPassword=' \
$'http://<TARGET>/index.php/login/callback/concrete/forgot_password'
Patch
Use $_SERVER['SERVER_NAME'] rather than $_SERVER['HTTP_HOST']
References
http://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
Thanks!
ps: crayons
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application used the user-supplied Host header to build the password reset URL instead of a trusted server-side value.
Impact
An attacker could take over a victim's account if the victim clicks the poisoned reset link.
What the attacker needed
Victim's email address known; victim clicks the poisoned link
How it was found
- Open the forgot password page.
- Enter the victim's email address and submit the reset request.
- Intercept the request and change the Host header to the attacker's server.
- Forward the request; the victim receives an email with the poisoned link.
- The victim clicks the link, leaking the reset token to the attacker's server logs.
- The attacker uses the token to reset the victim's 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 report has not been written yet. The Original tab links to the source.
When you forget your password, a website emails you a special link to reset it. This site built that link using a value the visitor's browser sends (the Host header), which an attacker can change. The attacker made the email contain a link to their own server, so clicking it sent the secret reset code to them.
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.