How a Base64 Image API Turned a Trusted Cloud Bucket into an Attacker’s CDN
The API for uploading base64-encoded images did not check whether the caller owned the resource, so any client could overwrite images by guessing or harvesting valid IDs. Attackers could also mass-upload arbitrary images to a trusted cloud domain, using it as a free CDN and hosting phishing or fake promotional content.
infosecwriteups.com
Published on infosecwriteups.com
Hello Everyone !…. It’s been quite a while since I last published a write-up here…. life, work, and a lot of startup work happened in between 😄.
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 API endpoint that writes base64 images to cloud storage lacks ownership validation and rate limiting, allowing any caller to overwrite or create objects using predictable IDs.
Impact
Attackers could overwrite existing images, mass-upload arbitrary content, use the platform as a free CDN, and host phishing or fake promotional content on a trusted domain, causing financial, reputational, and legal damage.
What the attacker needed
API access to the platform; Ability to send POST and PATCH requests; No authentication required for the vulnerable endpoints
The fix
The API should enforce ownership checks on every write, use server-controlled object keys, apply rate limits and quotas, and default to private storage with signed URLs.
How it was found
- Send POST requests to the resource creation endpoint to generate many valid IDs.
- Use the harvested IDs to send PATCH requests with attacker-controlled base64 images.
- The server decodes and writes the images to cloud storage without checking ownership.
- The images are stored under a trusted cloud domain and can be used for phishing or as a free CDN.
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 picture, the server should check that the picture belongs to you before saving it. Here, the server saved any picture to any ID without asking who you are. So anyone could replace other people's pictures or fill the storage with their own, all under the company's trusted web address.
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.