#BugBounty — AWS S3 added to my “Bucket” list!
A misconfigured AWS S3 bucket allowed unauthenticated users to read, upload, overwrite, and delete files, including job applicants' resumes. An attacker could access sensitive data and tamper with stored files.
Published on medium.com
{{media:0}}
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.
Context
This is a write-up about a misconfigured AWS S3 bucket belonging to an Indian e-commerce company, referred to throughout as "xyz". The entry point was the company's career page, where applicants upload their resumes. The bucket behind that feature was reachable directly over HTTP at the S3 endpoint, and the researcher found that it had no ACL restriction in place.
The author opens with the well-known case of Wes Wineberg, who reached every image and account on Instagram after gaining access to Instagram's S3 bucket, where the company stored everything from source code to images. The point of the comparison is that a storage bucket left open is not a small leak: it can expose the whole set of objects an organisation keeps there.
Setup
The work needed no account on the target; the report shows curl and the AWS command line interface being used. The researcher was hunting on the company's public website and found the career page, from which users apply for jobs and upload their resume. The bucket is addressed as xyz.s3.amazonaws.com, with objects under a career/ prefix. The report gives no versions for curl or the AWS CLI, and no credentials were used at any stage: every action described was performed as a non-authenticated user.
Finding it
While testing the career page, the researcher found an endpoint of this shape:
There was no ACL restriction set, so any non-authenticated user could simply access any file. That the resume upload feature wrote objects into a bucket that answered anonymous requests directly, rather than through the application, is what made the bucket itself the target.
Exploitation
Step 1: read an object anonymously
The researcher confirmed read access with a plain GET against a known object:
curl -XGET 'https://xyz.s3.amazonaws.com/career/test.pdf'
The response was the content of test.pdf. No authentication, signature or token was involved, so the object was publicly readable.
Step 2: write to the bucket
The researcher then discovered that the PUT method was enabled on the bucket and that it was publicly writable, so any file could be written onto it:
curl -XPUT -d 'HACKED' 'https://xyz.s3.amazonaws.com/career/test.pdf'
This sends a body of HACKED to the same object path. Because the bucket accepted anonymous writes, the content of an existing object could be replaced.
Step 3: enumerate other users' resumes
The researcher ran some bruteforcing over filenames and was able to read the resume content of other users. The report does not describe the wordlist or the naming pattern used.
Step 4: list the whole bucket
To take it one level further, the next target was to list and read all the files available on the bucket. The researcher connected to the S3 command line and ran:
root@logicbomb:~# aws s3 ls s3://xyz.s3.amazonaws.com
To no surprise, the complete bucket was accessible. All the CVs and resumes of users were publicly accessible and readable, and there were more sensitive data and directories as well. The report does not enumerate them.
Step 5: delete an object
The researcher tried further commands and found that deletion also worked:
The command returned:
So the bucket permitted anonymous deletion of files as well as reads and writes.
Root cause
The bucket had no ACL restriction set, and the report states that the PUT method was enabled on it. In practice, anonymous users could list, write and delete without credentials, though the report does not show the policy or ACLs behind this. The application's own upload flow was not the boundary being tested; the bucket endpoint answered directly, so whatever the career page did to authorise applicants was irrelevant to anyone talking to S3 itself.
Impact
An unauthenticated attacker could download, upload and overwrite files in the bucket, list its full contents, and delete objects. In practice this exposed the CVs and resumes of users who had applied through the career page, along with other sensitive data and directories the researcher found in the bucket.
Fix
The report records that the bug was reported to the company on 08-Dec-2017, marked fixed on 29-Dec-2017, and that the researcher re-tested and confirmed the fix on 01-Jan-2018. The company awarded the researcher on 07-Jan-2018.
The mitigation the author recommends is to promptly review S3 buckets and their contents to ensure that objects are not inadvertently made available to users the organisation does not intend to serve. For reference the author points to a Cloud Academy article on mastering S3 bucket policies and ACLs.
Variants to test
- Anonymous GET on objects under an upload prefix. Take a filename observed in an application upload flow and request it directly at the bucket endpoint. A positive result is the file content returned without any credentials.
- Anonymous PUT to the same path. Send a small body with
-XPUTto an object path. A positive result is a success response and the object content changing on a subsequent GET. - Bucket listing with the CLI. Run
aws s3 ls s3://<bucket>without configured credentials. A positive result is a full object listing. - Anonymous delete. Run
aws s3 rm s3://<bucket>/<key>against a test object you control. A positive result is thedelete:confirmation line for that key. - Filename bruteforcing on upload prefixes. Where uploaded files follow a predictable naming scheme, enumerate names and request each one. A positive result is other users' documents being returned.
What happened, in plain words
A security researcher was looking at the public website of an Indian online shop (called "xyz" in the write-up) and found its careers page, the page where people apply for jobs and upload their CV. The files people uploaded were stored in an Amazon S3 bucket, which is a kind of online filing cabinet rented from Amazon Web Services (AWS).
The problem was that this filing cabinet had been left unlocked. Anyone on the internet, with no username and no password, could open it, read every file inside, put new files in, replace existing ones, and even throw files away. The researcher could read other applicants' CVs and resumes, and found other sensitive data and folders in there too.
He reported it to the company, the company fixed it, and he was awarded by the company. This article walks through exactly what he did, step by step, in the simplest terms possible.
Why this matters: the Instagram comparison
The author starts by reminding readers of a famous case. In 2015 a security researcher named Wes Wineberg got access to Instagram's S3 bucket, the storage where the company kept everything from source code to images. That access allowed him to access every single image and account on Instagram.
The lesson is simple. A storage bucket is not a small side cupboard. It is often where an organisation keeps a huge amount of its material. If the door is left open, the leak is not one file: it is potentially everything in the room.
The setup: what tools were needed
This is the encouraging part for a beginner. The researcher needed:
- No account on the target website.
- No password, no login, no special permission.
- Just two tools:
curland the AWS command line interface (CLI).
What is curl? It is a small program that lives in a terminal (the text-only window on a computer) and lets you send requests to a web address and see the raw answer. Think of it as a browser without the pictures: you ask for a page or a file, and it prints back exactly what the server sends.
What is the AWS CLI? It is a program from Amazon that lets you talk to AWS services, including S3, by typing commands. Think of it as a remote control for your rented filing cabinet.
What is S3? Amazon Simple Storage Service. It is Amazon's storage service. You create a "bucket" (a container, like a top-level folder) and put "objects" (files) inside it. Each bucket has a web address of the form <bucket-name>.s3.amazonaws.com, and each object has a path after that, for example career/test.pdf.
What is an ACL? Access Control List. It is the list of rules that says who is allowed to do what with a bucket or a file: who can read, who can write, who can delete. If the ACL is missing or too loose, the wrong people get in.
In this case the bucket was addressed as xyz.s3.amazonaws.com, and the uploaded resumes sat under a folder-like prefix called career/. The report does not give versions for curl or the AWS CLI, and no credentials were used at any point: every action described was done as an ordinary anonymous visitor.
Finding it
While testing the careers page, the researcher found an address of this shape:
Let us unpack that line:
https://means a normal secure web connection, the same kind your browser uses.xyz.s3.amazonaws.comis the bucket's own address on Amazon's servers.career%2Ftest.pdfis the path to one file.%2Fis just the URL-encoded form of a slash/, so this is the same ascareer/test.pdf.
The key insight: the file was reachable directly at Amazon's address, not only through the careers page. The website's own upload form was not the gatekeeper. The bucket itself answered anyone who knocked.
There was no ACL restriction set, so any non-authenticated user (someone with no login at all) could simply access any file. That is what turned the bucket itself into the target.
Exploitation, step by step
Step 1: read a file without logging in
The researcher confirmed read access with a plain GET request against a known file:
curl -XGET 'https://xyz.s3.amazonaws.com/career/test.pdf'
Line by line:
curlis the program being run.-XGETtells it to use the GET method. A method is the verb of a web request: GET means "give me this thing".- The quoted address is the file being asked for.
The response was the content of test.pdf. No authentication, signature or token was involved. In plain words: the researcher asked for a file and the server handed it over, exactly as if the file were public on the open web.
Why this step? To prove the simplest possible thing first: can a stranger read a file? If yes, everything else is worth trying.
Step 2: write to the bucket
The researcher then discovered that the PUT method was enabled on the bucket and that it was publicly writable, so any file could be written onto it:
curl -XPUT -d 'HACKED' 'https://xyz.s3.amazonaws.com/career/test.pdf'
Line by line:
-XPUTuses the PUT method. PUT means "store this here", the verb used for uploading or replacing.-d 'HACKED'is the data being sent, the body of the request. Here it is the four lettersHACKED.- The address is the same file as before.
So this request says: "replace the contents of career/test.pdf with the word HACKED". Because the bucket accepted anonymous writes, the content of an existing file could be replaced, and new files could be dropped into the bucket.
Why this step? Reading is bad enough, but writing is worse. It means an attacker can replace the content of files stored in the bucket. Proving write access shows the problem is not just a leak but a takeover of the storage.
Step 3: find other people's resumes
The researcher ran some bruteforcing over filenames and was able to read the resume content of other users.
What is bruteforcing? Trying many possibilities automatically, one after another, until something works. Here it means guessing file names (for example common names, or names following a pattern) and requesting each one. The report does not describe the wordlist or the naming pattern used.
Why this step? One test file proves the door is open. Guessing names proves that real people's private documents are behind that door, which turns a technical finding into a real privacy problem.
Step 4: list the whole bucket
To take it one level further, the next target was to list and read all the files available on the bucket. The researcher connected to the S3 command line and ran:
root@logicbomb:~# aws s3 ls s3://xyz.s3.amazonaws.com
Line by line:
root@logicbomb:~#is just the terminal prompt, showing the machine and user. It is not part of the command.awsis the AWS command line program.s3says which AWS service we are talking to.lsmeans "list", the same idea as listing the contents of a folder.s3://xyz.s3.amazonaws.comis the bucket being listed.
To no surprise, the complete bucket was accessible. All the CVs and resumes of users were publicly accessible and readable, and there were more sensitive data and directories as well. The report does not enumerate them.
Why this step? Guessing names is slow and incomplete. Listing is the difference between peeking through a letterbox and being handed the full inventory. It shows the true scale of the exposure.
Step 5: delete a file
The researcher tried further commands and found that deletion also worked:
Line by line:
aws s3again selects the AWS storage service.rmmeans "remove", the same idea as deleting a file.- The address points at the specific file to delete.
The command returned:
That line is the program confirming it removed the file. So the bucket permitted anonymous deletion as well as reads and writes.
Why this step? Deletion is the most destructive permission of all. It shows an attacker could delete files in the bucket, not just look at them.
The root cause
The bucket had no ACL restriction set, and the report states that the PUT method was enabled on it.
The careers page's own upload flow was not the boundary being tested. The bucket address answered directly, so whatever the careers page did to authorise applicants was irrelevant to anyone talking to S3 itself.
An everyday comparison: imagine a hotel where the front desk checks your key card, but the back door to every room is propped open. The front desk's checks do not matter if the back door is open. Here, the careers page was the front desk and the bucket was the back door.
Impact
An unauthenticated attacker could download, upload and overwrite files in the bucket, list its full contents, and delete objects. In practice this exposed the CVs and resumes of users who had applied through the careers page, along with other sensitive data and directories the researcher found in the bucket.
The fix and the timeline
The report records that the bug was reported to the company on 08-Dec-2017, marked fixed on 29-Dec-2017, and that the researcher re-tested and confirmed the fix on 01-Jan-2018. The company awarded the researcher on 07-Jan-2018.
The mitigation the author recommends is to promptly review S3 buckets and their contents to ensure that objects are not inadvertently made available to users the organisation does not intend to serve. For reference the author points to a Cloud Academy article on mastering S3 bucket policies and ACLs.
Variants to test
If you want to try this kind of check yourself, here are the same ideas written as a checklist. Only ever test on systems you own or have permission to test.
- Anonymous GET on objects under an upload prefix. Take a filename you saw in an application's upload flow and request it directly at the bucket address. A positive result is the file content returned without any credentials.
- Anonymous PUT to the same path. Send a small body with
-XPUTto an object path. A positive result is a success response and the object content changing on a subsequent GET. - Bucket listing with the CLI. Run
aws s3 ls s3://<bucket>without configured credentials. A positive result is a full object listing. - Anonymous delete. Run
aws s3 rm s3://<bucket>/<key>against a test object you control. A positive result is thedelete:confirmation line for that key. - Filename bruteforcing on upload prefixes. Where uploaded files follow a predictable naming scheme, enumerate names and request each one. A positive result is other users' documents being returned.
Glossary
- ACL (Access Control List): the set of rules saying who may read, write or delete a bucket or file.
- Anonymous / non-authenticated user: someone using a service with no login, account or credentials at all.
- AWS (Amazon Web Services): Amazon's cloud platform, which rents out computing and storage over the internet.
- AWS CLI: Amazon's command line program for controlling AWS services by typing commands.
- Body (of a request): the data sent along with a request, such as the content being uploaded.
- Bruteforcing: automatically trying many possibilities (here, file names) until one works.
- Bucket: a top-level container in S3 that holds files, like a large folder.
- Bug bounty: a programme where organisations pay researchers for responsibly reporting security problems.
- Credentials: the proof of identity used to log in, such as a username and password or a key.
- curl: a command line program that sends web requests and prints the raw response.
- Endpoint: a specific web address that a service responds to.
- GET: the web method meaning "give me this thing".
- HTTP / HTTPS: the language browsers and servers use to talk; HTTPS is the encrypted version.
- Method: the verb of a web request, such as GET (read), PUT (store) or DELETE (remove).
- Object: a single file stored in an S3 bucket.
- Prefix: the folder-like part of an object's path, such as
career/. - Prompt: the text a terminal shows before you type a command, for example
root@logicbomb:~#. - PUT: the web method meaning "store this here", used for uploading or replacing.
- Response: what a server sends back after a request.
- S3 (Simple Storage Service): Amazon's file storage service, where buckets and objects live.
- Terminal: the text-only window on a computer where you type commands.
- Token / signature: a piece of data proving a request is authorised; none was needed here.
- URL encoding: writing special characters in a web address in a safe form, such as
%2Ffor a slash/. - Vulnerability: a weakness in a system that lets someone do something the owner did not intend.