Skip to content
XSS Write-up Intermediate

CVE-2023-25365 / XSS via file upload bypass

The file upload filter in October CMS 3.2.0 could be bypassed by changing the file extension to an allowed one such as .mp3, and the uploaded file was then served without proper content-type validation, allowing stored cross-site scripting. An attacker could upload a malicious HTML file disguised as an audio file and trick a victim into visiting its path, executing script in the victim's browser.

cupc4k3 Follow

Published on cupc4k3.medium.com

Was discovered by cupc4k3 and Gabriel V. Mendes.

CUPC4K3, on cupc4k3.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 application validated only the file extension on upload and did not enforce a safe content type or prevent the uploaded file from being served as HTML.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser when the victim visits the uploaded file's URL, potentially leading to session theft or other client-side attacks.

What the attacker needed

Ability to upload files; victim visits the uploaded file URL

How it was found

  1. Attempt to upload an .html file and observe it is blocked.
  2. Intercept the upload request and change the file extension from .html to an allowed one such as .mp3.
  3. Upload the file containing HTML with a script.
  4. Upload a separate image file to reveal the path of uploaded files.
  5. Change the image path to the hidden .mp3 file and access it to trigger the script.

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 file upload feature is supposed to block dangerous file types like HTML or PHP. Here, the check only looked at the file extension, so renaming a malicious HTML file to .mp3 let it through. When the file was later opened, the browser treated it as HTML and ran the embedded script, which is cross-site scripting (XSS).

What is XSS?

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

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.