Skip to content
XSS Write-up Beginner

Malicious File Upload Leads To Off Domain Xss

The chatbot's file upload feature lacked restrictions, allowing an attacker to upload a malicious SVG file with a double extension. When the uploaded file was opened in a new tab, the embedded script executed, leading to off-domain XSS.

pullakarthik Follow

Published on systemweakness.com

My name is pulla karthik Srivastav (security researcher) from Hyderabad. I am so excited as this is my third write up on vulnerability assessment of web apps.

@pullakarthik, on systemweakness.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

Impact

The vulnerability could allow execution of arbitrary code in the server context and on the client side, potentially exposing sensitive sections of the application to client-side attacks such as XSS.

What the attacker needed

Access to chatbot upload feature; victim opens uploaded file

The fix

The upload feature should be fixed by allow listing file extensions, validating the Content-Type header, and using a file type detector.

How it was found

  1. Open the chatbot functionality on the target website.
  2. Upload a malicious file containing an XSS payload, bypassing file restrictions using double extensions.
  3. After successful upload, hover over the file and open the image in a new tab, which triggers the XSS.

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 let people upload files to a chatbot without checking what kind of file it was. The researcher uploaded a file that contained a script, and when the file was opened, the script ran in the browser. This is called cross-site scripting (XSS), where an attacker can run their own code in someone else's browser.

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.