CVE-2018-3724: Path Traversal in general-file-server

general-file-server Updated 02 Oct 2025

Summary

26/07/2018
No i
High
7.5

CVE-2018-3724: Path Traversal in general-file-server. Affects general-file-server versions < 1.1.8. No fix is published. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The general-file-server is an npm package that provides file server functionality. It allows users to upload, download, and manage files on a server. However, all versions of general-file-server are vulnerable to a path traversal vulnerability.

Vulnerability Detail

The path traversal vulnerability in general-file-server allows an attacker to access files outside of the intended directory. By manipulating the file path in a specific way, an attacker can bypass file access restrictions and retrieve sensitive information or execute arbitrary code. This vulnerability poses a high risk as it can lead to unauthorized access, data leakage, and remote code execution.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As there is no official fix, it is advisable to find an alternative package or implement a custom file server solution with proper input validation and file path sanitization to prevent path traversal attacks. Here's an example of how to sanitize file paths in Node.js:

const path = require('path');

function sanitizeFilePath(filePath) {
  const rootPath = '/path/to/root/directory';
  const resolvedPath = path.resolve(rootPath, filePath);

  if (!resolvedPath.startsWith(rootPath)) {
    throw new Error('Invalid file path');
  }

  return resolvedPath;
}

Conclusion

The general-file-server package is vulnerable to a path traversal vulnerability that can lead to unauthorized access, data leakage, and remote code execution. Currently, there is no fix available, so it is recommended to avoid using this module. Consider finding an alternative package or implementing a custom file server solution with proper input validation and file path sanitization. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for general-file-server →

Share this vulnerability

FAQ

The path traversal vulnerability allows an attacker to access sensitive files outside of the intended directory. This can lead to unauthorized access, data leakage, and remote code execution.

No, there is currently no fix available for this vulnerability. It is recommended to avoid using the general-file-server module until a fix is provided.

To mitigate the risk, it is recommended to find an alternative package or implement a custom file server solution with proper input validation and file path sanitization.

Keep an eye on the official GitHub repository of general-file-server for updates and patches regarding this vulnerability.

Yes, you can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities without requiring access to the code or installation.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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