Directory Traversal

Module: serve-here

Published: January 12th, 2018

Reported by: Yasin Soliman

CVE-NONE

CWE-22

Vulnerable: All
Patched: None

Overview

Affected versions of serve-here resolve relative file paths, resulting in a directory traversal vulnerability. A malicious actor can use this vulnerability to access files outside of the intended directory root, which may result in the disclosure of private files on the vulnerable system.

Proof of Concept:

curl "http://${SERVER_IP}:${SERVER_PORT}/..%2f..%2fetc/passwd"

Remediation

The serve-here package has been deprecated by the author and replaced by @vivaxy/here

To install the replacement package:

npm i @vivaxy/here

References

Commit #298dbab HackerOne Report #296254