AWS S3 bucket - Subdomain takeover
A subdomain had a DNS CNAME record pointing to an AWS S3 bucket that no longer existed. An attacker could create an S3 bucket with the same name and serve arbitrary content on that subdomain, potentially phishing users.
Published on tutorgeeks.blogspot.com
The original lives on tutorgeeks.blogspot.com
We do not hold its text, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could serve arbitrary content, such as a fake login page, on the trusted subdomain, potentially tricking users into revealing credentials.
What the attacker needed
DNS CNAME points to deleted S3 bucket; Attacker can create S3 bucket with same name
The fix
Remove DNS CNAME records that point to third-party services when the corresponding resource is no longer needed.
How it was found
- Enumerate subdomains using tools like sublister or knockpy.
- Check for CNAME entries pointing to third-party services.
- Visit the subdomain and observe an AWS error indicating the S3 bucket does not exist.
- Confirm the CNAME using the host command.
- Create an S3 bucket with the same name as the subdomain.
- Upload content to the bucket, which is then served on the subdomain.
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 write-up has not been written yet. The Original tab links to the source.
A subdomain is a part of a website address, like blog.example.com. A CNAME record is a DNS setting that points one name to another. If the target of that record (here, an S3 bucket) is deleted but the record remains, anyone can claim that target and control what the subdomain shows.
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.