CVE-2025-46565: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in vitejs vite
Vite is a frontend tooling framework for javascript. Prior to versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14, the contents of files in the project root that are denied by a file matching pattern can be returned to the browser. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. Only files that are under project root and are denied by a file matching pattern can be bypassed. `server.fs.deny` can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns). These patterns were able to bypass for files under `root` by using a combination of slash and dot (/.). This issue has been patched in versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14.
AI Analysis
Technical Summary
CVE-2025-46565 is a path traversal vulnerability (CWE-22) affecting the Vite frontend tooling framework for JavaScript. Vite is widely used for modern web development to provide fast build and development server capabilities. This vulnerability exists in versions prior to 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14. The flaw allows an attacker to bypass file access restrictions configured via the `server.fs.deny` option, which is intended to prevent certain sensitive files (e.g., .env files, SSL certificates) from being served by the development server. Specifically, when the Vite dev server is explicitly exposed to the network (using the `--host` flag or the `server.host` configuration), an attacker can exploit a path traversal technique involving a combination of slashes and dots (e.g., `/.`) to access files under the project root that should be denied by the configured patterns. This means that files intended to be protected from browser access can be retrieved by an attacker remotely. The vulnerability does not allow access to files outside the project root, but it does undermine the deny-list protections within the root directory. The issue requires the dev server to be network-exposed and some user interaction (e.g., visiting a crafted URL). The vulnerability has been patched in the specified versions. The CVSS 4.0 score is 6.0 (medium severity), reflecting network attack vector, low attack complexity, no privileges required, but requiring user interaction and partial confidentiality impact (disclosure of restricted files). No known exploits are reported in the wild as of now.
Potential Impact
For European organizations, the impact of this vulnerability primarily concerns development environments where Vite dev servers are exposed to the network, such as in collaborative or cloud-based development setups. Unauthorized disclosure of sensitive files like environment variables (.env), private keys, or certificates can lead to leakage of credentials, API keys, or cryptographic material, which can be leveraged for further attacks including privilege escalation, lateral movement, or data breaches. Organizations with strict data protection regulations (e.g., GDPR) may face compliance risks if sensitive information is leaked. The vulnerability does not directly affect production builds or deployed applications but can compromise the confidentiality of development secrets. This is particularly critical for organizations with remote or distributed development teams who may expose dev servers unintentionally. The partial confidentiality impact and the requirement for network exposure limit the scope, but the risk remains significant for improperly configured environments.
Mitigation Recommendations
1. Upgrade Vite to the patched versions: 6.3.4, 6.2.7, 6.1.6, 5.4.19, or 4.5.14 or later. This is the most effective mitigation. 2. Avoid exposing the Vite dev server to the public network. Use localhost-only binding unless absolutely necessary. 3. If network exposure is required, restrict access via firewall rules or VPN to trusted users only. 4. Review and tighten the `server.fs.deny` configuration to explicitly deny sensitive files and directories. 5. Implement additional reverse proxy protections that block suspicious path traversal patterns. 6. Educate development teams about the risks of exposing dev servers and enforce secure development environment policies. 7. Regularly audit development environments for unintended network exposure and sensitive file leaks. 8. Use environment variable injection and secrets management solutions that do not rely on local files accessible to dev servers. 9. Monitor logs for unusual requests that may indicate exploitation attempts involving path traversal sequences.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Denmark, Ireland, Belgium, Poland
CVE-2025-46565: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in vitejs vite
Description
Vite is a frontend tooling framework for javascript. Prior to versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14, the contents of files in the project root that are denied by a file matching pattern can be returned to the browser. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. Only files that are under project root and are denied by a file matching pattern can be bypassed. `server.fs.deny` can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns). These patterns were able to bypass for files under `root` by using a combination of slash and dot (/.). This issue has been patched in versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14.
AI-Powered Analysis
Technical Analysis
CVE-2025-46565 is a path traversal vulnerability (CWE-22) affecting the Vite frontend tooling framework for JavaScript. Vite is widely used for modern web development to provide fast build and development server capabilities. This vulnerability exists in versions prior to 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14. The flaw allows an attacker to bypass file access restrictions configured via the `server.fs.deny` option, which is intended to prevent certain sensitive files (e.g., .env files, SSL certificates) from being served by the development server. Specifically, when the Vite dev server is explicitly exposed to the network (using the `--host` flag or the `server.host` configuration), an attacker can exploit a path traversal technique involving a combination of slashes and dots (e.g., `/.`) to access files under the project root that should be denied by the configured patterns. This means that files intended to be protected from browser access can be retrieved by an attacker remotely. The vulnerability does not allow access to files outside the project root, but it does undermine the deny-list protections within the root directory. The issue requires the dev server to be network-exposed and some user interaction (e.g., visiting a crafted URL). The vulnerability has been patched in the specified versions. The CVSS 4.0 score is 6.0 (medium severity), reflecting network attack vector, low attack complexity, no privileges required, but requiring user interaction and partial confidentiality impact (disclosure of restricted files). No known exploits are reported in the wild as of now.
Potential Impact
For European organizations, the impact of this vulnerability primarily concerns development environments where Vite dev servers are exposed to the network, such as in collaborative or cloud-based development setups. Unauthorized disclosure of sensitive files like environment variables (.env), private keys, or certificates can lead to leakage of credentials, API keys, or cryptographic material, which can be leveraged for further attacks including privilege escalation, lateral movement, or data breaches. Organizations with strict data protection regulations (e.g., GDPR) may face compliance risks if sensitive information is leaked. The vulnerability does not directly affect production builds or deployed applications but can compromise the confidentiality of development secrets. This is particularly critical for organizations with remote or distributed development teams who may expose dev servers unintentionally. The partial confidentiality impact and the requirement for network exposure limit the scope, but the risk remains significant for improperly configured environments.
Mitigation Recommendations
1. Upgrade Vite to the patched versions: 6.3.4, 6.2.7, 6.1.6, 5.4.19, or 4.5.14 or later. This is the most effective mitigation. 2. Avoid exposing the Vite dev server to the public network. Use localhost-only binding unless absolutely necessary. 3. If network exposure is required, restrict access via firewall rules or VPN to trusted users only. 4. Review and tighten the `server.fs.deny` configuration to explicitly deny sensitive files and directories. 5. Implement additional reverse proxy protections that block suspicious path traversal patterns. 6. Educate development teams about the risks of exposing dev servers and enforce secure development environment policies. 7. Regularly audit development environments for unintended network exposure and sensitive file leaks. 8. Use environment variable injection and secrets management solutions that do not rely on local files accessible to dev servers. 9. Monitor logs for unusual requests that may indicate exploitation attempts involving path traversal sequences.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2025-04-24T21:10:48.174Z
- Cisa Enriched
- true
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 682d9838c4522896dcbebdee
Added to database: 5/21/2025, 9:09:12 AM
Last enriched: 6/26/2025, 2:15:41 AM
Last updated: 8/19/2025, 7:56:26 AM
Views: 27
Related Threats
CVE-2025-9169: Cross Site Scripting in SolidInvoice
MediumCVE-2025-9168: Cross Site Scripting in SolidInvoice
MediumCVE-2025-8364: Address bar spoofing using an blob URI on Firefox for Android in Mozilla Firefox
HighCVE-2025-8042: Sandboxed iframe could start downloads in Mozilla Firefox
HighCVE-2025-8041: Incorrect URL truncation in Firefox for Android in Mozilla Firefox
HighActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.