[monitor.mozilla.org] - Stale Route53 name server leads to DNS hijacking
The name servers delegated for monitor.mozilla.org pointed to a Route53 hosted zone that had expired and was unclaimed, so anyone could claim it. The reporter claimed that zone and could then create arbitrary DNS records for the subdomain and everything beneath it.
Originally disclosed on Mozilla
- Fixed in 1 hour
- Paid in 2 hours
- Disclosed after 1 hour
Created attachment 9039551 DNS hijacking
Background
Route53 is a service that allows you to host your DNS (Domain Name System) in the cloud which basically means that it allows you to easily route your traffic.
Nameservers can be configured on each domain level, which means that internal.mozilla.org could have different name servers than mozilla.org.
In this case, monitor.mozilla.org has different name servers than mozilla.org and these are expired (unclaimed in Route53).
Technical details
I was able to take control over the DNS level of monitor.mozilla.org and above.
Because of that I can now create any NS, A, AAAA, CNAME and TXT records for monitor.mozilla.org I want.
I've created a proof of concept on http://poc.monitor.mozilla.org/takeover.html which points to my server. (I can also do this for https://monitor.mozilla.org/)
The impact is that I can:
- Log all the incoming traffic to
(*.)monitor.mozilla.org. - Request valid SSL certificates
- Setup mail server
- Setup a web server to host malicious content.
- Read cookies scoped on
*.monitor.mozilla.org - Create any DNS record I want for
(*.)monitor.mozilla.org.
Mitigation
Remove the NS records or create new ones Route53 and configure these. If you have any questions, please let me know.
Kind regards, Olivier
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 subdomain's NS records still delegated to a Route53 hosted zone that had been deleted or expired, leaving the delegation dangling and claimable by anyone.
Impact
The reporter could log incoming traffic, obtain valid certificates, run mail and web servers, read cookies scoped to the subdomain and create any DNS record, though the text does not show that any of this was done beyond a proof-of-concept page.
What the attacker needed
Control of the expired Route53 zone
The fix
The stale NS records should be removed, or a new Route53 hosted zone created and the delegation pointed at it.
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.
Every domain relies on name servers, which are the computers that answer the question 'what address belongs to this name?'. If a subdomain is pointed at a name server that nobody owns any more, a stranger can register that same name server account and start giving out their own answers, so visitors are sent wherever the stranger wants.
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.