P4 Anonymous S3 Bucket Object Listing Leading to Cloud Storage Information Disclosure
An Amazon S3 bucket allowed unauthenticated users to list its objects via the ListBucket API, exposing object names, directory prefixes, metadata, and the bucket owner's canonical identifier. An attacker could enumerate the storage namespace, though the exposed objects were primarily public documentation and no sensitive data was found.
Published on medium.com
Bug Bounty
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 write-up covers an Amazon S3 bucket associated with an application that allowed unauthenticated users to list its contents. The bucket was used to store downloadable material: documentation, PDF files, CSS resources, regional documents and product-related downloads. The exposed objects were primarily publicly intended material, but the bucket allowed anyone on the internet to enumerate it.
The issue was found during external security testing. The researcher classifies it as P4 (Low), a misconfigured cloud storage / information disclosure issue. The Bugcrowd VRT entry is Server Security Misconfiguration, Misconfigured S3 Bucket, Readable/Listable Bucket. The CWE references given are CWE-548 (Exposure of Information Through Directory Listing), CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) and CWE-668 (Exposure of Resource to Wrong Sphere). CVSS v3.1 is 3.7 (Low), with the vector written in the report as AV/AC/PR/UI/S/C/I/A.
The affected component is Amazon S3 object storage, specifically the anonymous object listing functionality, with no authentication required. The permission involved is s3:ListBucket.
Setup
The testing needed only a Linux environment (Kali Linux recommended), curl, and optionally xmllint to format XML responses. No AWS account, credentials or authenticated session were required at any point, which is the whole point of the finding.
The required utility was installed with:
sudo apt updatesudo apt install curl libxml2-utils -y
Finding it
What made the bucket interesting was that a request to its root endpoint, with no credentials at all, returned a successful response. The bucket accepted an unauthenticated ListBucket call and answered with an XML ListBucketResult document. That is not how a bucket that only serves public downloads should behave: serving individual objects publicly does not require letting anyone enumerate the namespace.
Exploitation
Step 1: Check anonymous access to the storage endpoint
An unauthenticated HTTP request was sent to the storage endpoint:
curl -sS -i "https://<affected-storage-host>/?list-type=2"
The -i flag includes the response headers, and list-type=2 selects the ListObjectsV2 API. The server responded successfully without requiring AWS credentials or an authenticated session.
Step 2: Retrieve the anonymous object listing
The listing was then fetched and formatted:
curl -sS "https://<affected-storage-host>/?list-type=2" | xmllint
The response contains an S3 ListBucketResult structure with information about the available objects.
Step 3: Examine the exposed storage information
The XML response was reviewed for the following fields:
- Object keys and filenames.
- Directory prefixes.
- Last-modified timestamps.
- Object sizes.
- ETags.
- Storage class information.
- Bucket owner canonical identifier.
The response demonstrates that an unauthenticated user can enumerate the storage bucket's object namespace. The bucket returned up to 1,000 object keys in a single response.
Step 4: Verify object-listing pagination
The XML response was inspected for these fields:
<IsTruncated>true</IsTruncated><NextContinuationToken>...</NextContinuationToken>
When the response indicates that more objects are available, the listing can be continued with the returned continuation token:
curl -sS "https://<affected-storage-host>/?list-type=2&continuation-[redacted]"
This allows additional object keys to be enumerated without authentication, so the full namespace can be walked page by page.
Step 5: Review the exposed object inventory
The returned object keys were inspected to identify the types of resources exposed. During the assessment the listing included documentation directories, PDF documents, CSS resources, regional documents and product-related downloadable files.
No sensitive credentials, customer records, database backups or private signing materials were identified in the reviewed object inventory.
Root cause
The root cause is an overly permissive Amazon S3 bucket access policy or access-control configuration. The bucket permits anonymous principals to execute the s3:ListBucket operation, which lets external users enumerate stored object keys without authentication.
Public access to individual downloadable files, where required for business purposes, should not automatically grant anonymous users permission to enumerate the entire bucket. The two permissions are separate, and public access to files should not grant anonymous listing.
Impact
The vulnerability allows unauthenticated external users to enumerate the contents of the cloud storage bucket. The report lists these implications:
- Storage namespace disclosure. An attacker can identify the names and directory structure of stored objects without authentication.
- Infrastructure information disclosure. The exposed inventory may reveal internal naming conventions, resource organisation, documentation structures and storage patterns.
- Increased reconnaissance capabilities. An attacker can use the discovered object keys to identify interesting resources and understand how the application's downloadable content is organised.
- Future exposure risk. If sensitive files are accidentally uploaded to the publicly listable bucket later, their filenames and locations could become discoverable by external users.
- Unnecessary cloud resource exposure. Anonymous enumeration of the complete object namespace exposes storage metadata that may not need to be publicly accessible.
The report is explicit about the limit: the enumerated content was primarily public download material, and no confirmed exposure of sensitive customer data, credentials or confidential backups was identified. Direct data compromise is therefore not claimed.
Fix
The report recommends the following remediation measures:
- Remove anonymous
s3:ListBucketpermissions from the affected bucket. - Review the bucket policy and access-control lists for unintended public permissions.
- Enable Amazon S3 Block Public Access wherever public access is not required.
- If public downloads are necessary, permit access to specific objects without allowing anonymous bucket listing.
- Consider serving public resources through CloudFront with Origin Access Control.
- Restrict direct access to the underlying S3 bucket where appropriate.
- Review existing object permissions to ensure confidential resources are not publicly accessible.
- Periodically audit bucket policies and permissions to prevent accidental exposure.
Variants to test
What happened, in plain words
A company stored its public download files in a cloud storage service called Amazon S3. Think of S3 as a very large online filing cabinet: you create a "bucket" (a folder at the top level) and put files (called "objects") inside it. The company wanted anyone to be able to download those files, which is fine. But the bucket was also set up so that anyone on the internet could ask it for a complete list of everything inside it, without logging in, without an account, without a password. That is like a shop that lets anyone buy a poster from the window, but also leaves the full stock inventory taped to the door for anyone to read.
The researcher found this during external security testing, meaning testing done from outside the company, over the internet, with no special access. The finding is rated P4 (Low): a real problem, but a small one. The files that could be listed were mostly public material anyway. No passwords, customer records, database backups or private signing keys were found in the listing.
This article walks through the same steps the researcher took, explaining every term from scratch. You only need to be able to use a computer and a browser to follow along.
The classification, explained
Before the steps, the report gives a set of labels that security teams use to describe a finding. Here is what each one means.
- Severity P4 (Low). Bug bounty programmes rank findings by how much damage they could cause. P4 is the lowest tier that still counts as a valid issue. It is worth reporting, but it is not an emergency.
- Vulnerability type: misconfigured cloud storage / information disclosure. "Misconfigured" means a setting was left in a state that was not intended. "Information disclosure" means information that should have stayed private (or at least not been easy to collect) can be seen by outsiders.
- Bugcrowd VRT: Server Security Misconfiguration, Misconfigured S3 Bucket, Readable/Listable Bucket. Bugcrowd is a bug bounty platform. Its Vulnerability Rating Taxonomy (VRT) is a shared catalogue of issue types, so that a report filed by one researcher and read by another company uses the same vocabulary. This entry says: a server-side setting is wrong, specifically an S3 bucket, specifically one whose contents can be read or listed.
- CWE-548, CWE-200, CWE-668. CWE stands for Common Weakness Enumeration: a public dictionary of weakness types, each with a number. CWE-548 is exposure of information through directory listing (the same idea as a web server showing a folder's file list). CWE-200 is exposure of sensitive information to someone who should not have it. CWE-668 is exposure of a resource to the wrong audience.
- CVSS v3.1: 3.7 (Low). CVSS is the Common Vulnerability Scoring System, a standard 0 to 10 score for how serious a flaw is. 3.7 falls in the Low band. The report writes the vector as
AV/AC/PR/UI/S/C/I/A, which is the shorthand list of the factors that feed the score.
The affected part of the system
The report names the component as Amazon S3 cloud storage, the functionality as anonymous object listing, and states that no authentication is required. "Authentication" means proving who you are, usually with a username and password or a key. "Anonymous" means the request carries no identity at all.
The permission involved is s3:ListBucket. In S3, permissions are named actions. s3:GetObject means "read one file". s3:ListBucket means "show me what is in this bucket". These are separate switches, and the whole finding comes down to the second switch being left on for everyone.
Setting up the tools
The researcher used a Linux environment (Kali Linux recommended, a Linux distribution built for security testing), the command-line tool curl, and optionally xmllint to make XML output readable. No AWS account, credentials or logged-in session was needed at any point, which is exactly the point of the finding.
The tools were installed with:
sudo apt updatesudo apt install curl libxml2-utils -y
Line by line:
sudoruns the rest of the command with administrator rights, because installing software changes the system.apt updaterefreshes the list of available software packages from the distribution's servers.apt install curl libxml2-utils -yinstalls two packages:curl, the tool that sends web requests from the terminal, andlibxml2-utils, the package that containsxmllint. The-yanswers "yes" automatically to the confirmation prompt.- The two commands appear run together on one line in the report; in practice they are two separate commands.
If you have never used a terminal: it is a text window where you type commands instead of clicking buttons. curl is the terminal equivalent of typing a web address into your browser and pressing Enter, except it shows you the raw reply rather than a rendered page.
Finding it
What made the bucket interesting was simple: a request to its root address, with no credentials at all, came back successful. The bucket accepted an unauthenticated ListBucket call and answered with an XML document called ListBucketResult. XML is a text format for structured data, using tags in angle brackets, a bit like a very strict outline.
That is not how a bucket that only serves public downloads should behave. Letting people download individual files does not require letting them see the full inventory. The two are separate permissions, and public access to files should not grant anonymous listing.
Step 1: Check anonymous access to the storage endpoint
An unauthenticated HTTP request was sent to the storage endpoint:
curl -sS -i "https://<affected-storage-host>/?list-type=2"
Line by line:
curlis the tool sending the request.-sScombines two options:-ssilences the progress meter so the output stays clean, and-Sstill shows error messages if something fails. Without-S, a silent failure would look like an empty success.-iincludes the response headers in the output. Headers are the small block of metadata at the top of every web reply: the status code, content type and so on. Seeing them is how you confirm the server answered successfully rather than with an error.- The address in quotes is the bucket's root, with
?list-type=2added. The part after?is a query parameter: extra instructions sent along with the request.list-type=2selects the newer version of the listing feature, called ListObjectsV2. The placeholder<affected-storage-host>stands in for the real bucket address, which is not published in the report.
The server responded successfully without requiring AWS credentials or an authenticated session. In other words, no login, no key, no cookie, nothing.
Step 2: Retrieve the anonymous object listing
The listing was then fetched and formatted:
curl -sS "https://<affected-storage-host>/?list-type=2" | xmllint
Line by line:
- This is the same request as before, minus
-i, so only the body of the reply is printed, not the headers. - The
|symbol is a pipe. It takes the output of the command on its left and feeds it as input to the command on its right, like passing a document from one person to the next. xmllintreads XML and prints it neatly indented. Raw XML often arrives as one long line, which is hard to read;xmllintmakes the structure visible.
The response contains an S3 ListBucketResult structure with information about the available objects. ListBucketResult is simply the name of the outer tag S3 uses when it answers a listing request.
Step 3: Examine the exposed storage information
The XML response was reviewed for the following fields:
- Object keys and filenames. An object key is the full name of a file inside the bucket, including its folder path, for example
docs/guide.pdf. It is the file's address within the bucket. - Directory prefixes. S3 has no real folders; it fakes them with prefixes in the key.
docs/at the start of many keys acts like a folder called docs. - Last-modified timestamps. When each file was last changed. This hints at how actively the bucket is maintained.
- Object sizes. How large each file is.
- ETags. A short fingerprint of a file's contents, used to tell whether two versions differ.
- Storage class information. Which S3 storage tier the file sits in, which can hint at how important or how rarely used it is.
- Bucket owner canonical identifier. An ID for the AWS account that owns the bucket.
The response demonstrates that an unauthenticated user can enumerate the storage bucket's object namespace. "Enumerate" means to list out one by one; the "namespace" is the full set of names. The bucket returned up to 1,000 object keys in a single response.
Step 4: Verify object-listing pagination
Because a reply is capped at 1,000 keys, S3 needs a way to hand out the rest. That mechanism is called pagination: splitting a long list into pages. The XML response was inspected for these fields:
<IsTruncated>true</IsTruncated><NextContinuationToken>...</NextContinuationToken>
Line by line:
<IsTruncated>true</IsTruncated>is a tag pair saying "this list was cut short, there is more".truemeans yes, more remains;falsewould mean you have seen everything.<NextContinuationToken>...</NextContinuationToken>holds a token: a short string the server gives you so you can ask for the next page. Think of it as a bookmark the librarian hands you so you can find where you stopped. The...stands for the actual value, which is not reproduced in the report.
When the response indicates that more objects are available, the listing can be continued with the returned continuation token:
curl -sS "https://<affected-storage-host>/?list-type=2&continuation-[redacted]"
Line by line:
- Same request as before, with a second query parameter added.
&separates query parameters, so the server receives bothlist-type=2and `continuation-[redacted]<TOKEN>is a placeholder for the value copied out of the previous reply'sNextContinuationTokentag.
This allows additional object keys to be enumerated without authentication, so the full namespace can be walked page by page. Each reply hands you the bookmark for the next one, and nothing along the way asks who you are.
Step 5: Review the exposed object inventory
The returned object keys were inspected to identify the types of resources exposed. During the assessment the listing included documentation directories, PDF documents, CSS resources, regional documents and product-related downloadable files. CSS is the styling language that controls how web pages look; a CSS file in a bucket is a normal part of a website's assets.
No sensitive credentials, customer records, database backups or private signing materials were identified in the reviewed object inventory. Credentials are things like passwords and API keys; signing materials are the cryptographic keys used to prove that software or documents are genuine. Finding none of these is why the report does not claim any data was actually compromised.
Why this matters (impact)
The vulnerability allows unauthenticated external users to enumerate the contents of the cloud storage bucket. The report lists these implications:
- Storage namespace disclosure. An attacker can identify the names and directory structure of stored objects without authentication. Knowing the names is often the first step to guessing what else might exist.
- Infrastructure information disclosure. The exposed inventory may reveal internal naming conventions, resource organisation, documentation structures and storage patterns. Naming habits are clues: a folder called
internal-draftstells you something even if you cannot open it. - Increased reconnaissance capabilities. Reconnaissance means surveying a target before attacking. An attacker can use the discovered object keys to identify interesting resources and understand how the application's downloadable content is organised, then focus effort where it pays off.
- Future exposure risk. If sensitive files are accidentally uploaded to the publicly listable bucket later, their filenames and locations could become discoverable by external users. The listing would announce the mistake for them.
- Unnecessary cloud resource exposure. Anonymous enumeration of the complete object namespace exposes storage metadata that may not need to be publicly accessible. Metadata is data about the data: names, sizes, dates, not the contents themselves.
The report is explicit about the limit: the enumerated content was primarily public download material, and no confirmed exposure of sensitive customer data, credentials or confidential backups was identified. Direct data compromise is therefore not claimed. In plain terms: the door was unlocked, but as far as the researcher could see, nothing valuable was behind it this time.
Root cause
The root cause is an overly permissive Amazon S3 bucket access policy or access-control configuration. A bucket policy is a set of rules saying who may do what; "permissive" means it allows more than it should. The bucket permits anonymous principals to execute the s3:ListBucket operation. A "principal" in these rules is the identity making the request, and "anonymous" means no identity at all.
Public access to individual downloadable files, where required for business purposes, should not automatically grant anonymous users permission to enumerate the entire bucket. The two permissions are separate, and public access to files should not grant anonymous listing. The everyday comparison: a museum can let visitors view a painting without handing them the storage-room inventory.
Fix
The report recommends the following remediation measures:
- Remove anonymous
s3:ListBucketpermissions from the affected bucket. Turn the listing switch off for the public. - Review the bucket policy and access-control lists for unintended public permissions. Access-control lists (ACLs) are an older, per-file way of granting access; both places need checking.
- Enable Amazon S3 Block Public Access wherever public access is not required. This is an AWS feature that overrides public permissions, a safety catch for buckets that should never be public.
- If public downloads are necessary, permit access to specific objects without allowing anonymous bucket listing. Let people fetch the file they were given the address for, not browse the shelf.
- Consider serving public resources through CloudFront with Origin Access Control. CloudFront is Amazon's content delivery network (CDN): a worldwide set of servers that serve files close to the visitor. Origin Access Control makes the CDN the only route to the bucket, so the bucket itself refuses direct visitors.
- Restrict direct access to the underlying S3 bucket where appropriate.
- Review existing object permissions to ensure confidential resources are not publicly accessible.
- Periodically audit bucket policies and permissions to prevent accidental exposure. An audit is a scheduled check, so a setting changed by mistake does not stay wrong for months.
Variants to test
200is the HTTP status code for success;AccessDeniedis the error S3 returns when the listing is properly blocked.- An API is the set of requests a service accepts; the old and new listing features are two doors into the same room.
- It is like asking the librarian for only the books whose titles start with a given word.
- The
*is a wildcard meaning "everyone".
Glossary
- Access-control list (ACL): an older S3 mechanism that grants permissions per file or per bucket, separate from the bucket policy.
- Anonymous: making a request with no identity, account or credentials attached.
- API: the defined set of requests a service accepts, and the format of its replies.
- Authentication: proving who you are, typically with a password, key or session.
- Bucket: the top-level container in Amazon S3 that holds files.
- Bucket policy: a set of rules in S3 stating which identities may perform which actions on a bucket.
- Bugcrowd VRT: a shared catalogue of vulnerability types maintained by the Bugcrowd bug bounty platform.
- CDN (content delivery network): a worldwide network of servers that delivers files to visitors from a location near them.
- CloudFront: Amazon's content delivery network service.
- Continuation token: a short string returned by S3 that lets you request the next page of a long listing.
- Credential: a secret that proves identity, such as a password or API key.
- CSS: the language that controls how web pages look; a common type of website asset.
- curl: a command-line tool for sending HTTP requests and showing the raw replies.
- CWE: Common Weakness Enumeration, a public numbered dictionary of weakness types.
- CVSS: Common Vulnerability Scoring System, a standard 0 to 10 severity score for a flaw.
- Enumerate: to list items out one by one.
- ETag: a short fingerprint of a file's contents, used to tell versions apart.
- HTTP status code: the number at the top of a web reply, such as 200 for success or an error code for failure.
- Information disclosure: a flaw where information outsiders should not easily see becomes visible to them.
- Kali Linux: a Linux distribution packaged with security testing tools.
- ListBucket: the S3 permission that allows listing what is inside a bucket.
- ListBucketResult: the XML document S3 returns when it answers a listing request.
- ListObjectsV2: the newer version of the S3 listing feature, selected with
list-type=2. - Metadata: data about data, such as file names, sizes and dates rather than contents.
- Misconfiguration: a setting left in a state that was not intended.
- Namespace: the full set of names in a system, here every object key in a bucket.
- Object: a single file stored in an S3 bucket.
- Object key: the full name of an object inside a bucket, including its folder-like prefix.
- Origin Access Control: an AWS feature that lets only a CloudFront distribution reach a bucket.
- P4: the lowest severity tier that still counts as a valid bug bounty finding.
- Pagination: splitting a long list into pages, with a token to move to the next one.
- Permission: a named allowance to perform an action, such as
s3:ListBucket. - Prefix: the leading part of an object key that acts like a folder name.
- Principal: the identity making a request in an access rule;
*means everyone. - Query parameter: an extra instruction appended to a URL after
?, separated by&. - Reconnaissance: surveying a target to learn about it before attacking.
- Remediation: the fix for a vulnerability.
- S3: Amazon Simple Storage Service, a cloud file storage service.
- Severity: how serious a finding is, often expressed as a tier or a CVSS score.
- Signing material: cryptographic keys used to prove that software or documents are genuine.
- Storage class: the S3 tier a file is stored in, which affects cost and access speed.
- Terminal: a text window where you type commands instead of clicking.
- Token: a short string a server gives you to carry state between requests, such as a bookmark for the next page.
- XML: a text format for structured data using tags in angle brackets.
- xmllint: a command-line tool that reads and neatly formats XML.