Unrestricted File Upload via Exposed Upload Preset
An archived JavaScript bundle exposed a Cloudinary upload preset and cloud name, allowing attackers to upload arbitrary files, including HTML, directly to Cloudinary. This could let an attacker host malicious content on a trusted domain.
Published on medium.com
I just found interesting subdomain which i can’t access. then, I checked historical snapshots of the target’s static JS assets via the Wayback Machine. An archived JS bundle revealed hardcoded preset configuration parameters that should never have been exposed client-side:
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 embedded Cloudinary upload credentials (cloud name and upload preset) in client-side JavaScript, and the upload preset allowed unrestricted file types.
Impact
An attacker could host arbitrary HTML content on a trusted Cloudinary domain, potentially enabling phishing or other attacks, though SVG uploads were blocked by Cloudinary's default restrictions.
What the attacker needed
Access to the archived JavaScript bundle; No authentication needed
How it was found
- Find an inaccessible subdomain and check its archived JavaScript files on the Wayback Machine.
- Extract the Cloudinary cloud name and upload preset from the archived bundle.
- Send a direct POST request to Cloudinary's upload API with the leaked preset and an HTML file.
- Confirm the uploaded file is publicly accessible on a Cloudinary domain.
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.
A website used a third-party service (Cloudinary) to store files. The secret keys for that service were accidentally left in the website's code, which was saved by an internet archive. Anyone who found those keys could upload files directly to the service, including harmful HTML pages, and the files would appear to come from a trusted domain.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.