unclaimed s3 bucket takeover in the 3 js file located on the github page of brave software
Three JavaScript files in Brave's GitHub organisation reference an S3 bucket name that was not registered, so anyone could claim it. The reporter claims an attacker who registers the bucket could host files under the same names and redirect or serve malicious content to users of pages that load those scripts.
Originally disclosed on HackerOne
- Paid in 26 hours
- Disclosed after 32 days
Summary:
There is a unclaimed s3 bucket i.e brave-extensions.s3.amazonaws.com located in the 3 .js file on official brave software github page (https://github.com/search?q=org%3Abrave+brave-extensions+language%3AJavaScript&type=Code)the attacker can takeover the bucket and create file that is used in the code for e.g.(redirect.html,dt.html ) and can modify the content of the html file and can get cookies of the victim whoever uses the file.
##Proof of Exploitability
- Github Link where there is the s3 bucket located in 3 js files :- https://github.com/search?q=org%3Abrave+brave-extensions+language%3AJavaScript&type=Code
- POC link for takeover s3 bucket ( for poc purpose i have showed index.html so that no user is harmed while testing):- http://brave-extensions.s3.amazonaws.com/index.html

Steps To Reproduce:
- Create a s3 bucket with name brave-extensions and any region
- Upload files with the name same as given in the code
- Make the settings and change it as a static website
- You have successfully taken the s3 bucket and now when any user runs the website where the js file is linked they will be redirected to the malicious website link and an attacker can get the cookies of any victim.
Impact
An attacker can takeover the unclaimed s3 bucket and if the js file is connected with any html file of website that is hosted publicly then an attacker can create a malicious file with custom payloads and can harm the user by downloading the malicious file instead of original file.
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
Impact
An attacker who claims the bucket could serve malicious files in place of the expected ones and redirect users, potentially exposing cookies, if the scripts are used by a publicly hosted page.
What the attacker needed
Bucket name is unregistered; scripts referenced by a live page
How it was found
- Register an S3 bucket with the same name as the one referenced in the code.
- Upload files using the same filenames that the code expects.
- Configure the bucket to serve as a static website.
- The bucket is now controlled, and pages loading the script may be redirected or served attacker 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.
Some web pages load files from a storage service called S3, which is run by Amazon. If a company writes the name of a storage area into its code but never actually registers that name, anyone else can register it and put their own files there. The reporter says this happened here, so a stranger could control what those scripts load.
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.