How I Found and Claimed a Subdomain Takeover on cewe.kruidvat.nl
A subdomain pointed via CNAME to an unclaimed AWS S3 bucket, allowing an attacker to claim the bucket and host content on the legitimate domain. The author demonstrated control by uploading a proof-of-concept page, then deleted the bucket.
medium.com
Published on medium.com
Subdomain takeovers are one of those vulnerabilities that sound simple in theory but pay well in practice — and I recently found one on a live target.
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 S3 bucket that was never created or had been deleted, leaving the subdomain claimable by anyone.
Impact
An attacker could host phishing pages on a legitimate domain, potentially steal cookies scoped to the parent domain, and bypass CSP or CORS policies.
What the attacker needed
An AWS account; knowledge of the dangling CNAME
The fix
The bucket was deleted by the researcher as cleanup, but the underlying issue should be fixed by removing the dangling DNS record or properly configuring the cloud resource.
How it was found
- Enumerate subdomains of the target domain.
- Resolve the CNAME for the subdomain and find it points to a CloudFront distribution.
- Check the subdomain with curl and see a 403 Forbidden response.
- Use AWS CLI to attempt to create a bucket with the subdomain name, which succeeds.
- Upload a proof-of-concept HTML file to the bucket and verify it is served on the subdomain.
- Delete the bucket and its contents to clean up.
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 prefix like 'blog' in blog.example.com. If that subdomain points to a cloud service that no longer exists, anyone can sign up for that service using the same name and take control of the subdomain. Here, the subdomain pointed to an unused Amazon S3 storage bucket, so the researcher created that bucket and uploaded a harmless page to prove control.
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.