TheBinitGhimire/README.md
A Facebook subdomain had a dangling CNAME record pointing to a deleted AWS Elastic Beanstalk instance. An attacker with an AWS account could claim that instance name and serve content on the Facebook subdomain.
Meta
Published on gist.github.com
Clone this repository at <script src="https://gist.github.com/TheBinitGhimire/ec24a9de97a372cf6b7b9453511c3f8b.js"></script> - Save TheBinitGhimire/ec24a9de97a372cf6b7b9453511c3f8b to your computer and use it in GitHub Desktop.
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 CNAME record was not removed after the Elastic Beanstalk instance was deleted, leaving a dangling DNS record.
Impact
An attacker could claim the Elastic Beanstalk instance and gain control over api.techprep.fb.com, hosting their own content on the Facebook subdomain.
What the attacker needed
AWS account with Elastic Beanstalk permissions; Ability to create instance in us-east-1
The fix
The CNAME records should be changed to point to an Elastic Beanstalk instance that Facebook currently owns, or removed entirely.
How it was found
- Perform a DNS lookup on api.techprep.fb.com and observe it points to techprep-backend.us-east-1.elasticbeanstalk.com via CNAME records.
- Check whether techprep-backend.us-east-1.elasticbeanstalk.com resolves; it does not.
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 CNAME record is like a forwarding address in the domain name system (DNS), which tells the internet where to find a website. If that forwarding address no longer exists, someone else can register it and take over the original name. Here, Facebook pointed a subdomain to an Amazon service that they later deleted, so anyone could recreate it and control 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.