S3 Me Rolling: How an Exposed Bucket Gave Me Source Code, Secrets
An S3 bucket was publicly listable and writable, exposing environment files, source code, and credentials. The attacker used a leaked API key to obtain an admin JWT and access user PII.
Free Link🎈
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 S3 bucket was configured with public read and write permissions, allowing anyone to list, download, and upload files.
Impact
The attacker could read sensitive files, obtain an admin token, and access user PII including names, emails, phone numbers, and transaction history.
What the attacker needed
Publicly accessible S3 bucket; No authentication needed
The fix
The bucket should be configured to block public access and allow only necessary permissions.
How it was found
- Enumerate subdomains and collect URLs.
- Find a URL that shows an S3 bucket listing.
- Download the prod.env file and extract secrets.
- Extract frontend.zip and find an internal API endpoint.
- Use the leaked API key to request an admin JWT.
- Use the JWT to access admin routes and retrieve user data.
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.
An S3 bucket is cloud storage. If it is left open, anyone can list and download its files. Here, the bucket contained secrets and source code, which let the attacker get admin access to the company's API.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.