Vite allows server.fs.deny to be bypassed with .svg or relative paths (CVE-2025-31486)
Vite versions from 2.5.1 up to but not including 6.2.5 contain a vulnerability (CVE-2025-31486) that allows an attacker to bypass the server.fs.deny file access restrictions. This enables the contents of arbitrary files to be returned to the browser when the Vite development server is exposed to the network. The bypass leverages requests ending with .svg combined with certain query parameters or headers, and also relative path traversal before id normalization. The vulnerability requires the file to be smaller than the default 4kB inline asset limit and affects Vite 6.0 and later. A proof of concept demonstrates reading sensitive files like /etc/passwd via crafted requests. A patch is available to fix this issue.
AI Analysis
Technical Summary
CVE-2025-31486 is a vulnerability in Vite dev server versions >=2.5.1 <6.2.5 that allows bypassing the server.fs.deny restriction to read arbitrary files. The bypass exploits two mechanisms: requests ending with .svg combined with query parameters or headers that cause the server to inline small assets, and relative path traversal due to checks applied before id normalization. This vulnerability only affects applications explicitly exposing the Vite dev server to the network (e.g., using --host). The flaw enables an attacker to retrieve arbitrary file contents from the server filesystem, demonstrated by reading /etc/passwd. The vulnerability has a CVSS 3.1 score of 5.3 (medium severity). A patch is available to address this issue.
Potential Impact
An attacker can retrieve the contents of arbitrary files from the server running the Vite development server if it is exposed to the network. This can lead to disclosure of sensitive information. The vulnerability requires network exposure of the dev server and files smaller than the inline asset limit (default 4kB) for the .svg bypass. The relative path bypass allows traversal to arbitrary files. There is no indication of code execution or integrity impact. The CVSS score is 5.3, reflecting a medium severity confidentiality impact with high attack complexity and required user interaction.
Mitigation Recommendations
A patch is available for Vite versions affected by this vulnerability. Users should upgrade to version 6.2.5 or later where this issue is fixed. If upgrading immediately is not possible, avoid exposing the Vite development server to the network (do not use --host or server.host configuration to allow external access). Restrict access to the dev server to trusted local environments only. Check the official Vite release notes or vendor advisory for the exact patched versions and update instructions.
Vite allows server.fs.deny to be bypassed with .svg or relative paths (CVE-2025-31486)
Description
Vite versions from 2.5.1 up to but not including 6.2.5 contain a vulnerability (CVE-2025-31486) that allows an attacker to bypass the server.fs.deny file access restrictions. This enables the contents of arbitrary files to be returned to the browser when the Vite development server is exposed to the network. The bypass leverages requests ending with .svg combined with certain query parameters or headers, and also relative path traversal before id normalization. The vulnerability requires the file to be smaller than the default 4kB inline asset limit and affects Vite 6.0 and later. A proof of concept demonstrates reading sensitive files like /etc/passwd via crafted requests. A patch is available to fix this issue.
CVSS v3.1
Score 5.3medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2025-31486 is a vulnerability in Vite dev server versions >=2.5.1 <6.2.5 that allows bypassing the server.fs.deny restriction to read arbitrary files. The bypass exploits two mechanisms: requests ending with .svg combined with query parameters or headers that cause the server to inline small assets, and relative path traversal due to checks applied before id normalization. This vulnerability only affects applications explicitly exposing the Vite dev server to the network (e.g., using --host). The flaw enables an attacker to retrieve arbitrary file contents from the server filesystem, demonstrated by reading /etc/passwd. The vulnerability has a CVSS 3.1 score of 5.3 (medium severity). A patch is available to address this issue.
Potential Impact
An attacker can retrieve the contents of arbitrary files from the server running the Vite development server if it is exposed to the network. This can lead to disclosure of sensitive information. The vulnerability requires network exposure of the dev server and files smaller than the inline asset limit (default 4kB) for the .svg bypass. The relative path bypass allows traversal to arbitrary files. There is no indication of code execution or integrity impact. The CVSS score is 5.3, reflecting a medium severity confidentiality impact with high attack complexity and required user interaction.
Mitigation Recommendations
A patch is available for Vite versions affected by this vulnerability. Users should upgrade to version 6.2.5 or later where this issue is fixed. If upgrading immediately is not possible, avoid exposing the Vite development server to the network (do not use --host or server.host configuration to allow external access). Restrict access to the dev server to trusted local environments only. Check the official Vite release notes or vendor advisory for the exact patched versions and update instructions.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-vite-CVE-2025-31486
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 3.1
Threat ID: 6abb419af7a7c54106cc3872
Added to database: 09/29/2026, 04:42:02 UTC
Last enriched: 09/29/2026, 04:54:21 UTC
Last updated: 09/29/2026, 18:11:14 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.