CVE-2018-3729: Path Traversal in localhost-now

localhost-now Updated 02 Oct 2025

Summary

25/07/2018
Yes i
High
7.5

CVE-2018-3729: Path Traversal in localhost-now. Affects localhost-now versions < 1.0.2. Fixed in 1.0.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The localhost-now package is an npm package used for local development and testing purposes. It provides a simple way to create a local server and serve static files. The package is widely used in web development projects. However, versions prior to 1.0.2 are vulnerable to a path traversal attack, which allows a remote attacker to read the content of arbitrary files on the server.

Vulnerability Detail

The vulnerability in localhost-now arises from insufficient input validation. An attacker can exploit this vulnerability by crafting a malicious request that includes directory traversal sequences (e.g., '../') in the file path. When the server processes this request, it does not properly sanitize the file path, allowing the attacker to access files outside the intended directory. This can lead to unauthorized disclosure of sensitive information, such as configuration files or user data. The impact of this vulnerability is rated as HIGH with a CVSS score of 7.5.

How To Fix

Minimum fixed version

1.0.2

This is the first release that contains the fix.

npm install localhost-now@1.0.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the package is not immediately feasible, a temporary workaround can be implemented by manually validating and sanitizing user input for file paths. This can be done by ensuring that the requested file path only contains allowed characters and does not include any directory traversal sequences. Here is an example of how to implement this workaround in Node.js:

const path = require('path');

function sanitizeFilePath(filePath) {
  const allowedChars = /^[a-zA-Z0-9_-]+$/;
  const sanitizedPath = path.normalize(filePath);

  if (!allowedChars.test(sanitizedPath)) {
    throw new Error('Invalid file path');
  }

  return sanitizedPath;
}

Conclusion

The localhost-now package prior to version 1.0.2 is vulnerable to a path traversal attack, which allows an attacker to read arbitrary files on the server. To mitigate this vulnerability, it is crucial to update to version 1.0.2 or later of the package. If immediate update is not possible, implementing a temporary workaround by validating and sanitizing user input for file paths can provide some protection. For more information and assistance, please contact DevNack.com.

See every vulnerability recorded for localhost-now →

Share this vulnerability

FAQ

The vulnerability allows an attacker to read the content of arbitrary files on the server, potentially leading to unauthorized disclosure of sensitive information.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your package-lock.json file, and Vulert will analyze it for any open-source vulnerabilities, including this one.

Yes, updating to version 1.0.2 or later of the localhost-now package fixes this vulnerability. It is recommended to update as soon as possible.

Yes, a temporary workaround is to manually validate and sanitize user input for file paths to prevent path traversal attacks. See the 'workaround' section for an example implementation.

For further support on vulnerability remediation, you can contact info@devnack.com. They can provide guidance and assistance in addressing this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for localhost-now.

How To Fix

Minimum fixed version

1.0.2

This is the first release that contains the fix.

npm install localhost-now@1.0.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback