Subdomain Takeover via Host Header Injection on www.█████
The www subdomain had a CNAME record pointing to an unclaimed Netlify app, so anyone could register that Netlify app and serve content under the DoD subdomain. An attacker could then host phishing or malware pages on the trusted subdomain.
Originally disclosed on HackerOne
- Triaged in 26 hours
- Fixed in 3 days
- Disclosed after 9 months
Vulnerability Overview
Reported By: Ezequiel [@ezequielpuig] Reported Date: 01/October/2023 Reported To: U.S. Department Of Defense Vulnerability Type: Subdomain Takeover Affected URL: www.███████
Hello U.S. Department Of Defense Security Team, I hope this report finds you well.
I want to bring to your attention a serious security issue that poses a significant risk to www.████████. This is related to a subdomain takeover vulnerability, which could allow malicious individuals to gain control over the subdomain and potentially misuse it for malicious purposes.
_Overview: The affected subdomain is www.███, which currently points to an unclaimed CNAME record on the ████████.netlify.app. This situation allows anyone to potentially take ownership of the subdomain and manipulate its content. Since www.█████████ has a CNAME record pointing to ██████████.netlify.app, by changing the Host header to www.██████████, it is possible to visualize the malicious content hosted on █████████.netlify.app.
Here are a few scenarios where the Host header can be modified:
Proxy Servers: If you control a proxy server, you can intercept incoming requests and modify the Host header before forwarding the request to the intended destination. This is often done for load balancing, content caching, or security purposes.
DNS Spoofing: In a malicious context, an attacker might attempt DNS spoofing to redirect requests to a different server with a modified Host header.
Server-Side Scripting: If you have control over the server-side code that processes incoming requests, you can modify the Host header as part of your application logic.
Browser Extensions: Malicious browser extensions installed can modify the Host header for all outgoing requests.
_Proof of Concept (PoC): This vulnerability materializes when an HTTP request is sent to www.██████████ with a manipulated Host header.
PoC via curl:
curl -skS https://www.███████ --header "Host: ███.netlify.app"
PoC via Burp Suite: █████████
_Impact: Subdomain takeover can be exploited for various malicious purposes, including:
Malware distribution Phishing / Spear phishing attacks Cross-Site Scripting (XSS) attacks Authentication bypass And more.
_Mitigation: To address this issue and prevent potential abuse, I recommend taking the following steps:
Remove the CNAME record from the DNS zone for www.█████████. Reclaim and register the affected subdomain (███.netlify.app) in the Netlify portal to prevent takeover by unauthorized entities. I urge you to take swift action to remediate this vulnerability to safeguard the security and reputation of U.S. Department Of Defense.
//
Please feel free to reach out to me if you need any further information or assistance in resolving this matter.
Best regards, Ezequiel Puig
HackerOne: https://hackerone.com/ezequielpuig Mail: [email protected]
Impact
Impact detailed above.
System Host(s)
www.██████████
Affected Product(s) and Version(s)
CVE Numbers
Steps to Reproduce
Steps to reproduce detailed above.
Suggested Mitigation/Remediation Actions
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 a dangling CNAME record pointing to an unclaimed third-party hosting resource.
Impact
An attacker could host malicious content such as phishing or malware on the trusted DoD subdomain, potentially leading to credential theft or further attacks.
What the attacker needed
Attacker can register the unclaimed Netlify app; victim visits the www subdomain
The fix
The CNAME record should be removed or the Netlify app should be reclaimed and registered to prevent unauthorised takeover.
How it was found
- Send an HTTP request to the www host with the Host header set to the Netlify app address.
- Observe that the response serves content from the unclaimed Netlify app.
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.
A CNAME is a DNS record that says 'this name is an alias for that other name'. Here the www subdomain was an alias for a Netlify hosting address that nobody had claimed, so anyone could sign up to Netlify and claim it, making their content appear at the official www address. Visitors would see the real domain name and trust the page.
What is Subdomain takeover?
A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.