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

rollup-plugin-server Updated 02 Oct 2025

Summary

29/07/2020
No i
High
7.5

CVE-2020-7683: 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The rollup-plugin-server is an npm package that provides a server plugin for Rollup, a module bundler for JavaScript. It allows developers to serve their bundled files locally during development. The vulnerability affects all versions of the rollup-plugin-server package. The package does not perform 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 file path passed to the readFile function. By including '../' sequences in the file path, an attacker can access files outside of the intended directory and potentially read sensitive information. This can lead to unauthorized access, information disclosure, 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 sanitize the file path before passing it to the readFile function. They should ensure that the file path only includes the necessary characters and does not allow any directory traversal sequences. Here is an example of how to sanitize the file path in JavaScript:

function sanitizeFilePath(filePath) {
  // Remove any '../' sequences
  filePath = filePath.replace(/\.\./g, '');
  // Add the base directory path
  filePath = '/path/to/content/' + filePath;
  return filePath;
}

Conclusion

The rollup-plugin-server package is vulnerable to a directory traversal attack due to the lack of path sanitization in the readFile operation. Developers should upgrade to a patched version of the package to mitigate the vulnerability. In the meantime, they can use a temporary workaround to sanitize the file path. For further assistance with 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 server plugin for Rollup, a JavaScript module bundler. It allows developers to serve their bundled files locally during development.

Directory traversal is a technique used by attackers to access files and directories outside of the intended scope. By manipulating file paths, they can navigate to parent directories or other parts of the file system.

The vulnerability can lead to unauthorized access to sensitive files, information disclosure, and potential remote code execution. An attacker could read sensitive data, modify files, or execute arbitrary code on the affected system.

To fix the vulnerability, you should upgrade to a version of rollup-plugin-server that includes a patch for the issue. Update your package.json file to use a non-vulnerable version and run the package manager's update command to install the patched version.

As a temporary workaround, you can manually sanitize the file path before passing it to the readFile function. Remove any '../' sequences and ensure the file path only includes the necessary characters.

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