From Finding AWS S3 Bucket to Sensitive Data Exposure
An AWS S3 bucket used by a helpdesk app had public read access, exposing private presentation documents, sticky notes, pins and pictures from all organisations. An attacker could list and download these files, which were meant to be private and scoped per organisation.
How reading a page's source led to an open S3 bucket leaking private files across every organization.
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
The target was a helpdesk application with a broad set of workplace features: hiring new employees, assigning tasks, preparing presentations and so on. The researcher spent time first understanding what the app did and how it worked, then tested each feature one by one.
The feature that mattered here was presentation preparation. An employee can practise and prepare a presentation, upload documents such as slides or PDFs, and attach sticky notes that stay private to them. They can also deliver the presentation from the same place: pressing start shows only their slides or PDFs to others, while the notes remain private. The whole section is private, and files are scoped per organisation, so a file uploaded in one organisation should never be reachable by a user in another.
Setup
No special accounts, roles or tool versions are described. The researcher browsed the application and read page source, then switched to the AWS CLI to inspect the bucket. The presentation feature loaded slides through an iframe, and the bucket behind it turned out to be publicly listable.
Finding it
While going through the page source, the researcher noticed that the app loaded the slides in an iframe. The URL looked something like this:
iframe srchttps://cdn.example.com/document/view.html?id=91929&pages=1&s3=bucket-name-us-east-1
Several parameters stood out. Opening the URL in a new tab returned a blank white page. The researcher focused on the id parameter and swapped it for another document id to see whether someone else's document could be reached, but it returned the same blank page. At that point the s3 parameter had still not drawn attention.
Opening the source of that page revealed an interesting line of JavaScript:
page source"canonical_url" : "https://bucket-name-us-east-1." + s3.amazonaws.com + "/document/" + ID + "/result.pdf",
That line ties the s3 parameter to an S3 hostname and builds an object path from the document ID. Piecing the endpoint together with an ID value gave:
object urlhttps://bucket-name.us-east-1.s3.amazonaws.com/document/12345/result.pdf
Opening that returned a NoSuchKey error. Opening the bucket root instead greeted the researcher with a public listing. The first file was Admin_audit.zip. It looked like a goldmine, but after downloading and unzipping it there was nothing sensitive inside.
Exploitation
Step 1: Confirm the bucket is publicly listable
Requesting the bucket root in the browser returned a public listing rather than an access denied error. The bucket root returned a public listing of its contents.
Step 2: Enumerate with the AWS CLI
The browser view of the bucket is confusing, so the researcher switched to the AWS CLI for a proper look:
aws s3 ls s3://bucket-name/
It returned six directories. The first, Admin_reports, held the audit file already seen, with nothing sensitive. The others, Documents, Notes, Pins and Pictures, were a different story.
Step 3: Read the exposed directories
The Documents directory held every presentation file users had uploaded. Those files were supposed to stay private until the user started their presentation, and even then they should never cross organisation boundaries. In the bucket, files from every organisation were exposed together. Notes held the private sticky notes of users across all organisations, and Pins and Pictures leaked private data too. The one saving grace was that the bucket had no public write access.
Root cause
The bucket allowed public listing, and its directories held files from every organisation together. The application itself enforced privacy and per-organisation scoping, but the storage layer did not: the iframe and the JavaScript canonical_url construction exposed the bucket name and the object path scheme, and anyone who reached the bucket root could list and download the objects directly. The report does not describe the bucket policy or ACLs, so the exact configuration mistake is not stated;
Impact
An attacker who finds the bucket can list it anonymously and download files across every organisation: uploaded presentation documents, private sticky notes, and the contents of Pins and Pictures. This breaks both the privacy of individual users and the per-organisation isolation the feature promises. The bucket had no public write access, so the exposure is read-only; the report does not describe any modification or deletion of objects.
Fix
The fix implied by the finding is to remove public listing from the bucket and restrict object access so that files are only served through the application's own authorisation checks, keeping per-organisation scoping intact.
Variants to test
- Read the page source of any feature that renders documents, slides or media in an iframe or a viewer. Look for bucket names, CDN hostnames and object path patterns in inline JavaScript. A positive result is a hostname or path template that maps directly to an S3 object URL.
- Request the bucket root directly, for example
https://bucket-name.s3.amazonaws.com/. A positive result is an XML listing of keys instead ofAccessDenied. - Run
aws s3 ls s3://bucket-name/against a bucket you have identified. A positive result is a list of prefixes or objects returned without credentials. - Try a known object path built from an ID you control, such as
/document/<id>/result.pdf. ANoSuchKeyerror still confirms the bucket exists and the path scheme is right, which is enough to justify listing the root. - Check whether the bucket allows writes as well as reads, since read-only exposure was the only limit here. A positive result is an upload or delete succeeding anonymously, which would raise the impact considerably.
What happened, in plain words
A security researcher was testing a helpdesk application, a piece of software that companies use to manage internal work: hiring new employees, assigning tasks, preparing presentations and so on. While reading the source code of one of its pages, they noticed a reference to an Amazon S3 bucket. An S3 bucket is a storage container in Amazon's cloud, a bit like a shared folder on a network drive, except it lives on the internet. This particular bucket had been left open so that anyone could list its contents, and inside were private files belonging to every organisation that used the app: uploaded presentations, private sticky notes, and more.
The researcher found the bucket by reading the page source, confirmed it was open, then used a command-line tool to look inside it properly. The bucket allowed anyone to list its contents, and it had no public write access. The report does not say how the problem was fixed.
Background: what the app was and how it was tested
The target was a helpdesk application with a broad set of workplace features: hiring new employees, assigning tasks, preparing presentations and so on. Before testing anything, the researcher spent time simply understanding what the app did and how it worked, then tested each feature one by one. That order matters: you cannot spot something unusual in a feature until you know what normal looks like.
The feature that mattered here was presentation preparation. An employee can practise and prepare a presentation, upload documents such as slides or PDFs, and attach sticky notes that stay private to them. They can also deliver the presentation from the same place: pressing start shows only their slides or PDFs to others, while the notes remain private. The whole section is private, and files are scoped per organisation, so a file uploaded in one organisation should never be reachable by a user in another.
Two ideas in that paragraph are worth spelling out for a newcomer:
- Private means only the person who created the content is supposed to see it. The sticky notes are the clearest example: they are the presenter's own reminders, not part of the slides.
- Scoped per organisation means the app is multi-tenant. One company (a tenant) shares the same application with many other companies, and the software is supposed to keep each company's data separate, like separate flats in one building with different keys. A file uploaded in one organisation should never be reachable by a user in another.
No special accounts, roles or tool versions are described. The researcher browsed the application and read page source, then switched to the AWS CLI to inspect the bucket. The presentation feature loaded slides through an iframe, and the bucket behind it turned out to be publicly listable. An iframe is a small window embedded inside a web page that shows content from another address, like a picture frame hanging on a wall. A CDN host (content delivery network) is a server whose job is to hand out files such as images, scripts and documents quickly to many users.
Finding it
While going through the page source, the researcher noticed that the app loaded the slides in an iframe. Page source is the raw text a browser receives before it draws the page: HTML, JavaScript and links. You can see it in any browser with a right-click and an option such as "View page source". Reading it is one of the cheapest ways to learn how a site is put together, because it shows addresses and parameters the visible page hides.
The URL looked something like this:
iframe srchttps://cdn.example.com/document/view.html?id=91929&pages=1&s3=bucket-name-us-east-1
Line by line, in plain words:
iframe srcis the start of an iframe tag and the address it should load. The text as captured runs the tag and the address together (srchttps), which is how it appeared in the source the researcher was reading.https://cdn.example.com/document/view.htmlis the address of a small viewer page on a content delivery host.example.comis a placeholder domain used in documentation, not the real one.?id=91929starts the query string, the part of a URL after the question mark that carries extra values. Hereidis the identifier of one particular document.&pages=1is a second value, joined with&, apparently telling the viewer how many pages to show.&s3=bucket-name-us-east-1is a third value whose name,s3, hints at Amazon S3 storage, and whose value looks like a bucket name plus a region.
Several parameters stood out. Opening the URL in a new tab returned a blank white page. The researcher focused on the id parameter and swapped it for another document id to see whether someone else's document could be reached, but it returned the same blank page. The reasoning behind that step is the classic test for what is often called an insecure direct object reference: if a page shows a document based on a number in the URL, change the number and see whether you get someone else's document. Here the viewer page gave nothing back either way, so the id parameter was a dead end. At that point the s3 parameter had still not drawn attention.
Opening the source of that page revealed an interesting line of JavaScript:
page source"canonical_url" : "https://bucket-name-us-east-1." + s3.amazonaws.com + "/document/" + ID + "/result.pdf",
Line by line, in plain words:
page sourceis the researcher's label for where the line was found, followed by the line itself."canonical_url"is the name of a setting, meaning the official address of something."https://bucket-name-us-east-1." + s3.amazonaws.com + "/document/" + ID + "/result.pdf"builds an address by gluing pieces of text together with+. The first piece is a hostname prefix, the second is the rest of the S3 hostname, then a fixed path segmentdocument, then the value of a variable calledID, then the file nameresult.pdf.
That line ties the s3 parameter to an S3 hostname and builds an object path from the document ID. In other words, the viewer page was quietly telling the browser where the real file lived: not on the CDN, but in an S3 bucket. S3 is Amazon's object storage service; an object is a single file stored in a bucket, and its key is its name or path inside the bucket. Piecing the endpoint together with an ID value gave:
object urlhttps://bucket-name.us-east-1.s3.amazonaws.com/document/12345/result.pdf
Line by line, in plain words:
object urlis the researcher's label for the address that was assembled.https://bucket-name.us-east-1.s3.amazonaws.comis the address of the bucket itself. The bucket name comes first, then the region (us-east-1), then the S3 service hostname./document/12345/result.pdfis the path of one object inside the bucket: a folder calleddocument, a folder named after the document ID12345, and a file calledresult.pdf.
Opening that returned a NoSuchKey error. That error is S3's way of saying there is no object with that name. It is still useful information: the bucket name and path scheme were worth trying further. Opening the bucket root instead greeted the researcher with a public listing. The first file was Admin_audit.zip. It looked like a goldmine, but after downloading and unzipping it there was nothing sensitive inside.
A public listing means the bucket answers anyone who asks "what is in here?" with a list of file names, without requiring a login. That is the misconfiguration at the heart of this report: the bucket root returned a public listing of its contents. Credentials here means any proof of identity, such as a username and password or an access key.
Exploitation
Step 1: Confirm the bucket is publicly listable
Requesting the bucket root in the browser returned a public listing rather than an access denied error. The bucket root is simply the bucket's own address with no file path after it. Normally a private bucket replies with an error saying access is denied; this one replied with a list of contents. That single observation is the finding.
Step 2: Enumerate with the AWS CLI
The browser view of the bucket is confusing, so the researcher switched to the AWS CLI for a proper look. The AWS CLI is Amazon's command-line tool: a program you run in a terminal window by typing commands instead of clicking. Enumerate means to list things one by one, in this case the folders and files in the bucket.
aws s3 ls s3://bucket-name/
Line by line, in plain words:
awsis the name of the command-line program.s3says which part of Amazon's services you want to talk to, here the storage service.lsmeans list, the same idea as thelscommand on Linux ordiron Windows.s3://bucket-name/is the address of the bucket in the CLI's own notation, withs3://instead ofhttps://and the bucket name after it. The trailing slash means the top level of the bucket.
It returned six directories. The first, Admin_reports, held the audit file already seen, with nothing sensitive. The others, Documents, Notes, Pins and Pictures, were a different story.
Step 3: Read the exposed directories
The Documents directory held every presentation file users had uploaded. Those files were supposed to stay private until the user started their presentation, and even then they should never cross organisation boundaries. In the bucket, files from every organisation were exposed together. Notes held the private sticky notes of users across all organisations, and Pins and Pictures leaked private data too. The one saving grace was that the bucket had no public write access.
Write access means permission to add, change or delete files. Because the bucket was read-only to the public, a stranger could download everything but could not tamper with it. That limits the damage, but it does not make the exposure harmless: the private notes and documents of every customer were still readable by anyone who found the bucket.
Why it happened
The bucket allowed public listing, and its directories held files from every organisation together. A namespace here just means one flat space of file names: all customers' files sat side by side in the same folders, with nothing separating one company's files from another's. The application itself enforced privacy and per-organisation scoping, but the storage layer did not: the iframe and the JavaScript canonical_url construction exposed the bucket name and the object path scheme, and anyone who reached the bucket root could list and download the objects directly. The report does not describe the bucket policy or ACLs, so the exact configuration mistake is not stated;
A useful comparison: the app was like a receptionist who checks your name before letting you into a room, while the bucket was the room's back door standing wide open. The checks existed, but they were on the wrong side of the door.
What the impact was
An attacker who finds the bucket can list it anonymously and download files across every organisation: uploaded presentation documents, private sticky notes, and the contents of Pins and Pictures. This breaks both the privacy of individual users and the per-organisation isolation the feature promises.
How it should be fixed
The fix implied by the finding is to remove public listing from the bucket and restrict object access so that files are only served through the application's own authorisation checks, keeping per-organisation scoping intact. In everyday terms: close the back door, and make everyone come through the receptionist.
Other places to look for the same mistake
These are the same checks applied to other features and other buckets:
- Read the page source of any feature that renders documents, slides or media in an iframe or a viewer. Look for bucket names, CDN hostnames and object path patterns in inline JavaScript. A positive result is a hostname or path template that maps directly to an S3 object URL.
- Request the bucket root directly, for example
https://bucket-name.s3.amazonaws.com/. A positive result is an XML listing of keys instead ofAccessDenied. - Run
aws s3 ls s3://bucket-name/against a bucket you have identified. A positive result is a list of prefixes or objects returned without credentials. - Try a known object path built from an ID you control, such as
/document/<id>/result.pdf. ANoSuchKeyerror still confirms the bucket exists and the path scheme is right, which is enough to justify listing the root. - Check whether the bucket allows writes as well as reads, since read-only exposure was the only limit here. A positive result is an upload or delete succeeding anonymously, which would raise the impact considerably.
Glossary
- Access control: the rules that decide who is allowed to see or change which data.
- ACL: access control list, a per-file or per-bucket list of who is allowed to do what.
- Anonymous: without logging in or presenting any credentials.
- AWS CLI: Amazon's command-line tool, run in a terminal to manage Amazon services.
- Bucket: a storage container in Amazon S3, similar to a shared folder on the internet.
- CDN host: a content delivery network server that hands out files such as images, scripts and documents quickly.
- Credentials: proof of identity, such as a username and password or an access key.
- Enumerate: to list items one by one, here the folders and files in a bucket.
- Iframe: a small window embedded in a web page that shows content from another address.
- JavaScript: the programming language browsers run to make pages interactive; its code is visible in page source.
- Key: the name or path of a single object inside an S3 bucket.
- Misconfiguration: a setting left in a state that exposes something it should not, usually by mistake rather than by a flaw in the code.
- Multi-tenant: one application shared by many separate customers, each of which should only see its own data.
- Namespace: a single flat space of names, here the set of file paths inside the bucket.
- NoSuchKey: the S3 error meaning the bucket exists but no object has that name.
- Object: a single file stored in an S3 bucket.
- Object URL: the web address that points directly at one object in a bucket.
- Organisation: one customer company using the application; files are supposed to be scoped to it.
- Page source: the raw HTML, JavaScript and links a browser receives before drawing a page.
- Parameter: a named value in a URL, after the
?, such asid=91929. - Public listing: a bucket setting that lets anyone see the names of the files inside without logging in.
- Query string: the part of a URL after the question mark that carries parameters.
- Region: the geographic area where Amazon runs a service, such as
us-east-1. - S3: Amazon Simple Storage Service, Amazon's object storage service.
- Scoped per organisation: data belonging to one customer is kept separate from every other customer's data.
- Sticky notes: private reminders a presenter attaches to their own presentation.
- Write access: permission to add, change or delete files.