The way I found #Amazon S3 Bucket Takeover
A subdomain's CNAME record still pointed to an S3 bucket that had been deleted, so the bucket name was free to register. An attacker could create a bucket with that name and serve their own content on the victim's subdomain.
Published on medium.com
I am Bhautik Patel from India, Here i am writing a blog on one of my finding reported to “Bugcrowd” platform. In this writeup i will discuss about Taking over Amazon S3 bucket.
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
The CNAME record for the subdomain was not removed after the S3 bucket it referenced was deleted, leaving the bucket name claimable by anyone.
Impact
An attacker could serve arbitrary content on the victim's subdomain, which could be used for phishing or to damage the brand.
What the attacker needed
Subdomain with a dangling CNAME to a deleted S3 bucket; ability to create an S3 bucket with that name
The fix
The dangling CNAME record should be removed, or the bucket name should be re-registered by the organisation.
How it was found
- Visit the subdomain and observe the 'No Such Bucket' error.
- Create a new S3 bucket with the same name as the subdomain.
- Upload an HTML file to the bucket.
- Enable static website hosting in the bucket properties.
- Disable block public access in the permissions settings.
- Add a bucket policy granting read-only access to anonymous users, then visit the subdomain to see the uploaded page.
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 company's subdomain can be set up to point at a storage bucket in the cloud. If the bucket is deleted but the pointer is left behind, anyone can claim that bucket name and put their own page there. Visitors to the real subdomain then see the attacker's 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.