Skip to content
XSS Disclosed report Beginner CVE-2018-16474

[tianma-static] Stored xss on filename

The tianma-static module did not sanitise filenames, so a file named with HTML markup could cause stored cross-site scripting when served. An attacker could execute arbitrary JavaScript in a victim's browser.

abdilahrf_ Follow

Originally disclosed on HackerOne

Medium 6.7 View original
  • Triaged in 30 days
  • Fixed in 2 months
  • Disclosed after 2 months

I would like to report stored xss in tianma-static It allows anyone to execute arbitary javascript for doing anything.

Module

module name: tianma-static version: 1.0.4 npm page: https://www.npmjs.com/package/tianma-static

Module Description

Provide a static file service.

Vulnerability

Vulnerability Description

it was possible to embed malicious js code in filename there was no sanitization performed.

Steps To Reproduce:

  1. create filename <img src=x onerror=alert(1)>
  2. start tianma-static
  3. xss fired

F340845

Wrap up

  • I contacted the maintainer to let them know: N
  • I opened an issue in the related repository: N

Impact

It allows anyone to execute arbitary javascript for doing anything.

Attachments

tianma-static.PNG
tianma-static.PNG From the original on HackerOne

The original report as published on HackerOne, by abdilahrf_. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server inserted filenames into HTML output without escaping or sanitising them.

Impact

A crafted filename can cause arbitrary JavaScript to execute in a browser.

What the attacker needed

Ability to create a file with a crafted name

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 report has not been written yet. The Original tab links to the source.

A static file server hands files to the browser. If a file's name contains HTML, the server may put that name into the page without cleaning it, so the browser treats it as code. That lets an attacker run their own JavaScript 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.

More by abdilahrf_

View all

5 more disclosed reports, best first.

More from Node.js third-party modules

View all

The newest disclosed reports for this program.

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.