[statichttpserver] List any file in the folder by using path traversal.
The statichttpserver module concatenates the URL path directly onto the web root without filtering '..' sequences, so a crafted raw request can list files outside the intended directory. An attacker could use this to browse arbitrary folders and potentially expose sensitive files.
- Triaged in 3 days
- Fixed in 3 months
- Disclosed after 4 months
I would like to report Path Traversal in statichttpserver. It allows to list any file in another folder of web root.
Module
module name: statichttpserver version: 0.9.7 npm 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.

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.
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
The server concatenates the raw URL path to the web root without sanitising '..' path traversal sequences.
Impact
This could allow a malicious user to list files in arbitrary folders, potentially exposing credentials or other sensitive data and providing a stepping stone to further attacks such as remote code execution.
What the attacker needed
Network access to the server; ability to send raw HTTP requests
The fix
The path should be filtered to remove '..' sequences before being appended to the web root.
How it was found
- Install the statichttpserver package globally with npm.
- Start the server, specifying an IP address.
- Use Burp Suite to craft a raw HTTP request whose URL path contains '../' sequences.
- Send the request and observe that files in the chosen folder are listed.
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 shows files from a chosen folder. This one takes the path from the web address and sticks it onto the folder name without checking for '..', which means 'go up one folder'. By sending a request with '..' in the path, someone can make the server list files from other folders on the machine.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.