CVE-2020-7686: Directory Traversal in rollup-plugin-server

rollup-plugin-server Updated 02 Oct 2025

Summary

29/07/2020
No i
High
7.5

CVE-2020-7686: Directory traversal in rollup-plugin-server. Affects rollup-plugin-server versions < 0.7.0. 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 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 rollup-plugin-server is an npm package that provides a development server for Rollup.js, a module bundler for JavaScript. It allows developers to serve their Rollup-built projects locally during development. The vulnerability affects all versions of the rollup-plugin-dev-server package. This package is responsible for serving files from the content base directory to the development server. However, it lacks proper path sanitization in the readFile operation within the readFileFromContentBase function.

Vulnerability Detail

The vulnerability allows an attacker to perform directory traversal attacks by manipulating the path parameter of the readFile operation. By including '../' sequences in the path, an attacker can access files outside of the intended directory and potentially read sensitive information or execute arbitrary code. This vulnerability has a CVSS score of 7.5, indicating a high severity level. Exploiting this vulnerability can lead to unauthorized access, data leakage, and potential 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 a temporary workaround, developers can manually validate and sanitize the path parameter before passing it to the readFile operation. Here's an example of how to sanitize the path using the path module in Node.js:

const path = require('path');

function sanitizePath(filePath) {
  const basePath = '/path/to/content/base'; // Replace with the actual content base directory
  const resolvedPath = path.resolve(basePath, filePath);

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

  return resolvedPath;
}

Conclusion

The rollup-plugin-dev-server package is vulnerable to a directory traversal attack due to the lack of path sanitization in the readFile operation. This can lead to unauthorized access, data leakage, and potential remote code execution. It is crucial for the package maintainers to address this vulnerability by implementing proper path sanitization and access controls. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for rollup-plugin-server →

Share this vulnerability

FAQ

rollup-plugin-server is an npm package that provides a development server for Rollup.js, allowing developers to serve their Rollup-built projects locally during development.

Directory traversal is a vulnerability that allows an attacker to access files and directories outside of the intended scope by manipulating file paths.

Exploiting this vulnerability can lead to unauthorized access, data leakage, and potential remote code execution.

To fix this vulnerability, the package maintainers should implement proper path sanitization in the readFile operation and restrict access to sensitive files and directories.

As a temporary workaround, developers can manually validate and sanitize the path parameter before passing it to the readFile operation.

Related vulnerabilities

Recent vulnerabilities recorded for rollup-plugin-server.

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