Skip to content
Subdomain takeover Disclosed report Beginner

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
Text
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

The original report as published on Mozilla's Bugzilla, by Fredrik Nordberg Almroth. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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

  1. Check www.mozilla.net and notice it returns NXDOMAIN and has a CNAME.
  2. Use dig to see the CNAME points to redirects-mozilla-it.netlifyglobal.com.
  3. Check that netlifyglobal.com also returns NXDOMAIN.
  4. Use WHOIS to confirm netlifyglobal.com is not registered.
  5. Register netlifyglobal.com and add a TXT record to prove control.
  6. 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.

More by Fredrik Nordberg Almroth

View all

1 more disclosed report, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Subdomain takeover

The lesson behind this report.

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.