CVE-2018-3734: Path Traversal in stattic

stattic Updated 02 Oct 2025

Summary

18/07/2018
Yes i
High
7.5

CVE-2018-3734: Path Traversal in stattic. Affects stattic versions < 0.3.0. Fixed in 0.3.0. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The stattic package is an npm package used for serving static files in Node.js applications. It allows developers to easily serve static assets such as HTML, CSS, JavaScript, and images. However, versions of stattic before 0.3.0 are vulnerable to a path traversal attack, which can be exploited by a remote attacker to read arbitrary files from the server. This vulnerability poses a high risk to the confidentiality of sensitive information stored on the server.

Vulnerability Detail

The vulnerability in stattic arises from insufficient input validation, allowing an attacker to manipulate file paths and access files outside of the intended directory. By exploiting this vulnerability, an attacker can read any file on the server, regardless of its extension. This could lead to the unauthorized disclosure of sensitive information, such as configuration files or user data. The vulnerability has been assigned a CVSS score of 7.5, indicating a high severity level.

How To Fix

Minimum fixed version

0.3.0

This is the first release that contains the fix.

npm install stattic@0.3.0

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

Workaround

If updating to the latest version is not immediately possible, a temporary workaround is to implement additional input validation and sanitization of user-supplied file paths. This can be done by checking that the requested file path is within the expected directory and does not contain any directory traversal characters. Here is an example of how to implement this workaround in Node.js:

const path = require('path');

function serveStaticFile(req, res) {
  const requestedFile = req.params.file;
  const basePath = '/path/to/static/files';
  const resolvedPath = path.resolve(basePath, requestedFile);

  if (!resolvedPath.startsWith(basePath)) {
    // Invalid file path
    res.status(400).send('Invalid file path');
    return;
  }

  // Serve the file
  // ...
}

Conclusion

In conclusion, the stattic package versions before 0.3.0 are vulnerable to a path traversal attack, which can be exploited to read arbitrary files from the server. To mitigate this vulnerability, it is crucial to update to version 0.3.0 or later. Implementing additional input validation and sanitization of file paths can serve as a temporary workaround until the update is applied. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for stattic →

Share this vulnerability

FAQ

This vulnerability allows an attacker to read arbitrary files from the server, potentially exposing sensitive information. It can lead to unauthorized access, data breaches, and other security incidents.

No, only versions before 0.3.0 are vulnerable to this path traversal attack. It is recommended to update to version 0.3.0 or later to mitigate the vulnerability.

While there are no known public exploits for this specific vulnerability in stattic, it is important to address it promptly to prevent potential attacks. Attackers often actively search for and exploit known vulnerabilities in popular packages.

Yes, this vulnerability has been assigned a CVSS score of 7.5, indicating a high severity level.

You can find more information about this vulnerability, including its technical details and affected versions, in the GitHub Security Advisory database: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/07/GHSA-w4pv-w56c-mg4v/GHSA-w4pv-w56c-mg4v.json

How To Fix

Minimum fixed version

0.3.0

This is the first release that contains the fix.

npm install stattic@0.3.0

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