How I Found an Open AWS S3 Bucket and Used It to Take Over a Subd
An unclaimed AWS S3 bucket was referenced by a subdomain, allowing the researcher to claim it and host a proof-of-concept file. This resulted in a subdomain takeover, as the subdomain then served the researcher's content.
Published on medium.com
My name is Boubker Chamekh, and I am from Morocco. My philosophy in life is to be patient until you achieve your goals, and this approach has helped me in my bug-hunting journey.
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 a dangling CNAME record pointing to an unclaimed AWS S3 bucket.
Impact
An attacker could take over a subdomain and host arbitrary content, potentially damaging the organisation's reputation or enabling further attacks.
What the attacker needed
Subdomain with dangling CNAME to S3; unclaimed S3 bucket
The fix
The organisation should remove the dangling CNAME record or reclaim the S3 bucket.
How it was found
- Enumerate subdomains and find CNAME records pointing to a developer domain.
- Access a subdomain and discover an API endpoint that lists streamers and their S3 buckets.
- Check S3 buckets for public access; find one open bucket and one unclaimed bucket.
- Inspect the open bucket's content and find a reference to another S3 bucket.
- Claim the unclaimed S3 bucket and upload a proof-of-concept file.
- Observe that the subdomain now serves the uploaded file, confirming takeover.
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 takeover happens when a website points a subdomain to an external service, like an S3 bucket, but that service is no longer controlled by the website owner. An attacker can claim the unused service and control what appears on that subdomain. Here, the researcher found an unclaimed S3 bucket and took it over.
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.