Skip to content
Subdomain takeover Disclosed report Beginner

Subdomain takeover due to an unclaimed Amazon S3 bucket on ███

A subdomain's DNS record pointed to an Amazon S3 bucket that no longer existed, so anyone could register that bucket name and serve content on the trusted subdomain. The reporter claimed the bucket and hosted a page and an XSS proof of concept, showing an attacker could host phishing or malicious content under the domain.

pdbx Follow

Originally disclosed on HackerOne

Critical View original
  • Triaged in 1 hour
  • Fixed in 37 days
  • Disclosed after 57 days

Summary: An unclaimed Amazon S3 bucket on █████████ gives an attacker the possibility to gain full control over this subdomain.

Description: ███████ pointed to an S3 bucket that did no longer exists. The bucket points to an Amazon S3 website bucket in the US East region. I claimed this bucket and successfully took over this subdomain.

Note: I am reporting this issue to DoD since: "████████ ██████" The ████████ is linked to ███, so I believe this belongs here. I discovered this domain initially from the DoD websites list. Please excuse if this is a misconception.

Impact

This is extremely vulnerable to attacks as a malicious user could create any web page with any content and host it on the ██████████ domain. This would allow them to post malicious content which would be mistaken for a valid site. They could:

  • XSS
  • Phishing
  • Bypass domain security
  • Steal sensitive user data, cookies, etc.

Step-by-step Reproduction Instructions

dig ███ results in:

; <<>> DiG 9.11.3-1ubuntu1.12-Ubuntu <<>> ███
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53839
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;███████.    IN  A

;; ANSWER SECTION:
██████████. 1022 IN CNAME   ████-website-us-east-1.amazonaws.com.
██████████-website-us-east-1.amazonaws.com. 1022 IN CNAME s3-website-us-east-1.amazonaws.com.
s3-website-us-east-1.amazonaws.com. 2542 IN A   █████

;; Query time: 304 msec
;; SERVER: 10.68.0.1#53(10.68.0.1)
;; WHEN: Wed Jul 08 22:01:20 KST 2020
;; MSG SIZE  rcvd: 154
  1. █████████ points to an Amazon S3 bucket in the S3 US East 1 region. Visiting http://███████ revealed that the bucket did not exist (refer to before.png).
  2. I created an S3 bucket with the name ████████ on my S3 account in the US East 1 region and uploaded an index.html and an XSS POC (xss_poc_998877665544332211.html).
  3. Visiting http://███ shows the successful subdomain takeover. View the page source to see the following comment: <!-- Demonstrated subdomain takeover by chron0x -->
  4. Visiting http://████████/xss_poc_998877665544332211.html you can see the simple XSS payload in action.

Suggested Mitigation/Remediation Actions

Remove the █████ DNS entry and I will remove the bucket from my Amazon account as soon as this issue is resolved. If you want to reclaim the domain instead, please let me know in the comments and I free the bucket before.

Impact

High. An attacker can use the domain for various malicious activities ranging from XSS, over phishing to cookie stealing, etc. All of this while using a trusted domain name (██████).

The original report as published on HackerOne, by pdbx. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 a dangling DNS record: the subdomain's CNAME still pointed to an S3 website endpoint whose bucket had been deleted, allowing anyone to claim the bucket name.

Impact

An attacker could host arbitrary content, including phishing pages and scripts, on a trusted domain, potentially stealing cookies or user data and bypassing domain-based security.

What the attacker needed

Ability to create an S3 bucket in us-east-1; the bucket name is unclaimed

The fix

The DNS entry pointing to the deleted bucket should be removed, or the bucket name reclaimed, to stop the takeover.

How it was found

  1. Resolve the subdomain and observe it is a CNAME to an S3 website endpoint in the US East 1 region.
  2. Visit the subdomain and see that the bucket does not exist.
  3. Create an S3 bucket with the same name in the US East 1 region and upload an index page and an XSS proof of concept.
  4. Visit the subdomain to confirm the takeover and view the page source for the demonstration comment.
  5. Visit the uploaded XSS proof-of-concept page to see the payload run.

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 subdomain is a name like shop.example.com that belongs to the main site. Its DNS record can point to a cloud storage bucket; if that bucket is deleted but the DNS record stays, anyone can create a bucket with the same name and put their own pages there. Visitors then see the attacker's content on the real, trusted domain.

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.

More by pdbx

View all

6 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Subdomain takeover

The lesson behind this report.

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.