Skip to content
Subdomain takeover Write-up Beginner

How I Found a Critical Subdomain Takeover Vulnerability (And What

A subdomain was left pointing via a CNAME record to an Amazon S3 bucket that no longer existed, so anyone could register that bucket name and serve content on the company's domain. The author claimed the bucket and served a test page, showing that phishing or malware could be hosted under the trusted subdomain.

Be nice insabat Follow

Published on medium.com

FREE LINK https://medium.com/@InsbatArshad/how-i-found-a-critical-subdomain-takeover-vulnerability-and-what-you-can-learn-from-it-8af33baa321c?sk=827942870b3f4afba15b457bbfc58dfa

Be nice insabat, on medium.com

The full write-up lives on its author's site

It belongs to its author, 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

Root cause

Likely the company migrated away from S3 but left the CNAME record in DNS, and S3 does not check that the person creating a bucket owns the matching domain name.

Impact

An attacker could host phishing pages or malware on the trusted subdomain and potentially steal cookies or sessions if the parent domain uses lax security policies.

What the attacker needed

Dangling CNAME to an unclaimed S3 bucket; ability to create an S3 bucket with that name

The fix

The company claimed the bucket to block others, removed the dangling DNS record, and added monitoring for future misconfigurations.

How it was found

  1. Resolve the subdomain with dig to confirm it points to an S3 website endpoint.
  2. Create an S3 bucket with the same name as the subdomain in the matching region.
  3. Upload a test index page to the bucket.
  4. Visit the subdomain and see the uploaded content served under the company's domain.

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 smaller address under a company's main domain, like files.example.com. A CNAME record is a DNS entry that says 'this name actually belongs to that other service'. If the other service (here, an S3 storage bucket) has been deleted but the DNS entry remains, anyone can recreate that bucket with the same name and take control of the subdomain.

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 Be nice insabat

View all

8 more disclosed reports, best first.

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.