Skip to content
XSS Write-up Intermediate

**🚀 Upload File ➡️ Stored XSS ➡️ Admin Takeover! MinIO Misconfiguration Story 🎣**

The server allowed unauthenticated PUT uploads to a MinIO bucket, so the authors uploaded an SVG that executed JavaScript when viewed, and then overwrote the admin panel's JavaScript file to run their own code. An attacker could steal an admin's session cookie and take over the admin account.

nocley Follow

Published on medium.com

Free Link

nocley, on medium.com

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 MinIO bucket permitted unauthenticated PUT requests and the application served uploaded files, including SVG and admin JavaScript, from that writable public storage without sanitisation.

Impact

An attacker could run JavaScript in an admin's browser, steal their session cookie, and potentially hijack the session, send CSRF payloads, or plant a keylogger.

What the attacker needed

Unauthenticated network access to the host; admin visits the affected page

The fix

The team patched MinIO and revoked PUT access for sensitive paths; more generally, public writable storage should not serve admin scripts or unsanitised SVG uploads.

How it was found

  1. Send an unauthenticated PUT request to upload an SVG file containing a script to the MinIO-backed host.
  2. Open the uploaded SVG in a browser and observe the script executing.
  3. Locate the admin panel's JavaScript file on the same bucket.
  4. Send another PUT request to overwrite that JavaScript file with attacker-controlled code.
  5. Refresh the admin page and observe the injected code running.
  6. Replace the code with one that sends the admin's cookie to an external server.

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 storage service (MinIO) was left open so anyone could upload files to it without logging in. Because the site served those files directly, an uploaded SVG image could run JavaScript in a visitor's browser. The authors then replaced the admin panel's own script file, so when an admin loaded the panel, the attacker's code ran and could steal the admin's login cookie.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by nocley

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.