When File Uploads Go Wrong: Stored XSS Through Public Cloud Stora
An uploaded document was stored on a public cloud storage endpoint and served directly, so an embedded script ran in the browser whenever the file was opened. Because the file was reachable by direct public link without authentication, anyone given the link could trigger the payload.
Published on medium.com
Create an account. Log in.
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application accepted uploaded files without validating their content and served them from a public cloud storage endpoint that returns them in a way the browser executes embedded script.
Impact
The stored script could run for anyone who opened the public link, and because the file sat on trusted cloud infrastructure it could be shared as a legitimate-looking document.
What the attacker needed
A free account; ability to upload a document; victim opens the shared link
The fix
The upload should validate file content rather than relying on extensions, and stored files should be served safely from the application rather than as executable content from public storage.
How it was found
- Create an account and log in to the application.
- Fill out the required details and upload a supporting document.
- Upload a crafted file containing an embedded script instead of a normal document.
- Open the uploaded file and observe the script executing from the cloud-hosted URL.
- Copy the cloud URL and open it in a private browsing window to confirm it works without a session.
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 write-up has not been written yet. The Original tab links to the source.
When you upload a file to a website, the site usually saves it somewhere and gives you a link to open it later. Here the site saved the file on public cloud storage and served it straight to the browser, so a script hidden inside the file ran when the file was opened. That means a file that looks like a normal document can run code in the viewer's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.