ATO via Host Header Poisoning
The password reset endpoint was vulnerable to host header injection: by adding X-Forwarded-Host and Referrer headers with an attacker-controlled domain, the reset email contained a link to that domain. An attacker could use this to steal reset tokens and take over accounts.
Published on medium.com
Bug Bounty
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.
Context
This write-up covers an account takeover found through host header poisoning on a site referred to throughout as redacted.com. The affected feature is the password reset flow, reached at https://redacted.com/forgot. Normally that page takes a username, and the application sends a reset email to the address linked to that account. The email is supposed to contain a link pointing back to redacted.com.
The researcher reports that the application was vulnerable to host header injection, and that a remote attacker could use it to take over any account on the site. The report was submitted to a private program on 26 June 2019, triaged on 1 August 2019, rewarded with a $2000 USD bounty on 8 August 2019, and the vulnerability was fixed on 24 October 2019.
Setup
The report does not describe any special accounts, roles or software versions. The only tool named is Burp Suite, used to intercept the password reset request.
Finding it
The researcher modified the POST request for the reset flow and tried to influence the host that the application used when building the reset email. The attempts were incremental:
- First, the value of the
Hostheader was changed toevil.com. Nothing happened. - Then the
X-Forwarded-Hostheader was added with the valueevil.com. Again nothing happened. - On the third attempt, the
Referrerheader was also changed to the same value asX-Forwarded-Host. This time it worked.
The signal that something was wrong was the reset email itself: the host in the email became evil.com instead of the legitimate domain.
Exploitation
Step 1: Reach the reset form
Navigate to https://redacted.com/forgot and enter the username of the target account.
Step 2: Intercept the request
Intercept the resulting POST request with Burp Suite. The request the researcher sent looked like this:
POST /forgot HTTP/1.1
Host: redacted.com
X-Forwarded-Host: evil.com
Referrer: https://evil.com
username=<username>&_csrf_token=[redacted]

The screenshot shows the request as it appeared in the tool. The important parts are:
Host: redacted.comstays as the legitimate host, so the request still reaches the real application.X-Forwarded-Host: evil.comis the injected host that the application apparently trusts when generating links.Referrer: https://evil.commatches the injected host. On its own, neither theHostchange nor theX-Forwarded-Hostaddition had any effect; only when the referrer carried the same value did the poisoning take effect.- The body carries the target
usernameand the existing_csrf_token, so the request is otherwise a valid reset submission.
Step 3: Forward and check the email
Forward the request and check the mailbox linked to the username. The email arrived with evil.com as the host:

The screenshot shows the received email with the malicious host in place of the legitimate domain. The email arrived with evil.com as the host instead of the legitimate domain.
Steps to reproduce, as given in the report
- Navigate to
https://redacted.com/forgot. - Enter your username and intercept the request with Burp Suite.
- Add these two headers to the POST request:
X-Forwarded-Host: evil.com
Referrer: https://evil.com
- Forward the request and check the email linked to your username.
Root cause
The injected host appeared in the email only after both X-Forwarded-Host and Referrer were set to evil.com. The report does not explain why the referrer check mattered, so the exact logic is not documented here. Changing the Host header alone had no effect.
Impact
An attacker who can submit a reset request for a victim's username can cause the reset email to use a host they control. The researcher states that any account of redacted.com could be taken over this way.
Fix
The report states that the vulnerability was fixed on 24 October 2019 but does not describe the change that was made.
Variants to test
- A positive result is an email whose link points at your test domain.
Timeline

- 26 June 2019: reported to the private program.
- 1 August 2019: report triaged.
- 8 August 2019: bounty of $2000 USD awarded.
- 24 October 2019: vulnerability fixed.
What happened, in plain words
A security researcher found a way to take over any user account on a website (called redacted.com in the report) by abusing the password reset feature. When you forget your password, the site sends you an email with a link to reset it. Normally that link points to the real site. But the researcher discovered that by adding a couple of extra lines to the request your browser sends when you ask for a reset, he could make the site send an email whose link pointed to a domain he controlled (evil.com). The email's link pointed to a domain the researcher controlled instead of the real site. The bug was reported in June 2019, fixed in October 2019, and earned a $2000 bounty.
Context
This write-up covers an account takeover found through host header poisoning on a site referred to throughout as redacted.com. The affected feature is the password reset flow, reached at https://redacted.com/forgot. Normally that page takes a username, and the application sends a reset email to the address linked to that account. The email is supposed to contain a link pointing back to redacted.com.
The researcher reports that the application was vulnerable to host header injection, and that a remote attacker could use it to take over any account on the site. The report was submitted to a private program on 26 June 2019, triaged on 1 August 2019, rewarded with a $2000 USD bounty on 8 August 2019, and the vulnerability was fixed on 24 October 2019.
Setup
The report does not describe any special accounts, roles or software versions. The only tool named is Burp Suite, used to intercept the password reset request.
Finding it
The researcher modified the POST request for the reset flow and tried to influence the host that the application used when building the reset email. The attempts were incremental:
- First, the value of the
Hostheader was changed toevil.com. Nothing happened. - Then the
X-Forwarded-Hostheader was added with the valueevil.com. Again nothing happened. - On the third attempt, the
Referrerheader was also changed to the same value asX-Forwarded-Host. This time it worked.
The signal that something was wrong was the reset email itself: the host in the email became evil.com instead of the legitimate domain.
Exploitation
Step 1: Reach the reset form
Navigate to https://redacted.com/forgot and enter the username of the target account.
Step 2: Intercept the request
Intercept the resulting POST request with Burp Suite. The request the researcher sent looked like this:
POST /forgot HTTP/1.1
Host: redacted.com
X-Forwarded-Host: evil.com
Referrer: https://evil.com
username=<username>&_csrf_token=[redacted]

The screenshot shows the request as it appeared in the tool. The important parts are:
Host: redacted.comstays as the legitimate host, so the request still reaches the real application.X-Forwarded-Host: evil.comis the injected host that the application apparently trusts when generating links.Referrer: https://evil.commatches the injected host. On its own, neither theHostchange nor theX-Forwarded-Hostaddition had any effect; only when the referrer carried the same value did the poisoning take effect.- The body carries the target
usernameand the existing_csrf_token, so the request is otherwise a valid reset submission.
Step 3: Forward and check the email
Forward the request and check the mailbox linked to the username. The email arrived with evil.com as the host:

The screenshot shows the received email with the malicious host in place of the legitimate domain. The email arrived with evil.com as the host instead of the legitimate domain.
Steps to reproduce, as given in the report
- Navigate to
https://redacted.com/forgot. - Enter your username and intercept the request with Burp Suite.
- Add these two headers to the POST request:
X-Forwarded-Host: evil.com
Referrer: https://evil.com
- Forward the request and check the email linked to your username.
Root cause
The injected host appeared in the email only after both X-Forwarded-Host and Referrer were set to evil.com. The report does not explain why the referrer check mattered, so the exact logic is not documented here. Changing the Host header alone had no effect.
Impact
An attacker who can submit a reset request for a victim's username can cause the reset email to use a host they control. The researcher states that any account of redacted.com could be taken over this way.
Fix
The report states that the vulnerability was fixed on 24 October 2019 but does not describe the change that was made.
Variants to test
- A positive result is an email whose link points at your test domain.
Timeline

- 26 June 2019: reported to the private program.
- 1 August 2019: report triaged.
- 8 August 2019: bounty of $2000 USD awarded.
- 24 October 2019: vulnerability fixed.
Glossary
- Account takeover (ATO): when an attacker gains control of someone else's account, for example by changing their password.
- API: a set of rules that lets one piece of software talk to another; here, the web application's endpoints that handle requests.
- Burp Suite: a tool that lets you pause and edit the requests your browser sends to a website.
- Cookie: a small piece of data a website stores in your browser to remember you between visits.
- CSRF token: a secret value included in forms to prove the request came from the real site and not from an attacker.
- Endpoint: a specific URL or address on a server that performs a particular function, like
/forgot. - Host header: the part of an HTTP request that tells the server which website you are trying to reach.
- Host header injection: a vulnerability where an attacker can change the host value the application uses, often to make it generate links to a malicious site.
- Password reset flow: the series of steps a website uses to let you set a new password when you forget yours, usually by sending an email with a special link.
- POST request: a type of HTTP request used to send data to a server, such as a form submission.
- Referrer header: a header that tells the server the address of the page you came from.
- Remote attacker: someone attacking the system over the internet, from a different computer.
- Reset token: a unique, secret code included in a password reset link that proves you are allowed to change the password.
- Triaged: when a bug report is reviewed and confirmed as valid by the program.
- X-Forwarded-Host header: a header sometimes used by proxies to tell the server the original host requested by the client; applications may trust it when building links.