Skip to content
XSS Write-up Beginner

The Hidden XSS: A Bug Hidden in the Mist

A hidden HTML file contained a form that accepted JSON data and reflected an image field without proper sanitisation, allowing script execution. The attacker could only trigger the payload in their own session, resulting in a self-XSS.

medium.com

Published on medium.com

Hey fellow Bug Hunters and Security Researchers! As the title suggests, this is the tale of an XSS vulnerability — hidden in the mist.

SIDDHANT SHUKLA, 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 application failed to sanitise or encode user-supplied data in the image field before rendering it in the browser.

Impact

The vulnerability was a self-XSS, meaning it could only be triggered by the user themselves, and it was marked as low severity and out of scope.

What the attacker needed

Victim must enter payload themselves

The fix

The application should sanitise or encode user input before rendering it in the browser.

How it was found

  1. Discover a hidden index.html page under a subdomain.
  2. Fuzz the directory to find qa.html.
  3. Submit a JSON payload with a script tag in the originalName field, which is blocked.
  4. Submit a JSON payload with an img tag with an onclick handler in the image field, which triggers an alert.

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.

This is a cross-site scripting (XSS) bug where a web page takes input from a form and puts it back into the page without cleaning it. Normally an attacker could use this to run their own code in a victim's browser, but here the code only ran for the person who typed it, which is called self-XSS and is much less dangerous.

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.