Miggo Logo

CVE-2025-32395: Vite has an `server.fs.deny` bypass with an invalid `request-target`

N/A

CVSS Score

Basic Information

EPSS Score
0.03702%
Published
4/11/2025
Updated
4/11/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
vitenpm>= 6.2.0, < 6.2.66.2.6
vitenpm>= 6.1.0, < 6.1.56.1.5
vitenpm>= 6.0.0, < 6.0.156.0.15
vitenpm>= 5.0.0, < 5.4.185.4.18
vitenpm< 4.5.134.5.13

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in a bypass of the server.fs.deny mechanism in Vite's development server, enabling unauthorized file access. The root cause is the improper handling of URLs containing a '#' character in the request target, which is not compliant with the HTTP specification but is passed through by Node.js and Bun runtimes. Vite's file serving logic did not account for the presence of the '#' fragment in the URL, leading to a path traversal vulnerability.

The provided patch addresses this by introducing a new middleware, rejectInvalidRequestMiddleware. This middleware, defined in the new file packages/vite/src/node/server/middlewares/rejectInvalidRequest.ts, inspects incoming requests. If a '#' is found in req.url, it immediately sends a 400 Bad Request response, effectively stopping any further processing.

The critical change is within the _createServer function in packages/vite/src/node/server/index.ts. This function is responsible for assembling the server's middleware stack. The patch inserts the new rejectInvalidRequestMiddleware into this stack. By identifying _createServer as the vulnerable function, we are highlighting the location where the flawed request handling pipeline was configured, which is the most precise point of intervention shown in the patch.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry T** *ont*nts o* *r*itr*ry *il*s **n ** r*turn** to t** *rows*r i* t** **v s*rv*r is runnin* on No** or *un. ### Imp**t Only *pps wit* t** *ollowin* *on*itions *r* *****t**. - *xpli*itly *xposin* t** Vit* **v s*rv*r to t** n*twork (usin*

Reasoning

T** vuln*r**ility li*s in * *yp*ss o* t** `s*rv*r.*s.**ny` m****nism in Vit*'s **v*lopm*nt s*rv*r, *n**lin* un*ut*oriz** *il* ****ss. T** root **us* is t** improp*r **n*lin* o* URLs *ont*inin* * '#' ***r**t*r in t** r*qu*st t*r**t, w*i** is not *ompl