Lucene search

K
hackeroneToannc123H1:570035
HistoryMay 07, 2019 - 8:52 a.m.

Node.js third-party modules: [statichttpserver] List any file in the folder by using path traversal.

2019-05-0708:52:48
toannc123
hackerone.com
8

0.001 Low

EPSS

Percentile

48.5%

I would like to report Path Traversal in statichttpserver. It allows to list any file in another folder of web root.

Module

module name: statichttpserverversion:0.9.7npm page: https://www.npmjs.com/package/statichttpserver

Module Description

‘statichttpserver’ is inspired by SimpleHTTPServer.py and is intended to be a fast and easy to use static file server.

Vulnerability

Vulnerability Description

statichttpserver is simply get the path name of url and add it to the web root. it means if you input …/, it will happy add it to web root and you can list the folder you choose. But the trick is web browser or curl are also to try rebuild the url containing …/. I used the burp to make a raw url and send it to server.

Steps To Reproduce:

install statichttpserver
$ npm install -g statichttpserver

start program
$ StaticHTTPServer --ip 192.168.220.132

start burpsuite and enter the url contain …/. you should see the files in the folder.
{F485830}

Patch

filter … in the path name.

Supporting Material/References:

Configuration I’ve used to find this vulnerability:

  • kali linux 4.15.0
  • nodejs v8.9.3
  • npm 6.4.1
  • Burpsuite

Wrap up

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

Impact

This vulnerability allows malicious user to list file in the folder. This might expose vectors to attack system with Remote Code Execution, reveals files with usernames and passwords and many other possibilities.

0.001 Low

EPSS

Percentile

48.5%