Unauthenticated File Upload via Public API to AWS S3 — Write u
The upload API that generates presigned S3 URLs did not require authentication, so an unauthenticated client could obtain temporary upload authorisation. An attacker could then upload files to application-controlled S3 storage, potentially abusing storage resources and hosting unwanted content.
Published on samiullahsaleem.medium.com
While testing the profile functionality of a web application, I logged into my account and uploaded a profile picture.
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 upload endpoint lacked an authentication and authorisation check before generating presigned S3 URLs.
Impact
An unauthenticated attacker could potentially upload unauthorised files to application-controlled storage, consume storage capacity, generate unexpected cloud costs, and host unwanted content on trusted infrastructure; the exact impact depends on the restrictions on the presigned URL.
What the attacker needed
None
The fix
The upload endpoint should require authentication and authorisation before generating presigned URLs, generate object keys server-side, and restrict presigned URLs to minimum permissions and short expiry.
How it was found
- Log in and upload a profile picture while inspecting the network traffic.
- Observe the application API request that returns a presigned S3 URL.
- Remove the authenticated session information and repeat the upload-URL request.
- Note that the endpoint still returns the information needed to upload to S3.
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 profile picture, the app asks its server for a temporary link that lets your browser put the file into cloud storage. This report found that the server handed out those temporary links even to people who were not logged in. That means anyone could use the app's storage space without having an account.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.