CVE-2025-59427: @cloudflare/vite plugin Cloudflare Vite Plugin Exposes Secrets Vulnerability
MODERATECVE-2025-59427 is a MODERATE cloudflare vite plugin exposes secrets vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting @cloudflare/vite plugin libraries in the npm ecosystem. The issue involves cloudflare vite plugin exposes secrets over the built-in dev server. Remediation is available by upgrading affected packages to version 1.6.0.
CVE-2025-59427 at a Glance
How to Fix CVE-2025-59427
To remediate this vulnerability, upgrade all affected @cloudflare/vite plugin dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @cloudflare/vite-plugin@1.6.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @cloudflare/vite-plugin
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-59427, inspect your project dependencies using npm:
npm ls @cloudflare/vite-plugin
Analyze the terminal output to locate any version of @cloudflare/vite plugin in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.0), your application is affected.
Note: The npm ls @cloudflare/vite-plugin command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In @cloudflare/vite plugin, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-59427 Affected @cloudflare/vite plugin Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@cloudflare/vite-plugin
|
npm |
< 1.6.0
|
1.6.0
|
References
Frequently Asked Questions
What is CVE-2025-59427?
Which @cloudflare/vite plugin versions are affected?
What version fixes CVE-2025-59427?
Is @cloudflare/vite-plugin affected?
What CWE is associated with CVE-2025-59427?
How can I check npm dependencies for CVE-2025-59427?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4pfg-2mw5-f8jx",
"modified" : "2025-09-22T21:39:42Z",
"published" : "2025-07-08T19:07:47Z",
"aliases" : [ "CVE-2025-59427" ],
"summary" : "Cloudflare Vite plugin exposes secrets over the built-in dev server",
"details" : "### Summary\n\nNote: [originally posted on H1](https://hackerone.com/reports/3117837) but closed. Cross-posting over to here in abundance of caution instead of a public issue. \n\nWhen 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:\n- `.env`\n- `.dev.vars`\n\n### PoC\n1. Create a Workers project that utilises the `@cloudflare/vite-plugin`. For example:\n - `npm create cloudflare@latest` - select Framework Starter -> React\n2. Add any secret files to test if they're accessible. `echo foobar=secret > .dev.vars` for example\n3. 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:\n\n`curl http://localhost:5173/.env` may expose any secrets in this file\n`curl http://localhost:5173/.dev.vars` may expose any secrets in this file\n`curl http://localhost:5173/package.json` may expose dependencies used by the project, potentially leading to other vulnerabilities\n`curl http://localhost:5173/README.md` may expose internal documentation\n\n### Impact\n\nIf 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. \n\nAnother 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.\n\nExposing via vite is possible via:\n\n```\nnpm run dev -- -- --host 0.0.0.0\n```\n\nThe default configuration has no reason to expose information outside of the configured assets directory.\n\nExample:\n\n`curl http://somehost/.env` may expose secrets\n`curl http://somehost/.dev.vars` may expose secrets\n`curl http://somehost/package.json` may expose dependencies used by the project, potentially leading to other vulnerabilities\n`curl http://somehost/README.md` may expose internal documentation\n\netc.\n\nInformation 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",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@cloudflare/vite-plugin"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/security/advisories/GHSA-4pfg-2mw5-f8jx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-59427"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/commit/0e500720bf70016fa4ea21fc8959c4bd764ebc38"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/3117837"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cloudflare/workers-sdk"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/discussions/3455#discussioncomment-6165773"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-07-08T19:07:47Z",
"nvd_published_at" : "2025-09-19T16:15:46Z"
}
}