Skip to content
Misconfiguration Write-up Beginner

How I earned $1,500 in just 15 mins due to Amazon S3 bucket misconfiguration?

An Amazon S3 bucket used by Dropbox had misconfigured access controls, allowing anyone to upload, view, and delete files. An attacker could upload malicious content or delete legitimate files.

Muhammad Asim Shahzad Follow

Published on web.archive.org

Bounty$1,500 View original

#### protector47

protector47, on web.archive.org

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

Dropbox is the target in this write-up. The author uses it as an example of a platform that stores and shares data and that most people would consider secure, and then shows that a third-party storage layer behind it was not. The feature involved is not a Dropbox application endpoint but the Amazon S3 bucket that Dropbox uses as a CDN origin for images. The bucket held campaign body images, and the object path shown in the report is campaign_body_images/images/[redacted]/b1.gif.

In this case the bucket allowed anonymous listing, upload and delete as well.

Setup

The author worked from Kali Linux with the AWS CLI installed. The report links to the CLI repository at https://github.com/aws/aws-cli and says to install AWSCLI on the Linux environment first.

The precondition is a target that serves at least one asset from an S3 bucket, plus the ability to reach that bucket over the network. The author also lists tools for discovering buckets before any of this, which are covered under Finding it.

Finding it

The author's starting point is subdomain enumeration. The advice given is to focus on subdomains because critical issues tend to sit there, while the main domain usually carries the stronger controls. On a free weekend he picked Dropbox and enumerated subdomains.

He found a Dropbox subdomain that contained an image. Opening the image through its direct link showed that it was hosted on an Amazon bucket. The URL had this shape:

HTTP
http://xyz.s3.amazonaws.com/campaign_body_images/images/[redacted]/b1.gif

The part before .s3 is the bucket name, so the bucket here is xyz in the report's placeholder form. The same URL pattern is used earlier in the article as the general way to recognise S3-backed assets: right-click an image, open it in a new tab, and if the host looks like xyz.s3.amazonaws.com, the application is storing data on Amazon and xyz is the bucket.

The report lists five ways to find a target's buckets:

  1. Online and command-line tools from GitHub: Lazy S3, bucket_finder, AWS Cred Scanner, sandcastle, Mass3, Dumpster Diver, S3 Bucket Finder and S3Scanner. Most are command-line tools that are cloned from GitHub.
  2. Server information from the Wappalyzer browser extension, or from the response to any request, to see whether the target uses Amazon for storage.
  3. The image-in-new-tab trick described above.
  4. Spidering the target with Burp Suite; the author calls Burp Spider one of his favourite plugins and says it extracts the Amazon bucket of the target.
  5. Checking HTTP History in Burp Suite during interception, because images are fetched from the Amazon server when the site is opened and Burp records the bucket URL.
Image for post
Image for post From the original on web.archive.org

Exploitation

Step 1: confirm the bucket from the asset URL

The image on the Dropbox subdomain resolved to the xyz.s3.amazonaws.com host with the object path above. That identified the bucket name and confirmed that the asset was served from S3 rather than from Dropbox infrastructure.

Step 2: list the bucket

With the bucket name known, the author opened AWSCLI and listed the bucket contents:

Bash
aws s3 ls s3://xyz

aws s3 ls with an s3:// URI lists the objects in the named bucket. The report notes that this only works when the target has not disabled directory listing on the bucket.

Step 3: upload a file into the bucket

Next he moved a local file into the bucket:

Bash
aws s3 mv yourfile_path s3://xyz/test-file.txt

aws s3 mv moves the local file to the given key in the bucket. The report says this only works when the proper ACL has not been applied. It worked: the file was uploaded to the Dropbox Amazon bucket.

Step 4: fetch the uploaded object by direct URL

The report notes that a file uploaded this way could contain a malicious script, a phishing login panel or a virus.

Image for post
Celebration time. From the original on web.archive.org

Celebration time.

The whole sequence took about 15 minutes, and the bounty of $1,500 from Dropbox arrived within the next three hours.

Root cause

The bucket's access control was too permissive. The author frames the class of bug as security misconfiguration of a third-party CDN such as Amazon or Cloudflare where the ACL is not properly configured. In S3 terms, anonymous callers were allowed to list the bucket and to write objects into it, in addition to reading the objects the application published. The report does not show the bucket policy or ACL document, so the exact grant that allowed this is not stated; the observable behaviour is that listing and upload both succeeded without credentials.

Nothing in the report describes a WAF, signed URLs or any other control in front of the bucket.

Impact

The author could upload, view and delete any file placed on the bucket. Because uploaded objects were reachable by direct URL, an attacker could host arbitrary content on a trusted Dropbox-owned hostname: malicious scripts, phishing login panels or malware, as the report lists. The report does not describe any attempt to delete objects or to overwrite existing campaign images, so the delete capability is stated as available rather than demonstrated.

Fix

The remediation section gives three steps:

  1. Apply proper ACLs and disable write permission so that external users cannot upload files.
  2. Disable directory listing so that the bucket contents cannot be viewed.
  3. Apply proper policies on buckets and objects so that CORS requests are handled securely.

Variants to test

  • Listing on a known bucket. Run aws s3 ls s3://<bucket> against a bucket discovered from an asset URL. A positive result is a directory-style listing of keys returned without credentials.
  • Anonymous write. Run aws s3 mv <local file> s3://<bucket>/test-file.txt and then request the resulting key by its direct URL.
  • Bucket discovery from page assets. Open images from the target in a new tab and look for *.s3.amazonaws.com hosts, or spider the site with Burp and read the bucket URLs out of the HTTP history. A positive result is any host of that form, where the label before .s3 is the bucket name.
  • Tool-assisted discovery. Run the GitHub tools listed in the report (Lazy S3, bucket_finder, S3Scanner and the rest) against the target's name. A positive result is a bucket name that resolves and responds to anonymous requests.
  • Delete permission. The author states delete was possible on this bucket. Testing it on another target means removing an object you uploaded yourself and confirming it disappears from the listing; do not test deletion on objects you did not create.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

A security researcher spent a free weekend looking for bugs in Dropbox, a service most people use to store and share files. He found a Dropbox web page that showed an image, opened that image on its own, and noticed the image was not stored on Dropbox's own computers but on Amazon's cloud storage, in something called an S3 bucket. He proved it by uploading a file of his own into Dropbox's bucket and then opening it through a normal web link. The whole thing took about 15 minutes, and Dropbox paid him $1,500 within the next three hours.

Image for post
Image for post From the original on web.archive.org

The image above sits at the start of the story, right after the author introduces himself and says he earned $1,500 in 15 minutes.

Before the details, a few ideas need explaining, because the whole bug depends on them.

What is a CDN? A content delivery network is a set of servers spread around the world that hold copies of a website's files, such as images, so that visitors get them quickly from a server near them. Think of it as a chain of local warehouses instead of one central depot: the goods are the same, but they reach the customer faster. Amazon and Cloudflare are named in the report as examples of companies that run such networks.

What is an S3 bucket? Amazon's Simple Storage Service, S3 for short, is a place in Amazon's cloud where you can store files. A bucket is like a folder inside it. Each bucket has a name, and files inside it (called objects) can be fetched over the web with a normal link. The report describes a bucket as a public cloud storage resource, similar to a file folder, that stores objects made of data plus descriptive metadata.

What is an ACL? An access control list is a list of permissions attached to a file or folder. It says who may do what: who can read, who can write, who can delete. The everyday comparison is a guest list at a door: your name being on it decides whether you get in, and a second column might say whether you may go behind the bar. Each entry in a typical ACL names a subject (a person or a program) and an operation (read, write and so on).

What is a security misconfiguration? It is when software is set up in a way that leaves a door open, not because the software is broken but because a setting was chosen wrongly or left at a loose default. The report calls it very common and says it can happen at any level of an application stack. If the settings are wrong, outsiders as well as legitimate users may be able to compromise the system, and sometimes that leads to a complete compromise.

The vulnerability here is exactly that: a third-party storage service used by an application, with its access control list not properly configured. The report notes this only exists when applications use a third-party CDN such as Amazon or Cloudflare with the ACL not properly set up.

Finding the bucket

The author's advice is to focus on subdomains. A subdomain is a smaller address under a company's main address: if the main site is example.com, then shop.example.com or images.example.com are subdomains. The reasoning given is that most critical vulnerabilities are triggered on subdomains, because companies put their strongest protections on the main domain and often do not pay the same attention to the smaller ones. Think of a large building where the front lobby has a guard and a badge reader, but a side service entrance is left unlocked.

On his free weekend he picked Dropbox and started enumerating subdomains, meaning he collected as many of their addresses as he could find. He found a Dropbox subdomain that contained an image. He opened the image through its direct link, and saw that it was uploaded on an Amazon bucket. The URL looked like this:

HTTP
http://xyz.s3.amazonaws.com/campaign_body_images/images/[redacted]/b1.gif

Reading that link piece by piece:

  • http:// is the usual prefix for a web address.
  • xyz.s3.amazonaws.com is the host, the name of the computer serving the file. The s3.amazonaws.com part says it is Amazon's storage service, and whatever comes before .s3 is the bucket name. Here the report uses xyz as a placeholder for the real name.
  • campaign_body_images/images/[redacted]/b1.gif is the path of the file inside the bucket, like the route to a particular shelf and box in the warehouse.

So the bucket name is whatever sits before .s3 in the address. The report uses this same pattern earlier as a general trick: right-click any image on a site, open it in a new tab, and if the address looks like xyz.s3.amazonaws.com, the site stores its data on Amazon and xyz is the bucket name.

The report lists five ways to find a target's buckets:

  1. Tools available on GitHub, most of them run from a command line and cloned from GitHub: Lazy S3, bucket_finder, AWS Cred Scanner, sandcastle, Mass3, Dumpster Diver, S3 Bucket Finder and S3Scanner.
  2. Looking at server information through the Wappalyzer browser extension, or at the response to any request, to see whether the target uses Amazon for storage.
  3. The image-in-a-new-tab trick just described.
  4. Spidering the target with Burp Suite. Spidering means letting a tool crawl the site automatically and collect every link and file it can reach. The author calls Burp Spider one of his favourite plugins and says it extracts the Amazon bucket of the target.
  5. Checking the HTTP History in Burp Suite while intercepting traffic. When you open a website, your browser fetches images from the Amazon server, and Burp records those requests, so the bucket address shows up in the history.

Getting into the bucket

Step 1: confirm the bucket from the image address

The image on the Dropbox subdomain pointed at the xyz.s3.amazonaws.com host with the file path shown above. That gave the bucket name and confirmed the file was served from Amazon's storage rather than from Dropbox's own systems.

Step 2: list what is inside

With the bucket name in hand, the author opened AWSCLI on Kali Linux. AWSCLI is Amazon's official command-line tool: a program you type commands into, instead of clicking around a website, to work with Amazon's cloud services. Kali Linux is an operating system popular with security testers. The report links to the tool at https://github.com/aws/aws-cli and says to install it on your Linux environment first.

He then listed the bucket contents:

Bash
aws s3 ls s3://xyz

Line by line: aws runs the Amazon command-line tool; s3 says which of Amazon's services you want, here the storage service; ls means list, the same idea as the ls command that lists files in a folder on Linux; and s3://xyz is the address of the bucket, with xyz standing in for the real bucket name. The report notes this only works when the target has not disabled directory listing on the bucket. Directory listing is the bucket's willingness to show its contents to anyone who asks, like a shop that leaves its stock list taped to the window.

Step 3: put a file in

Next he moved a local file into the bucket:

Bash
aws s3 mv yourfile_path s3://xyz/test-file.txt

Line by line: aws s3 again selects the storage service; mv means move, and it takes a file on your own machine and places it in the bucket; yourfile_path is the location of the file on your computer; s3://xyz/test-file.txt is where it should end up, in bucket xyz under the name test-file.txt. The report says this only works when the proper ACL has not been applied. It worked: the file was uploaded to the Dropbox Amazon bucket.

Step 4: open the uploaded file through a normal link

The report notes that a file uploaded this way could contain a malicious script, a phishing login panel or a virus. A phishing login panel is a fake login page that looks like the real one and captures whatever the visitor types.

Image for post
Celebration time. From the original on web.archive.org

Celebration time.

The image above appears right after the upload succeeded and the file was reachable by direct link, as the author's reaction to the result.

The whole sequence took about 15 minutes, and the bounty of $1,500 from Dropbox arrived within the next three hours.

Why it worked

The bucket's access control was too permissive. The report frames the class of bug as security misconfiguration of a third-party CDN such as Amazon or Cloudflare where the ACL is not properly configured. In plain terms, anonymous visitors were allowed to list the bucket and to write files into it, on top of reading the files the application published. The report does not show the bucket policy or ACL document, so the exact permission that allowed this is not stated; what was observed is that listing and upload both succeeded without any credentials.

Nothing in the report describes a web application firewall, signed URLs or any other control in front of the bucket. A signed URL is a link with a built-in expiry and signature, so only someone given the link can fetch the file for a limited time; none of that was in place here.

What an attacker could do

The author could upload, view and delete any file placed on the bucket. Because uploaded files were reachable by direct URL, an attacker could host arbitrary content on a trusted Dropbox-owned hostname: malicious scripts, phishing login panels or malware, as the report lists. The report does not describe any attempt to delete files or to overwrite existing campaign images, so the delete capability is stated as available rather than demonstrated.

How to fix it

The remediation section gives three steps:

  1. Apply proper ACLs and disable write permission so that external users cannot upload files.
  2. Disable directory listing so that the bucket contents cannot be viewed.
  3. Apply proper policies on buckets and objects so that CORS requests are handled securely.

CORS, cross-origin resource sharing, is the set of rules a browser follows when a page from one site asks for a resource from another site; handled badly, it can let the wrong pages read the wrong data.

Other things to try

  • Listing a known bucket. Run aws s3 ls s3://<bucket> against a bucket discovered from an image address. A positive result is a directory-style listing of file names returned without credentials.
  • Anonymous write. Run aws s3 mv <local file> s3://<bucket>/test-file.txt and then request the resulting file by its direct URL.
  • Bucket discovery from page assets. Open images from the target in a new tab and look for *.s3.amazonaws.com hosts, or spider the site with Burp and read the bucket addresses out of the HTTP history. A positive result is any host of that form, where the label before .s3 is the bucket name.
  • Tool-assisted discovery. Run the GitHub tools listed in the report (Lazy S3, bucket_finder, S3Scanner and the rest) against the target's name. A positive result is a bucket name that resolves and responds to anonymous requests.
  • Delete permission. The author states delete was possible on this bucket. Testing it on another target means removing a file you uploaded yourself and confirming it disappears from the listing; do not test deletion on files you did not create.

Glossary

  • ACL (access control list): a list of permissions attached to a file or folder saying who may read, write or delete it.
  • AWSCLI: Amazon's command-line tool for working with its cloud services by typing commands.
  • Bucket: a named folder in Amazon S3 that holds files (objects).
  • Burp Suite: a tool for intercepting and inspecting the traffic between a browser and a website.
  • CDN (content delivery network): servers spread around the world that hold copies of a site's files so visitors get them quickly.
  • CORS (cross-origin resource sharing): browser rules for when a page from one site may request resources from another site.
  • Credentials: login details such as keys or passwords that prove who you are.
  • Directory listing: a bucket's willingness to show its contents to anyone who asks.
  • Enumeration: systematically collecting things, such as all the subdomains of a target.
  • HTTP History: Burp Suite's record of every request and response it has seen.
  • Kali Linux: a Linux operating system popular with security testers.
  • Object: a file stored in an S3 bucket, together with its descriptive metadata.
  • Phishing login panel: a fake login page that looks real and captures what visitors type.
  • S3 (Simple Storage Service): Amazon's cloud storage service.
  • Security misconfiguration: a system left open because a setting was chosen wrongly or left at a loose default.
  • Signed URL: a link with a built-in signature and expiry that only works for whoever was given it, for a limited time.
  • Spidering: letting a tool crawl a site automatically and collect every link and file it can reach.
  • Subdomain: a smaller address under a company's main address, such as images.example.com under example.com.
  • Wappalyzer: a browser extension that reports which technologies a website uses.
  • Web application firewall: a filter placed in front of a website that inspects and blocks suspicious requests.

More by Muhammad Asim Shahzad

View all

6 more disclosed reports, best first.

More from Dropbox

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.