Subdomain takeover on mta1a1.spmail.uber.com
A dangling AWS elastic IP address in the DNS A record for mta1a1.spmail.uber.com allowed an attacker to allocate that IP and take over the subdomain. This gave access to cookies scoped to that subdomain and CORS, potentially enabling phishing.
- Triaged in 3 days
- Fixed in 5 days
- Paid in 17 days
- Disclosed after 6 months
Summary by the program
A dangling AWS record on mta1a1.spmail.uber.com allowed a complete DNS zone takeover, giving an adversary access to mta1a1.spmail.uber.com-scoped cookies and CORS, which could facilitate phishing attacks.
Thanks again, @0x3c3e!
Summary by the researcher
It's so called IP-use-after-free attack. I was able to obtain an IP address from mta1a1.spmail.uber.com A DNS record as it was possible to allocate the IP from AWS elastic IP's pool.
Edit 11/2019 - It would appear AWS has begun serving elastic IPs from a small account-specific pool (similar to GCP). This severly limits the diversity of addresses recieved. (from https://github.com/monoxgas/FlyingAFalseFlag).
As follows from the foregoing, current chances to reproduce something like that should tend to zero.
References
- Great intro article https://blog.apnic.net/2019/01/09/be-careful-where-you-point-to-the-dangers-of-stale-dns-records/
- AWS elastic IP reference https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
- BHUSA 2019: Flying a False Flag https://youtu.be/2BEwqbCbQuM?t=1945
- PoC: https://github.com/0x3c3e/recloud
- My quick research https://docs.google.com/spreadsheets/d/18gfOnxFC3rq8Z_Ecnuxdw4ldC79GbzYPqCCn5XX0DVs/
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the DNS A record for the subdomain pointed to an AWS elastic IP that had been released and returned to the pool, allowing anyone to allocate it.
Impact
An attacker could control the subdomain, access cookies scoped to it and CORS, and potentially conduct phishing; however, AWS now uses account-specific IP pools, making reproduction very unlikely.
What the attacker needed
AWS account; ability to allocate elastic IPs
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 report has not been written yet. The Original tab links to the source.
A DNS record points a domain name to an IP address. If that IP address is no longer controlled by the domain owner, someone else can claim it and make the domain point to their own server. Here, the IP was from Amazon's pool of reusable addresses, so the attacker could take it over and control what the subdomain showed.
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.