CVE-2020-7687: Directory Traversal in fast-http

fast-http Updated 02 Oct 2025

Summary

27/07/2020
No i
High
7.5

CVE-2020-7687: Directory traversal in fast-http. Affects fast-http versions < 0.1.3. 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 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

fast-http is an npm package that provides functionality for handling HTTP requests and responses in a fast and efficient manner. It is widely used in web applications to improve performance. However, all versions of fast-http are vulnerable to a directory traversal vulnerability. This vulnerability allows an attacker to access files outside of the intended directory by exploiting the lack of path sanitization in the fs.readFile function in index.js.

Vulnerability Detail

The directory traversal vulnerability in fast-http can have serious ramifications. An attacker can exploit this vulnerability to read sensitive files on the server, such as configuration files or user data. This can lead to unauthorized access, data leakage, or even remote code execution. The vulnerability is rated as HIGH severity with a CVSS score of 7.5. The Common Weakness Enumeration (CWE) ID associated with this vulnerability is CWE-22.

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

If updating to a patched version of fast-http is not immediately possible, a temporary workaround is to implement path sanitization manually before passing the path to the fs.readFile function. Here is an example of how to sanitize the path using the path module in Node.js:

const path = require('path');
const filePath = path.resolve(__dirname, 'path/to/file');

By resolving the file path with the path.resolve function, the path will be normalized and any directory traversal attempts will be prevented.

Conclusion

The directory traversal vulnerability in fast-http can have serious consequences, including unauthorized access and data leakage. It is crucial to update to a patched version of fast-http or implement path sanitization to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for fast-http →

Share this vulnerability

FAQ

fast-http is an npm package that provides functionality for handling HTTP requests and responses in a fast and efficient manner. It is widely used in web applications to improve performance.

Directory traversal is a vulnerability that allows an attacker to access files outside of the intended directory. By manipulating file paths, an attacker can navigate to sensitive files on the server.

The directory traversal vulnerability in fast-http can lead to unauthorized access, data leakage, and even remote code execution. An attacker could read sensitive files containing configuration data or user information.

To fix the vulnerability, update to a version of fast-http that includes a patch for the directory traversal issue. Alternatively, implement path sanitization manually before passing the path to the fs.readFile function.

Yes, a temporary workaround is to implement path sanitization manually using the path module in Node.js. By resolving the file path with the path.resolve function, the path will be normalized and any directory traversal attempts will be prevented.

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