CVE-2025-31486 Details
Description
Vite is a frontend tooling framework for javascript. The contents of arbitrary files can be returned to the browser. By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the server.fs.deny restriction was able to bypass. This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 4.5.12, 5.4.17, 6.0.14, 6.1.4, and 6.2.5.
A vulnerability in Vite, a frontend tooling framework for JavaScript, allows the contents of arbitrary files to be accessed and returned to the browser. This issue arises from a bypass of the `server.fs.deny` restriction, which is only applicable to files smaller than the default inline limit of 4kB. The bypass can be achieved by appending `?.svg` with `?.wasm?init` or by using the `sec-fetch-dest: script` header. This vulnerability affects Vite versions 6.0.0 through 6.2.4, 5.0.0 through 5.4.16, and prior to 4.5.12. Only applications that explicitly expose the Vite development server to the network are vulnerable.
Users can update to Vite versions 4.5.12, 5.4.17, 6.0.14, 6.1.4, or 6.2.5 to address this vulnerability.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Apr 3, 2025CISA-ADP
Assessed Apr 3, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/vitejs/vite/security/advisories/GHSA-xcj6-pq6g-qj4x | CISA-ADP | AdvisoryRemedyVendor |
| https://github.com/vitejs/vite/blob/037f801075ec35bb6e52145d659f71a23813c48f/packages/vite/src/node/plugins/asset.ts#L285-L290 | [email protected] | Source CodeVendor |
| https://github.com/vitejs/vite/commit/62d7e81ee189d65899bb65f3263ddbd85247b647 | [email protected] | Source CodeVendor |
| https://github.com/vitejs/vite/security/advisories/GHSA-xcj6-pq6g-qj4x | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-200 | Exposure of Sensitive Information to an Unauthorized Actor | [email protected] |
| CWE-284 | Improper Access Control | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Vite | >= 6.2.0, <= 6.2.4 (semver) >= 6.1.0, <= 6.1.3 (semver) >= 6.0.0, <= 6.0.13 (semver) >= 5.0.0, <= 5.4.16 (semver) <= 4.5.11 (semver) |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Apr 3, 2025 | CVE Modified | CISA-ADP |
| Apr 3, 2025 | New CVE Received | [email protected] |
Volerion