GET /example HTTP/1.1
Host: vulnerable-website.com:bad-stuff-here
GET /example HTTP/1.1
Host: notvulnerable-website.com
GET /example HTTP/1.1
Host: hacked-subdomain.vulnerable-website.com
GET /example HTTP/1.1
Host: vulnerable-website.com
Host: bad-stuff-here
GET https://vulnerable-website.com/ HTTP/1.1
Host: bad-stuff-here
X-Forwarded-Host
to inject your malicious input while circumventing any validation on the Host header itself.GET /example HTTP/1.1
Host: vulnerable-website.com
X-Forwarded-Host: bad-stuff-here
X-Forwarded-Host
is the de facto standard for this behavior, you may come across other headers that serve a similar purpose, including:X-Host
X-Forwarded-Server
X-HTTP-Host-Override
Forwarded
evil-user.net
.https://evil-user.net/reset?token=0a1b2c3d4e5f6g7h8i9j
www.example.com: 12.34.56.78
intranet.example.com: 10.0.0.132
192.168.0.0/16
.http://backend-server
, and route the request to that upstream URL. This works fine if the path starts with a /
character, but what if starts with an @
character instead?GET @private-intranet/example HTTP/1.1
http://[email protected]/example
, which most HTTP libraries interpret as a request to access private-intranet
with the username backend-server
.ALLOWED_HOSTS
option in the settings file. This approach will reduce your exposure to Host header injection attacks.X-Forwarded-Host
. Remember that these may be supported by default.