Host Header Injection

Medium

Host Header Injection

Definition

Host Header Injection is a vulnerability that occurs when an application blindly trusts the value of the HTTP request's Host header. An attacker can tamper with this header to poison password-reset links, manipulate routing or poison web caches.

Impact

Poisoning of password-reset linksWeb cache poisoningBypassing virtual-host based access controlsInternal Server-Side Request ForgeryRedirection to malicious domains

Examples

Password Reset Poisoning

The application uses the Host header to generate absolute URLs in password-reset emails. By changing it to the attacker's domain, the reset link points to the malicious server, capturing the token when the victim clicks.

# Password-reset request with a tampered Host
POST /api/auth/forgot-password HTTP/1.1
Host: evil.com
Content-Type: application/json

{"email": "victim@example.com"}

# The server generates a link using the Host header:
# https://evil.com/reset-password?token=abc123
# This link is sent to the victim's email

# If the victim clicks, the token is sent to the attacker's server

Practice Host Header Injection with real labs

Apply what you've learned in safe environments based on real bug bounty reports.

See practice labs
2,482

hunters training

62

labs from real hacks

1,630

completions

$14,790

paid out for these bugs

11 flags captured this week·Real hacks from HackerOne · YesWeHack · Bugcrowd·No commitment·Free Academy
Free · no account

The checklist I run on every new target

47 checks ordered by cost: first what can get you in trouble, then the cheap stuff, and finally the expensive stuff — which is where the big bounties are. I'll send it to your inbox right now.

Unsubscribe in one click, from any email.

BBLabs · bug bounty training

Stop reading about bugs and start hunting them

Create your free account and practice on labs based on real hacks that paid out thousands of euros. The Academy is free forever.

No card · free Academy · cancel anytime