CVE-2025-31486
Vite allows server.fs.deny to be bypassed with .svg or relative paths
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.3
Vite allows server.fs.deny to be bypassed with .svg or relative paths
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.
- Record
CVE-2025-31486- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N - Weakness
- CWE-200, CWE-284
- Updated
- 2026-11-02
EUVDEUVD-2025-9734
5.3
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.
- Record
EUVD-2025-9734- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-xcj6-pq6g-qj4x
5.3
Vite allows server.fs.deny to be bypassed with .svg or relative paths
Summary
The contents of arbitrary files can be returned to the browser.
Impact
Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
Details
.svg
Requests ending with .svg are loaded at this line.
https://github.com/vitejs/vite/blob/037f801075ec35bb6e52145d659f71a23813c48f/packages/vite/src/node/plugins/asset.ts#L285-L290
By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the 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+.
relative paths
The check was applied before the id normalization. This allowed requests to bypass with relative paths (e.g. ../../).
PoC
npm create vite@latest
cd vite-project/
npm install
npm run dev
send request to read etc/passwd
curl 'http://127.0.0.1:5173/etc/passwd?.svg?.wasm?init'
curl 'http://127.0.0.1:5173/@fs/x/x/x/vite-project/?/../../../../../etc/passwd?import&?raw'
- Record
GHSA-xcj6-pq6g-qj4x- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N - Weakness
- CWE-200, CWE-284
- Updated
- 2026-11-02
NVD
5.3
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.
- Record
CVE-2025-31486- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N - Weakness
- CWE-200, CWE-284
- Updated
- 2026-11-02
OSV
5.3
Vite allows server.fs.deny to be bypassed with .svg or relative paths
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.
- Record
CVE-2025-31486- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N - Weakness
- CWE-200, CWE-284
- Updated
- 2026-11-04
OSVGHSA-xcj6-pq6g-qj4x
5.3
Vite allows server.fs.deny to be bypassed with .svg or relative paths
Summary
The contents of arbitrary files can be returned to the browser.
Impact
Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
Details
.svg
Requests ending with .svg are loaded at this line.
https://github.com/vitejs/vite/blob/037f801075ec35bb6e52145d659f71a23813c48f/packages/vite/src/node/plugins/asset.ts#L285-L290
By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the 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+.
relative paths
The check was applied before the id normalization. This allowed requests to bypass with relative paths (e.g. ../../).
PoC
npm create vite@latest
cd vite-project/
npm install
npm run dev
send request to read etc/passwd
curl 'http://127.0.0.1:5173/etc/passwd?.svg?.wasm?init'
curl 'http://127.0.0.1:5173/@fs/x/x/x/vite-project/?/../../../../../etc/passwd?import&?raw'
- Record
GHSA-xcj6-pq6g-qj4x- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N - Weakness
- CWE-200, CWE-284
- Updated
- 2026-11-02
Show 9 moreShow less
OSVCLSA-2026-1775089661 No score
TuxCare security update for 2 packages (5 CVEs)
TuxCare rebuilt 2 packages to address 5 CVEs. Fixed in 5.4.14-tuxcare.1.
- Record
CLSA-2026-1775089661- Updated
- 2026-11-02
OSVCLSA-2026-1775176118 No score
TuxCare security update for vite (6 CVEs)
TuxCare rebuilt vite to address 6 CVEs. Fixed in 4.5.5-tuxcare.1.
- Record
CLSA-2026-1775176118- Updated
- 2026-11-02
OSVCLSA-2026-1777509608 No score
TuxCare security update for vite (11 CVEs)
TuxCare rebuilt vite to address 11 CVEs. Fixed in 2.9.18-tuxcare.1.
- Record
CLSA-2026-1777509608- Updated
- 2026-11-02
OSVCLSA-2026-1777509610 No score
TuxCare security update for vite (6 CVEs)
TuxCare rebuilt vite to address 6 CVEs. Fixed in 3.2.11-tuxcare.1.
- Record
CLSA-2026-1777509610- Updated
- 2026-11-02
OSVCLSA-2026-1789031855 No score
TuxCare security update for vite (16 CVEs)
TuxCare rebuilt vite to address 16 CVEs. Fixed in 4.1.5-tuxcare.1.
- Record
CLSA-2026-1789031855- Updated
- 2026-11-02
OSVCLSA-2026-1791666893 No score
TuxCare security update for vite (1 CVE)
TuxCare rebuilt vite to address 1 CVE. Fixed in 5.4.10-tuxcare.2.
- Record
CLSA-2026-1791666893- Updated
- 2026-11-02
OSVCLSA-2026-1791795546 No score
TuxCare security update for vite (2 CVEs)
TuxCare rebuilt vite to address 2 CVEs. Fixed in 5.0.12-tuxcare.4.
- Record
CLSA-2026-1791795546- Updated
- 2026-11-02
OSVCLSA-2026-1792225950 No score
TuxCare security update for @vitejs/plugin-react (11 CVEs)
TuxCare rebuilt @vitejs/plugin-react to address 11 CVEs. Fixed in 2.9.18-tuxcare.1.
- Record
CLSA-2026-1792225950- Updated
- 2026-11-02
OSVCLSA-2026-1792225952 No score
TuxCare security update for @vitejs/plugin-react (6 CVEs)
TuxCare rebuilt @vitejs/plugin-react to address 6 CVEs. Fixed in 3.2.11-tuxcare.1.
- Record
CLSA-2026-1792225952- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
vitenpm |
6.2.0 up to 6.2.5 | 6.2.5 |
vitenpm |
6.1.0 up to 6.1.4 | 6.1.4 |
vitenpm |
6.0.0 up to 6.0.14 | 6.0.14 |
vitenpm |
5.0.0 up to 5.4.17 | 5.4.17 |
vitenpm |
before 4.5.12 | 4.5.12 |
@vitejs/plugin-legacyTuxCare:npm From an advisory covering 4 CVEs |
5.4.14-tuxcare.0 up to 5.4.14-tuxcare.1, plus listed versions 5.4.14 |
5.4.14-tuxcare.1 |
viteTuxCare:npm From an advisory covering 4 CVEs |
5.4.14-tuxcare.0 up to 5.4.14-tuxcare.1, plus listed versions 5.4.14 |
5.4.14-tuxcare.1 |
viteTuxCare:npm From an advisory covering 6 CVEs |
4.5.5-tuxcare.0 up to 4.5.5-tuxcare.1, plus listed versions 4.5.5 |
4.5.5-tuxcare.1 |
viteTuxCare:npm From an advisory covering 11 CVEs |
2.9.18-tuxcare.0 up to 2.9.18-tuxcare.1, plus listed versions 2.9.18 |
2.9.18-tuxcare.1 |
viteTuxCare:npm From an advisory covering 6 CVEs |
3.2.11-tuxcare.0 up to 3.2.11-tuxcare.1, plus listed versions 3.2.11 |
3.2.11-tuxcare.1 |
Show 5 moreShow less
| Package | Affected | Fixed |
|---|---|---|
viteTuxCare:npm From an advisory covering 16 CVEs |
4.1.5-tuxcare.0 up to 4.1.5-tuxcare.1, plus listed versions 4.1.5 |
4.1.5-tuxcare.1 |
viteTuxCare:npm |
5.4.10-tuxcare.0 up to 5.4.10-tuxcare.2, plus listed versions 5.4.105.4.10-tuxcare.1 |
5.4.10-tuxcare.2 |
viteTuxCare:npm From an advisory covering 2 CVEs |
5.0.12-tuxcare.0 up to 5.0.12-tuxcare.4, plus listed versions 5.0.125.0.12-tuxcare.15.0.12-tuxcare.25.0.12-tuxcare.3 |
5.0.12-tuxcare.4 |
@vitejs/plugin-reactTuxCare:npm From an advisory covering 11 CVEs |
2.9.18-tuxcare.0 up to 2.9.18-tuxcare.1, plus listed versions 2.9.18 |
2.9.18-tuxcare.1 |
@vitejs/plugin-reactTuxCare:npm From an advisory covering 6 CVEs |
3.2.11-tuxcare.0 up to 3.2.11-tuxcare.1, plus listed versions 3.2.11 |
3.2.11-tuxcare.1 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | iSee857/CVE-2025-31486-PoC | 2025-04-07 |
| PoC in GitHub | ll104567/CVE-2025-31486 | 2025-04-26 |
| PoC in GitHub | hackmelocal/CVE-2025-31486-Simulation | 2025-07-24 |
| Nuclei | Vite server.fs.deny Bypass - Local File Inclusion |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| exploits, facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, Nuclei, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-31486 is a medium vulnerability (CVSS 5.3) in Vitejs Vite, published April 3, 2025. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 40.5%, the 98th percentile. Fixed in vite 6.2.5.
References
github.com/vitejs/vite/security/advisories/GHSA-xcj6-pq6g-qj4x
github.com/vitejs/vite/commit/62d7e81ee189d65899bb65f3263ddbd85247b647
github.com/vitejs/vite/blob/037f801075ec35bb6e52145d659f71a23813c48f/packages/vite/src/node/plugins/asset.ts
nvd.nist.gov/vuln/detail/CVE-2025-31486
github.com/advisories/GHSA-xcj6-pq6g-qj4x
github.com/CVEProject/cvelistV5/tree/main/cves/2025/31xxx/CVE-2025-31486.json
github.com/vitejs/vite