Host Header poisoning on gratipay.com
The web server at gratipay.com used the client-supplied Host header to build a redirect URL, so an attacker could make the site redirect visitors to an arbitrary domain. The reporter claims this could poison the browser's DNS cache, but the evidence only shows a single 301 redirect.
Originally disclosed on HackerOne
- Disclosed after 12 months
There is a host header poisoning vulnerability on gratipay.com that allows an attacker to cause a 301 redirect and poison the browser DNS cache to cause all further requests to gratipay.com to be redirected to the attacker's site.
PoC Request:
GET https://gratipay.com/ HTTP/1.1
Host: heroku.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Cookie: csrf_token=oglKUTprcTt6gQkxpCMEz6UAj0HXxgez; suppress-welcome=; session=eeee68e176604dc2bdb36d1766755ea0
Connection: keep-alive
Response:
HTTP/1.1 301 Moved Permanently
Server: Cowboy
Date: Thu, 11 Aug 2016 14:38:17 GMT
Connection: keep-alive
Strict-Transport-Security: max-age=31536000
Location: https://www.heroku.com/
Content-Type: text/html
Content-Length: 0
Via: 1.1 vegur
Things to note:
- Tested on Firefox, Host header manipulated with the Live HTTP Headers and Tamper Data addons
- The attacker must create a malicious Heroku app to redirect to, in the PoC i have just chosen heroku.com
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application built a redirect Location header directly from the untrusted Host header without validating it against an allowlist.
Impact
An attacker could cause gratipay.com to redirect users to an attacker-controlled site, and the reporter claims this could poison the browser DNS cache, though that claim is not demonstrated.
What the attacker needed
Ability to modify the Host header; attacker-controlled domain
How it was found
- Send a request to gratipay.com with a modified Host header pointing to another domain.
- Observe the server respond with a 301 redirect to that other domain.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you visit a website, your browser sends a 'Host' header telling the server which site you want. This server trusted that header and used it to create a redirect link, so an attacker could make the site send visitors to a different website. The report also claims this could trick the browser into remembering the wrong address, but that part is not proven.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.