[md-fileserver] Path Traversal
The md-fileserver module does not verify that requested files are within the root directory, allowing path traversal. An attacker can read arbitrary system files, such as /etc/passwd, via a crafted URL.
Originally disclosed on HackerOne
- Triaged in 3 hours
- Fixed in 10 months
- Disclosed after 11 months
I would like to report path traversal in md-fileserver modulee It allows an attacker to read system files via path traversal through commandline
Module
module name: md-fileserver
version: 1.3.2
npm page: https://www.npmjs.com/package/md-fileserver
Module Description
Starts a local server to render "markdown" files within your browser:
Vulnerability
Vulnerability Description
Directory traversal through the url which doesn't verify the file is from the root directory path.
Steps To Reproduce:
1.npm install -g md-fileserver
2.start the local server by typing below on commandline $mdstart
3.now on terminal type curl -v --path-as-is http://127.0.0.1:8080/etc/passwd
it will list all the credentials in passwd folder
Supporting Material/References:
State all technical information about the stack where the vulnerability was found
- [OPERATING SYSTEM VERSION] kali linux
- [NODEJS VERSION] 11.8.0
- [NPM VERSION] 6.5.0
Wrap up
Select Y or N for the following statements:
- 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 read content of any file on the server, which leads to data breach or other attacks.
Attachments

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
Impact
This vulnerability allows a malicious user to read the content of any file on the server, which could lead to a data breach or other attacks.
What the attacker needed
Md-fileserver installed and running; attacker can send HTTP requests to the server
How it was found
- Install md-fileserver globally using npm.
- Start the local server by running the mdstart command.
- Send a crafted request with path traversal to read a system file.
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.
The md-fileserver tool serves markdown files from a folder. It fails to check that requested files are inside that folder, so an attacker can use a crafted URL to read system files such as password files.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.