Miggo Logo

GHSA-4pfg-2mw5-f8jx: Cloudflare Vite plugin exposes secrets over the built-in dev server

N/A

CVSS Score

Basic Information

CVE ID
-
EPSS Score
-
Published
7/8/2025
Updated
7/8/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
@cloudflare/vite-pluginnpm< 1.6.01.6.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is an information disclosure issue within the @cloudflare/vite-plugin. The root cause is the lack of file access restrictions in the default configuration of the Vite development server set up by the plugin. The cloudflare function in packages/vite-plugin-cloudflare/src/index.ts is the main entry point for the plugin and is responsible for generating this configuration. The analysis of the fixing commit 0e500720bf70016fa4ea21fc8959c4bd764ebc38 shows that the vulnerability was patched by adding a server.fs.deny array to the configuration object returned by the cloudflare function. This new configuration explicitly prevents the Vite dev server from serving sensitive files such as .env and .dev.vars. Since the cloudflare function was responsible for creating the insecure configuration, it is identified as the vulnerable function. Any runtime profiler would show this function being called as part of the Vite server setup process.

Vulnerable functions

cloudflare
packages/vite-plugin-cloudflare/src/index.ts
The `cloudflare` function is responsible for creating the Vite plugin configuration. Prior to the patch, the configuration object returned by this function did not specify any file system restrictions for the development server. This resulted in the server allowing access to any file in the project directory, including sensitive ones like `.env` and `.dev.vars`. The patch rectifies this by adding the `server.fs.deny` property to the configuration, explicitly blocking access to a list of sensitive files and patterns.

WAF Protection Rules

WAF Rule

### Summ*ry Not*: [ori*in*lly post** on **](*ttps://***k*ron*.*om/r*ports/*******) *ut *los**. *ross-postin* ov*r to **r* in **un**n** o* **ution inst*** o* * pu*li* issu*. W**n utilisin* t** *lou**l*r* Vit* plu*in in its ****ult *on*i*ur*tion, *l

Reasoning

T** vuln*r**ility is *n in*orm*tion *is*losur* issu* wit*in t** `@*lou**l*r*/vit*-plu*in`. T** root **us* is t** l**k o* *il* ****ss r*stri*tions in t** ****ult *on*i*ur*tion o* t** Vit* **v*lopm*nt s*rv*r s*t up *y t** plu*in. T** `*lou**l*r*` *un*t