Path Traversal Vulnerability in superstatic

superstatic Updated 02 Oct 2025

Summary

27/07/2018
HIGH
Yes i
High
Not published

GHSA-wm77-q74p-5763: Path Traversal in superstatic. Affects superstatic versions < 5.0.2. Fixed in 5.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 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

superstatic is an npm package used for serving static files. It is commonly used in web development to host static websites or single-page applications. The package provides a simple and efficient way to serve static files with features like URL rewriting and HTML5 pushState support. However, versions of superstatic prior to 5.0.2 are vulnerable to a path traversal vulnerability on Windows systems. Additionally, certain combinations of superstatic and Node.js versions can lead to path traversal vulnerabilities on other platforms as well.

Vulnerability Detail

The path traversal vulnerability in superstatic allows an attacker to access files outside of the intended directory structure. This can lead to unauthorized access to sensitive files or even remote code execution. On Windows systems, the vulnerability is present due to improper handling of file paths. On other platforms, the vulnerability is a result of a normalization issue in certain Node.js versions. The impact of this vulnerability can be severe, depending on the files accessible and the privileges of the user running the superstatic server.

How To Fix

Latest published version: 11.1.0 as of 22 Oct 2026

npm install superstatic@11.1.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.0.2

This is the first release that contains the fix.

npm install superstatic@5.0.2

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

Workaround

If updating superstatic is not immediately possible, a workaround is to implement input validation and sanitization for user-supplied paths. This can help prevent path traversal attacks by ensuring that only valid and expected paths are processed by the server. Here is an example of how to implement input validation in Node.js:

const path = require('path');

function validatePath(userPath) {
  const basePath = '/path/to/static/files'; // Set the base path to restrict access
  const resolvedPath = path.resolve(basePath, userPath);

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

  return resolvedPath;
}

Conclusion

The path traversal vulnerability in superstatic can have serious security implications, allowing unauthorized access to sensitive files or potential remote code execution. It is crucial to update superstatic to the latest version (5.0.2 or later) to mitigate this vulnerability. If immediate updating is not possible, implementing input validation and sanitization for user-supplied paths can serve as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for superstatic →

Share this vulnerability

FAQ

superstatic is an npm package used for serving static files in web development. It provides features like URL rewriting and HTML5 pushState support.

Path traversal is a vulnerability that allows an attacker to access files outside of the intended directory structure. It can lead to unauthorized access to sensitive files or remote code execution.

The vulnerability in superstatic occurs due to improper handling of file paths on Windows systems and a normalization issue in certain Node.js versions on other platforms.

The path traversal vulnerability in superstatic can result in unauthorized access to sensitive files or even remote code execution, depending on the files accessible and the privileges of the user running the server.

To fix the vulnerability, update superstatic to version 5.0.2 or later. This update includes patches to address the path traversal vulnerability.

How To Fix

Latest published version: 11.1.0 as of 22 Oct 2026

npm install superstatic@11.1.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.0.2

This is the first release that contains the fix.

npm install superstatic@5.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