DNS hijacking of www.mozilla.net
The www.mozilla.net subdomain had a CNAME record pointing to a domain that was unregistered, allowing anyone to buy it and control DNS for www.mozilla.net. The attacker could then issue certificates, set up email, and access cookies scoped to *.mozilla.net.
Fredrik Nordberg Almroth Follow
Originally disclosed on Mozilla
- Fixed in 53 days
- Paid in 53 days
- Disclosed after 53 days
Hey there,
I noticed that www.mozilla.net had a CNAME pointer and that it also returned status NXDOMAIN. This to my experience is usually an interesting thing to investigate. I used dig and saw that the CNAME pointed to redirects-mozilla-it.netlifyglobal.com. To my surprise the apex (netlifyglobal.com) also yielded NXDOMAIN. To confirm my suspicion I used the WHOIS command on netlifyglobal.com which yielded:
λ whois netlifyglobal.com
No match for "NETLIFYGLOBAL.COM".
>>> Last update of whois database: 2019-08-15T18:46:02Z <<<
By this point I simply went to Amazon and bought netlifyglobal.com for $12. After the registration was successful, I issued a single wildcard TXT record containing my Twitter handle @almroot.
Proof of Concept:
λ dig www.mozilla.net TXT +short
redirects-mozilla-it.netlifyglobal.com.
"@almroot"
As of right now I have full DNS access to www.mozilla.net. I can issue my own SSL certificate for www.mozilla.net, setup an MX record and get my own [address removed] email-address. I can add an A pointer and direct it to my VPS, from there spin up a website and access cookies in the wildcard scope of *.mozilla.net, or generally make new ones. Given this foothold, no security flags such as Secure or HttpOnly would protect any cookies scoped to Domain=.mozilla.net from being accessed by my site. Given the nature of the domain, any domain-based whitelists that accept *.mozilla.net can by bypassed (such as any potential CORS or CSP policies). As the domain is "www" phishing is also a plausible attack.
To mitigate this issue, simply remove the CNAME pointer for www from going to redirects-mozilla-it.netlifyglobal.com. I hope that helps!
Regards,
Fredrik N. Almroth
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 unregistered domain, which anyone could register and take over.
Impact
The attacker could issue SSL certificates, set up email, host a website, and access cookies scoped to *.mozilla.net, bypassing domain-based whitelists and enabling phishing.
What the attacker needed
The target domain has a dangling CNAME; the pointed-to domain is unregistered; attacker can register the domain
The fix
The CNAME pointer for www should be removed so it no longer points to the unregistered domain.
How it was found
- Check www.mozilla.net and notice it returns NXDOMAIN and has a CNAME.
- Use dig to see the CNAME points to redirects-mozilla-it.netlifyglobal.com.
- Check that netlifyglobal.com also returns NXDOMAIN.
- Use WHOIS to confirm netlifyglobal.com is not registered.
- Register netlifyglobal.com and add a TXT record to prove control.
- Verify with dig that www.mozilla.net now returns the attacker's TXT record.
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 like a forwarding address: it tells the internet that one domain name is just another name for a different domain. Here, www.mozilla.net pointed to a domain that nobody owned, so the researcher bought it for $12 and suddenly controlled where www.mozilla.net sent visitors. This is dangerous because the attacker can then get a security certificate for www.mozilla.net and read cookies that belong to mozilla.net.
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.