Code Exposure Vulnerability in Vite Frontend Tooling Framework
CVE-2025-31125
Key Information:
Badges
What is CVE-2025-31125?
CVE-2025-31125 is a code exposure vulnerability found in the Vite frontend tooling framework, which is widely utilized for building JavaScript applications. This vulnerability relates to the unintended exposure of the content of sensitive files when specific configuration options, such as --host
or server.host
, are used. Organizations that expose the Vite development server to the network may face significant risks, as this vulnerability could allow attackers to access restricted information, potentially compromising application integrity and sensitive data.
Technical Details
This vulnerability arises from the way Vite processes requests with specific query parameters, namely ?inline&import
and ?raw?import
. Under certain conditions, such as when the dev server is made publicly accessible, users can end up inadvertently exposing non-allowed file contents to anyone who can access the server. The flaw has been addressed in several updated versions of the framework, including 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.
Potential impact of CVE-2025-31125
-
Data Exposure: The vulnerability allows unauthorized access to sensitive information that should remain confidential, putting user data and proprietary code at risk.
-
Reputational Damage: Organizations affected by this vulnerability may suffer reputational harm in the event of data exposure or misuse, leading to a loss of customer trust and potential legal implications.
-
Increased Attack Surface: By exposing critical files, this vulnerability could be leveraged by attackers to further exploit the system, leading to additional risks such as unauthorized access to other systems or data breaches.
Affected Version(s)
vite >= 6.2.0, < 6.2.4 < 6.2.0, 6.2.4
vite >= 6.1.0, < 6.1.3 < 6.1.0, 6.1.3
vite >= 6.0.0, < 6.0.13 < 6.0.0, 6.0.13
Exploit Proof of Concept (PoC)
PoC code is written by security researchers to demonstrate the vulnerability can be exploited. PoC code is also a key component for weaponization which could lead to ransomware.
References
EPSS Score
8% chance of being exploited in the next 30 days.
CVSS V3.1
Timeline
- 🟡
Public PoC available
- 👾
Exploit known to exist
Vulnerability published
Vulnerability Reserved