Information Disclosure Vulnerability in @cloudflare/vite-plugin: Secrets Exposed via Dev Server

@cloudflare/vite-plugin Updated 14 Dec 2025

Summary

08/07/2025
MODERATE
Yes i
Moderate
6.9

GHSA-4pfg-2mw5-f8jx: Cloudflare Vite plugin exposes secrets over the built-in dev server. Affects @cloudflare/vite-plugin versions < 1.6.0. Fixed in 1.6.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 @cloudflare/vite-plugin is a tool designed to enhance the development experience for Cloudflare Workers projects by integrating Vite's fast build and hot-reload capabilities. However, in its default configuration, it exposes sensitive files through the local development server, which can lead to significant security risks if not properly managed.

Vulnerability Detail

The vulnerability arises from the default configuration of the @cloudflare/vite-plugin, which allows all files, including sensitive ones like .env and .dev.vars, to be accessed via the local development server. This exposure can lead to unauthorized access to secrets and sensitive information if the development server is accessible over a public network. Attackers can exploit this by sending HTTP requests to the server, potentially leading to data breaches and further vulnerabilities.

How To Fix

Minimum fixed version

1.6.0

This is the first release that contains the fix.

npm install @cloudflare/vite-plugin@1.6.0

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

Workaround

As a temporary workaround, avoid exposing the development server to the public by binding it to localhost only. You can do this by running the development server with the following command: npm run dev -- --host localhost. This will prevent external access to sensitive files.

Conclusion

The @cloudflare/vite-plugin has a vulnerability that can expose sensitive files through its development server. It is crucial to update to the latest version to mitigate this risk. Additionally, using workarounds to restrict server access can help protect sensitive information until an update can be applied.

See every vulnerability recorded for @cloudflare/vite-plugin →

Share this vulnerability

FAQ

Files such as .env, .dev.vars, package.json, and README.md can be exposed, potentially revealing sensitive information and project dependencies.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If you cannot update the package right away, ensure that your development server is not accessible from the public internet by restricting access to localhost.

The vulnerability is classified as moderate, but it can lead to significant risks if sensitive information is exposed, especially in production environments.

Vulert is a tool that monitors and alerts for open-source vulnerabilities in your software using just package-lock.json, providing real-time insights without requiring code access.

How To Fix

Minimum fixed version

1.6.0

This is the first release that contains the fix.

npm install @cloudflare/vite-plugin@1.6.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