CVE-2025-59427

CVE-2025-59427 is a medium-severity security vulnerability in @cloudflare/vite-plugin (npm), affecting versions < 1.6.0. It is fixed in 1.6.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Cloudflare Vite plugin exposes secrets over the built-in dev server

Note: originally posted on H1 but closed. Cross-posting over to here in abundance of caution instead of a public issue.

When utilising the Cloudflare Vite plugin in its default configuration, all files are exposed by the local dev server, including files in the root directory that contain secret information such as:

  • .env
  • .dev.vars

PoC

  1. Create a Workers project that utilises the @cloudflare/vite-plugin. For example:
    • npm create cloudflare@latest - select Framework Starter -> React
  2. Add any secret files to test if they're accessible. echo foobar=secret > .dev.vars for example
  3. Run npm run dev to start the dev server (after running npm ci if necessary to install dependencies) and then hit the following to expose information:

curl http://localhost:5173/.env may expose any secrets in this file
curl http://localhost:5173/.dev.vars may expose any secrets in this file
curl http://localhost:5173/package.json may expose dependencies used by the project, potentially leading to other vulnerabilities
curl http://localhost:5173/README.md may expose internal documentation

Impact

If the vite dev server is exposed on a public network, such as when a user simply uses wrangler to serve their application and doesn't publish to Cloudflare in production, an attacker may be able to acquire secrets that the user doesn't wish to be exposed.

Another common scenario where this could happen is when sharing previews of an application using cloudflared. npm run dev -> share preview with cloudflared -> now all secrets are exposed to the public internet.

Exposing via vite is possible via:

npm run dev -- -- --host 0.0.0.0

The default configuration has no reason to expose information outside of the configured assets directory.

Example:

curl http://somehost/.env may expose secrets
curl http://somehost/.dev.vars may expose secrets
curl http://somehost/package.json may expose dependencies used by the project, potentially leading to other vulnerabilities
curl http://somehost/README.md may expose internal documentation

etc.

Information disclosure to anyone on the same network, or if the dev server is exposed such as via cloudflared as explored here: https://github.com/cloudflare/workers-sdk/discussions/3455#discussioncomment-6165773

Affected versions

@cloudflare/vite-plugin (< 1.6.0)

Security releases

@cloudflare/vite-plugin → 1.6.0 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade @cloudflare/vite-plugin to 1.6.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2025-59427? CVE-2025-59427 is a medium-severity security vulnerability in @cloudflare/vite-plugin (npm), affecting versions < 1.6.0. It is fixed in 1.6.0.
  2. Which versions of @cloudflare/vite-plugin are affected by CVE-2025-59427? @cloudflare/vite-plugin (npm) versions < 1.6.0 is affected.
  3. Is there a fix for CVE-2025-59427? Yes. CVE-2025-59427 is fixed in 1.6.0. Upgrade to this version or later.
  4. Is CVE-2025-59427 exploitable, and should I be worried? Whether CVE-2025-59427 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2025-59427 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2025-59427? Upgrade @cloudflare/vite-plugin to 1.6.0 or later.

Stop the waste.
Protect your environment with Kodem.