In-depth lesson · technique
Host header injection
What every disclosed Host header injection report in the index teaches, put together: how it works, how it changed year by year, where it turns up, and things to try. Every point shows the reports it is seen in.
- reports cited in this lesson
- 55
- median public bounty
- $1,125
Overview
What it is and why programs pay for it.
Host header injection is a class of vulnerability where an application trusts the Host header, or headers like X-Forwarded-Host, supplied by the client when building links, redirects or cookies. In the reports here it most often appears in password reset flows, where the emailed link is built from the request's host instead of a fixed server-side value. The consequence is that an attacker can make the application send a link pointing at a domain they control, and if a victim clicks it the secret token in the link goes to the attacker. This is why programs care: it can lead directly to account takeover, and it is often simple to test with a single request.
Beyond password resets, the same mistake turns up in email verification links, OAuth redirect destinations, session cookie Domain attributes, quick-login links built from websocket requests, and even support workflows that accept an email sender address as proof of ownership. It is most often found on forgot-password forms and reset endpoints, especially those sitting behind a proxy or middleware that forwards host headers, and in frameworks whose URL generators use X-Forwarded-Host from external requests. The reports show it across custom applications, Joomla, Drupal, Concrete5, Laravel, Red Hat SSO and WebSphere Commerce.
What it usually leads to depends on where the poisoned link is used. In reset flows it can mean account takeover if the victim clicks the link and the token is captured. In OAuth flows it can mean the token and verifier arrive at the attacker's server. In cookie handling it can mean the session cookie is scoped to a parent domain the attacker can influence. Some reports show weaker outcomes, such as cache poisoning or bypassing a 2FA check by using a beta subdomain, but the underlying trust mistake is the same.
Seen in these reports18
-
Info -
High
Show 5 moreShow fewer
-
$900
-
$100 -
-
High
How it works
The mechanics, as the reports show them.
The core mistake is that the application builds a URL from a value the client can set. When you request a password reset, the server needs to put a base domain into the emailed link. If it takes that domain from the Host header of your request, or from X-Forwarded-Host, you can change it. The server then sends an email to the victim containing a link on your domain, with the victim's reset token in it. When the victim clicks, the token is sent to you.
The same pattern appears in other flows. Email verification links sent after signup can be built the same way. OAuth login endpoints can build the redirect destination from the request, so the authorisation code and token end up at your server. APIs can set the session cookie Domain from the request Host header, so the cookie is scoped to a domain you control. Quick-login links can be built from a host value in a websocket request rather than the HTTP Host header.
What makes it possible is that the server treats the Host header as trustworthy. In many deployments a proxy or middleware forwards the host header, and the backend accepts X-Forwarded-Host from untrusted external requests instead of only from a trusted proxy. Frameworks can make this worse: Laravel's URL generator uses X-Forwarded-Host from external requests, Drupal's RequestContext sets a safe host then overrides it with the incoming Host header, and Concrete5 and Red Hat SSO build reset links from request context. The fix is to build links from a fixed, server-configured domain and to validate host headers against an allowlist.
Defences are often weak in ways that are easy to get around. A host validation regex may lack an end anchor, so a crafted hostname still matches. Validation may only check that the host contains a substring such as localhost rather than matching the exact domain. A subdomain check may be bypassed with a question mark in the Host header. A CDN may protect the front end, but the origin server can be reached directly and will still trust the Host header. Duplicate Host headers, trailing full stops, IDN homographs and values that use the target domain as a prefix of your own domain are all shown in the reports as ways past filters.
There are related variants that do not rely on the Host header at all. A reset link can be built from a user-supplied redirect parameter without checking it against an allowlist, or a reset API can reflect a user-supplied 'to' parameter into the link. The reset code's strength can depend on whether a client-supplied redirect URL is present, and old codes may never be invalidated, so many valid codes exist at once. Rate limiting can trust X-Forwarded-For without checking the request came from a trusted proxy, allowing brute force. Email fields can be injected with encoded newline characters to add a BCC address. Support workflows can accept a visible sender address as proof of ownership.
The impact depends on who clicks and what the link contains. A reset token in a link on your domain is enough for account takeover if the victim clicks. An OAuth token and verifier arriving at your server is enough to take over the account. A cookie scoped to a parent domain can let you fixate or steal sessions. A beta subdomain that skips the 2FA check can let you log in with an arbitrary code. An admin dashboard that renders reset emails and fetches remote assets from the poisoned domain can leak the token without the victim clicking anything. Some reports show only cache poisoning or a redirect, which is why impact needs to be demonstrated, not assumed.
Seen in these reports33
-
Info -
Year by year
5 yearsWhat each year's disclosed reports show, newest first. A year with few reports says less.
| 2014 | 1 |
|---|---|
| 2016 | 1 |
| 2017 | 4 |
| 2018 | 1 |
| 2019 | 3 |
| 2020 | 1 |
| 2021 | 2 |
| 2022 | 3 |
| 2023 | 4 |
| 2024 | 7 |
| 2025 | 18 |
| 2026 | 15 |
-
2026
New this year4
- Setting the session cookie Domain from the request Host header is a new pattern in the disclosed reports.
- Sending multiple Host headers and exploiting inconsistent handling when setting the cookie domain first appears in the disclosed reports.
- Admin dashboards that render user emails and fetch remote assets, leaking tokens from the poisoned domain, are a new angle in the disclosed reports.
Kept working3
- Hunters requested a password reset for their own account and checked whether the emailed link used the request Host header as its base domain in the disclosed reports.
- They added an X-Forwarded-Host header pointing at a server they controlled to the reset request and saw whether the emailed link changed to that host in the disclosed reports.
Turned up less1
- Reflecting the Host header into page titles and meta tags, seen in earlier reports, is not the focus of the 2026 evidence.
-
2025
New this year1
- Chaining host header injection with cache poisoning, open redirects and XSS clearly grows in the disclosed reports this year.
Kept working3
- Hunters requested a password reset for their own account and checked whether the emailed link used the request Host header as its base domain in the disclosed reports.
- Forgot-password forms and reset endpoints across web applications remained the main hunting ground in the disclosed reports.
Turned up less1
- Using X-Forwarded-Host rather than the Host header, prominent in earlier reports, is not the focus of the 2025 evidence.
-
2024
New this year2
- Using X-Forwarded-Host rather than the Host header to poison reset links clearly grows in the disclosed reports this year.
- Prefixing the target domain onto the attacker domain to satisfy host checks is a new trick in the disclosed reports.
Kept working2
- Hunters requested a password reset for their own account and checked whether the emailed link used the request Host header as its base domain in the disclosed reports.
- Red Hat SSO 7.6 password reset URLs built with UriBuilder and context.getUriInfo() were a concrete target in the disclosed reports.
Turned up less1
- Weak six-digit reset codes and brute-forcing old codes, seen in earlier reports, are absent from the 2024 evidence.
Earlier years2
Where it is found
17The features and places the reports found it in, most-reported first.
-
Forgot-password forms and reset endpoints across web applications.
Seen in 14 reports
-
Reset flows sitting behind a proxy or middleware that forwards host headers.
Seen in 3 reports
-
OAuth login endpoints that build the redirect destination from the request.
Seen in 1 report
-
APIs that set the session cookie Domain from the request.
Seen in 1 report
-
Email verification links sent after signup.
Seen in 1 report
Technologies in these reports13
Root causes
16The mistakes in the code or configuration behind the reports.
-
The reset URL is built from the client-supplied Host header instead of a fixed server-side value.
Seen in 14 reports
-
The backend accepts X-Forwarded-Host from untrusted external requests instead of only from a trusted proxy.
Seen in 7 reports
-
The host validation regex lacks an end anchor, so crafted hostnames still match.
Seen in 1 report
-
Validation only checks that the host contains a substring such as localhost rather than matching the exact domain.
Seen in 1 report
-
The cookie Domain attribute is set from the client-supplied Host header without validation.
Seen in 1 report
Things to try
The most-reported tests in the largest contexts. Tick what you have tried; ticks stay in this browser and carry over to the full checklist. Test only what a program's scope allows.
ticked in this lesson
Reset token and code handling
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
-
Seen in 1 report
WAF and validation bypasses
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
-
Seen in 1 report
Session cookies and 2FA
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
-
Seen in 1 report
Host header parsing bypasses
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
Bypasses and variations
20How reports got past filters, encoders and other defences.
-
Add a second Host header to the reset request.
-
Put your own domain at the start of the Host header followed by the real domain, then append a colon and the real domain again.
Seen in 1 report
-
Add a trailing full stop to the Host header to get past validation.
Seen in 1 report
-
Use an IDN homograph of the target domain in X-Forwarded-Host.
Seen in 1 report
-
Use a value containing localhost in X-Forwarded-Host to satisfy a substring check.
Seen in 1 report
Payouts
10 paidPublic bounties in US dollars, from the data. 10 of 90 reports show an amount.
- a quarter paid up to
- $825
- median
- $1,125
- three quarters paid up to
- $1,875
- highest
- $10k
One in ten paid reports was paid $2,800 or more.
| Severity | Reports | Paid | Median | Highest |
|---|---|---|---|---|
| Critical | 1 | 0 | None paid | None |
| High | 4 | 0 | None paid | None |
| Medium | 2 | 0 | None paid | None |
| Low | 1 | 0 | None paid | None |
| Informational | 2 | 0 | None paid | None |
| Unrated | 80 | 10 | $1,125 | $10k |
Highest-paid reports5
-
$10,000 -
$2,000
-
$2,000
-
$1,500 -
$1,250
Typical fixes
12How programs fixed it, as the reports describe.
-
Build reset links from a fixed, server-configured domain rather than any request header.
Seen in 13 reports
-
Validate the Host and X-Forwarded-Host headers against an allowlist of expected domains.
Seen in 10 reports
-
Only accept X-Forwarded-Host from a trusted proxy.
Seen in 1 report
-
Anchor host validation regexes at the end and match the exact domain.
Seen in 1 report
-
Canonicalise and validate hostnames so IDN homographs are rejected.
Seen in 1 report
Tips for beginners
14Advice for a first hunt, drawn from the reports.
-
If a simple Host header change is blocked, try the bypasses shown in the reports: a second Host header, a trailing full stop, a question mark in the Host header, a value containing localhost to satisfy a substring check, an IDN homograph, or the target domain as a prefix of your own domain. Also try reaching the origin server directly if a CDN is in front, since the origin may still trust the Host header.
Seen in 9 reports
-
Try host-like headers one at a time on the reset request: X-Forwarded-Host, X-Host, X-Server, X-Forwarded-For, Referer, Origin. Watch which one changes the link. Do not send them all at once, because you will not know which one worked. The reports show X-Forwarded-Host is the most common, but others appear too.
Seen in 8 reports
-
Start with the forgot-password form on your own account. Request a reset and look at the emailed link. If the base domain matches the Host header you sent, try changing the Host header or adding X-Forwarded-Host and request another reset. This is the simplest test and it is where most of the reports here begin.
Seen in 6 reports
-
Check other flows that send links: email verification after signup, OAuth login redirects, quick-login links from websocket requests, and session cookie Domain attributes. The same trust mistake appears in all of these, and some are less tested than password resets.
Seen in 4 reports
-
Show impact, not just reflection. A changed link in an email is not enough on its own. Demonstrate that the token arrives at your server when the link is clicked, that the OAuth token and verifier arrive at your server, that the cookie Domain changes to a domain you control, or that the 2FA check is skipped. If you cannot show impact, say so and describe what you observed.
Seen in 4 reports
Guides and techniques
The best explainers, cheat sheets and technique posts on Host header injection, from around the web.
-
CRLF-Powered Desync Attacks: Beheading HTTP StreamsExplains how to escalate mere CRLF header injection into critical request desync and tunnelling attacks against HTTP streams.
Technique PortSwigger Research
-
HTTP header hacks: basic and advanced exploit techniques exploredExplores HTTP header exploitation including cache-poisoned denial of service, Vary abuse and reverse proxy misconfigurations with real examples.
Technique yeswehack.com
-
HTTP Host header attacksPortSwigger's guide to host header attacks covering password reset poisoning, cache poisoning and routing abuse.
Explainer portswigger.net
-
ipspoof: An Open Source Tool for Automated Testing of HTTP Header-Based Access ControlsIntroduces ipspoof, an open source tool that automates testing of HTTP header based access control bypasses across many forwarding headers.
exript.medium.com
-
The Cache Poisoning Bible: Part 2 — Exotic Header ExploitatExplores exotic HTTP header abuse for web cache poisoning attacks, extending beyond common headers.
Technique medium.com
Keep learning
Where this lesson fits, and what to read next.
The whole class
Related techniques
How this is made: our model read every listed Host header injection report in the index (our own summary where we have one, otherwise the title and the platform's label), listed the patterns, and merged them. Each point was kept only if the reports it cites exist, are listed and belong here; payouts are computed from the data, not written by the model. Read the originals before relying on a point. Generated 27 Nov 2026 from 68 reports. All Host header injection reports.