Subdomain takeover via Cloudfront - xr.mozilla.org
A DNS record for xr.mozilla.org pointed to an unused CloudFront distribution, allowing an attacker to claim the subdomain by creating a matching S3 bucket. The attacker could then serve arbitrary content under the Mozilla subdomain.
Originally disclosed on Mozilla
- Fixed in 3.8 years
- Paid in 26 days
- Disclosed after 3.8 years
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36
Steps to reproduce:
This attack vector utilizes DNS-entries pointing to service providers where the pointed subdomain is currently not in use. Depending on the DNS-entry configuration and service provider, unverified users can claim these subdomains as their own. In this case xr.mozilla.org still had a DNS A entry pointing to an Amazon Cloudfront CDN server.
Result:
I was able takeover xr.mozilla.org as there was an existing DNS record pointing to Cloudfront. That domain now points to my S3 bucket (https://s3.amazonaws.com/ninjaninja).
Confirmation:
Run a curl request to xr.mozilla.org (curl xr.mozilla.org):
$ curl xr.mozilla.org/index.html
HSO Confirmed
Right now there is a synchronization lag so the response to the curl request maybe "HSO Confirmed" or "Takeover Confirmed - WV"; I can provide further evidence of the takeover if needed.
The DNS records should be removed if the subdomain is not within use.
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 DNS record pointing to a decommissioned CloudFront distribution that was not removed.
Impact
An attacker could serve arbitrary content under a Mozilla subdomain, which could be used for phishing or other attacks.
What the attacker needed
DNS record pointing to unused CloudFront; Ability to create S3 bucket with matching name
The fix
The DNS records should be removed if the subdomain is not in use.
How it was found
- Identify a DNS record for xr.mozilla.org pointing to CloudFront.
- Claim the unused CloudFront distribution by creating an S3 bucket with the same name.
- Verify the takeover by requesting a file from the subdomain and seeing the attacker's content.
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 subdomain takeover happens when a website's address (like xr.mozilla.org) still points to a service that is no longer used. If an attacker can sign up for that same service and claim the unused space, they can control what appears at that address. Here, the address pointed to an unused Amazon CloudFront setup, so the attacker could make it show their own content.
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.