Host Header Injection
Host Header injection
The HTTP Host header is a mandatory request header introduced in HTTP/1.1.
Example
Testing Steps:
Suppl an Arbitrary Host Header
Send arequest
Check for flawed Validation
Send Ambiguous Requests
Duplicate Host
Absolute URL:
Inject Host Override Headers
Use header like X-Forwarded-Host
Common Attack Vectors
Password Reset Poisoning: Manipulate the
Host
header to redirect password reset links to an attacker-controlled domain.Host Header Authentication Bypass: Exploit improper header handling to bypass authentication mechanisms.
Web Cache Poisoning: Inject malicious content into a web cache using a forged
Host
header.Routing-Based SSRF: Use the
Host
header to manipulate server routing and access internal systems.
Mitigation and Prevention
Avoid Using the Host Header
Validate the Host Header
Disable Host Override Headers
Whitelist Domains for Routing
Last updated