REDIRECTION VULNERABILITY/HOST HEADER INJECTION VULNERABILITY
The reporter claims that a GitHub repository page reflects the supplied Host header in a redirect Location, so a crafted request could send users to an attacker-controlled domain. The text only shows a single curl response and does not demonstrate any real impact such as password reset poisoning.
Originally disclosed on HackerOne
- Disclosed after 7.9 years
Hiii..
This is vyshnav nk i need to address you a vulnerability i have found in https://github.com/blockstack/blockstack-core/
https://github.com/blockstack/blockstack-core/ is vulnerable to host header injection/redirection vulnerability..
IMPACT:-
Attack vectors are somewhat limited but depends on how the host header is used by the back-end application code. If code references the hostname used in the URL such as password reset pages, an attacker could spoof the host header of the request in order to trick the application to forwarding the password reset email to the attackers domain instead, etc. Other attack vectors may also be possible through manipulation of hyperlinks or other misc. code that relies on the host/domain of the request
poc:--
HTTP/1.1 301 Moved Permanently Content-Length: 0 Location: https://github.com.evil.net/blockstack/blockstack-core/index.html
HERE WE CAN SEE THAT ORIGINAL WEBSITE IS REDIRECTED TO THE FAKE EVIL.NET WEBSITE...so it is vulnerable to redirection/host header injection vulnerability..
steps to reproduce:---
. i have used CURL command in linux to determine the vulnerability
curl -H Host:evil.net https://github.com/blockstack/blockstack-core/ -i
which will give you the exact result of the redirection vulnerabilty
if you search Google for this vulnerability, there are many, many blogs, articles and white papers describing this vulnerability and associated attack vectors. Every major commercial web application scanner like Accunetix will report this same vulnerability. For more details, please read: https://www.acunetix.com/blog/articles/automated-detection-of-host-header-attacks/.
Normally, most apps will reject any request that doesn't originate from the same origin . To fix, the application should reject anything that doesn't match the target domain.This may also be an error in the rewrite functions of the back-end web server as well.
this may lead to the cache poisoning and the hijacking password reset token
thanks
vyshnav nk
Impact
Attack vectors are somewhat limited but depends on how the host header is used by the back-end application code. If code references the hostname used in the URL such as password reset pages, an attacker could spoof the host header of the request in order to trick the application to forwarding the password reset email to the attackers domain instead, etc. Other attack vectors may also be possible through manipulation of hyperlinks or other misc. code that relies on the host/domain of the request
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 server builds the redirect Location from the client-supplied Host header instead of a fixed, configured domain.
Impact
The reporter suggests this could enable cache poisoning or hijacking of password reset tokens, but no such impact is demonstrated and the vectors are described as limited.
What the attacker needed
Ability to send a custom Host header; server reflects Host in a redirect
The fix
The application should reject requests whose Host header does not match the expected domain, or build redirects from a fixed configured hostname.
How it was found
- Send a request to the repository page with a modified Host header using curl
- Observe the 301 response and its Location header pointing at the attacker 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 your browser asks a website for a page, it sends a 'Host' header saying which site name it wants. Some servers build redirect links using that header without checking it, so an attacker who sends a different name can make the server point users at a lookalike site. This report claims that happened here, but it only shows one command output and no real attack.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.