
Vite, the blazing-fast frontend build tool that powers millions of modern web applications, has been found vulnerable to a file access control bypass flaw that could expose arbitrary file contents to the browser. This flaw, identified as CVE-2025-30208, allows attackers to bypass file system restrictions and potentially access sensitive information.
The vulnerability lies in how Vite’s development server handles file requests. Normally, Vite restricts access to files outside of a specified allow list. However, it has been discovered that by adding specific parameters like “?raw??” or “?import&raw??” to the URL, this restriction can be bypassed. This loophole allows attackers to retrieve the contents of arbitrary files on the server.
The good news is that the impact of this vulnerability is somewhat limited. Only applications that explicitly expose the Vite development server to the network are affected. This typically requires using the –host or server.host configuration options. However, for those applications that do expose the dev server, the consequences can be severe, potentially leading to the exposure of sensitive data.
The vulnerability exists due to how Vite processes URL requests. Trailing separators, such as the question mark (“?”), are removed in certain parts of the code. However, the query string regexes do not account for these trailing separators, creating an opening for the bypass.
A proof-of-concept (PoC) exploit is available on Github, demonstrating the CVE-2025-30208 vulnerability. This PoC shows how an attacker could craft a malicious URL to read files that should be protected. In a particularly concerning scenario, the PoC attempts to access the /root/.bash_history file to extract potentially sensitive information like account passwords.
The following versions of Vite are affected by this vulnerability:
- = 6.2.0, <= 6.2.2
- = 6.1.0, <= 6.1.1
- = 6.0.0, <= 6.0.11
- = 5.0.0, <= 5.4.14
- <= 4.5.9
The following versions contain the patch and resolve this vulnerability:
- = 6.2.3
- = 6.1.2, < 6.2.0
- = 6.0.12, < 6.1.0
- = 5.4.15, < 6.0.0
- = 4.5.10, < 5.0.0
If you are using a vulnerable version of Vite and exposing your development server to the network, it is critical to update to a patched version immediately. This will eliminate the risk of unauthorized file access and protect your sensitive data. Additionally, it’s a good security practice to avoid exposing development servers to the network whenever possible.