Skip to content
Subdomain takeover Disclosed report Beginner

s3 bucket takeover presented in https://github.com/reddit/rpan-studio/blob/e1782332c75ecb2f774343258ff509788feab7ce/CI/full-build-macos.sh

A build script in a public GitHub repository referenced an S3 bucket name that nobody had registered, so the bucket could be claimed by anyone. An attacker who claimed it could serve their own files under the expected names and have them downloaded by anyone running the build script.

gaurav-bhatia Follow

Originally disclosed on HackerOne

High 8.2 View original
  • Fixed in 9 days
  • Paid in 9 days
  • Disclosed after 3 months

Hey team,

Summary:

I have found that in the code of full-build-macos.sh in rpanstudio on github(https://github.com/reddit/rpan-studio/blob/e1782332c75ecb2f774343258ff509788feab7ce/CI/install-dependencies-osx.sh) contains a s3 bucket which was unclaimed i.e (https://obs-nightly.s3-us-west-2.amazonaws.com)

Steps To Reproduce:

  1. Create a s3 bucket with name obs-nightly and us west 2 region
  2. Upload files with the name same as given in the code (e.g. cef_binary_${1}_macosx64.tar.bz2)
  3. Make the settings and change it as a static website
  4. You have successfully taken the s3 bucket and now when any user runs the code the url with s3 get executed and an attacker can spread dangerous malware.

POC:

  1. Link for the s3 bucket takenover :- https://obs-nightly.s3-us-west-2.amazonaws.com/index.html
reddits3poc1.JPG
reddits3poc1.JPG From the original on HackerOne
  1. Github link that shows the s3 bucket :- https://github.com/reddit/rpan-studio/blob/e1782332c75ecb2f774343258ff509788feab7ce/CI/install-dependencies-osx.sh
reddits3poc3.JPG
reddits3poc3.JPG From the original on HackerOne
  1. Github link that shows the s3 bucket :- https://github.com/reddit/rpan-studio/blob/e1782332c75ecb2f774343258ff509788feab7ce/CI/full-build-macos.sh
reddits3poc2.JPG
reddits3poc2.JPG From the original on HackerOne

##Remediaton You should remove the unclaimed s3 bucket as soon as possible from both the codes as it possess a critical risk

Impact

An attacker can takeover the s3 bucket and can host his malicious content with the name (cef_binary_${1}_macosx64.tar.bz2) as presented in the code and can spread ransomware and many malicious files. This bug has a critical impact because the code of the tool that many people uses, contains unclaimed s3 bucket.

Regards, Gaurav Bhatia

The original report as published on HackerOne, by gaurav-bhatia. 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 the build script referenced an S3 bucket that the project never registered, leaving the name free for anyone to claim.

Impact

An attacker could host malicious files under the expected names and spread malware to anyone running the build script.

What the attacker needed

Public GitHub repository; bucket name unregistered

How it was found

  1. Register an S3 bucket with the same name in the same region.
  2. Upload files using the same filenames the script expects.
  3. Configure the bucket as a static website.
  4. Anyone running the script then downloads the attacker's files.

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 build script downloaded files from a cloud storage location (an S3 bucket) whose name was not registered by the project. Cloud bucket names are global, so anyone can register an unused one. The attacker then controls what the script downloads.

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 gaurav-bhatia

View all

3 more disclosed reports, best first.

More from Reddit

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.