CVE-2023-26152: static-server Path Traversal vulnerability

static-server Updated 02 Oct 2025

Summary

03/10/2023
No i
High
7.5

CVE-2023-26152: static-server Path Traversal vulnerability. Affects static-server versions < 2.2.1. 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The static-server package is an npm package used for serving static files over HTTP. It provides a simple way to host static websites or serve static assets. The package is widely used in web development projects to serve static content such as HTML, CSS, JavaScript, and images. However, all versions of the static-server package are vulnerable to a Path Traversal vulnerability. This vulnerability allows an attacker to access files outside of the intended directory by manipulating the input passed to the validPath function in server.js.

Vulnerability Detail

The Path Traversal vulnerability in static-server arises from a lack of proper input sanitization in the validPath function of server.js. By exploiting this vulnerability, an attacker can traverse the file system and access sensitive files or directories that should not be accessible. This can lead to unauthorized disclosure of sensitive information, remote code execution, or other malicious activities. The vulnerability has a CVSS score of 7.5, indicating a high severity level.

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 the package is not immediately feasible, a temporary workaround is to implement input validation and sanitization in the application code that utilizes the static-server package. This can be done by ensuring that user-supplied input is properly validated and restricted to prevent directory traversal attacks. Developers can use libraries or functions specifically designed for input sanitization, such as the 'path' module in Node.js, to sanitize user input and prevent path traversal vulnerabilities.

Conclusion

The static-server package is vulnerable to a Path Traversal vulnerability that can allow unauthorized access to sensitive files or directories. It is crucial to update the package to the latest patched version (2.2.2) or implement input validation and sanitization in the application code. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for static-server →

Share this vulnerability

FAQ

The Path Traversal vulnerability in static-server can allow an attacker to access sensitive files or directories outside of the intended scope. This can lead to unauthorized disclosure of sensitive information, remote code execution, or other malicious activities.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert analyzes package-lock.json files to monitor and alert in real-time for open-source vulnerabilities in software.

Yes, the maintainers of the static-server package have released a fix in version 2.2.2. It is recommended to update your project's package.json file to specify the latest version of static-server as a dependency and run the package manager's update command to install the patched version.

If updating the package is not immediately feasible, you can implement input validation and sanitization in your application code that utilizes the static-server package. This can help mitigate the risk of path traversal attacks.

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

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