localhost-now path traversal bypass

Severity: info · Published 2019-06-11

localhost-now is a lightweight Node.js web server module. An attacker can exploit a path traversal vulnerability to read arbitrary files from the underlying system, including sensitive configuration and credential files, bypassing the intended file access restrictions.

Technologies: localhost-now (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Informational severity, published 11 June 2019.
Which products and versions are affected?
localhost-now (npm) SEMVER:introduced=0,last_affected=1.0.2.
Is there a fix for This vulnerability?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run localhost-now (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability is a CWE-22 path traversal bypass in the URL path parsing logic. The vulnerable code attempts to strip "../" sequences using a regex replace, but the regex can be bypassed using encoded or obfuscated path traversal sequences (e.g., "..././"). An attacker with network access to the web server can craft malicious URLs to traverse the file system and read arbitrary files. The vulnerability affects all versions through 1.0.2, which included an earlier (incomplete) path traversal fix. No patch is currently available as of the advisory publication.

Affected products

  • localhost-now localhost-now all versions up to and including 1.0.2

Timeline

  • 2019-06-11: disclosed
  • 2019-06-11: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.