CVE-2026-140097
Description
A flaw was found in Vite. A remote unauthenticated attacker can exploit this vulnerability to execute arbitrary code or read sensitive files on the server host. By sending crafted network requests with unescaped module identifiers to the development server, an attacker can bypass file system restrictions and force the server to evaluate untrusted code.
Statement
This vulnerability is rated as Important because an unauthenticated remote attacker can achieve arbitrary code execution or access local files on hosts running a network-exposed development server. In Red Hat products and environments, Vite is primarily utilized as a development-time asset bundler and build tool rather than a production runtime service. Built production artifacts are not affected, as exposure is limited to systems executing the active development server while bound to accessible network interfaces.
Mitigation
To mitigate this issue, restrict the Vite development server so that it binds exclusively to the localhost loopback interface and is not exposed to untrusted networks.
1. Ensure Vite is configured to bind to `127.0.0.1` in `vite.config.js`:
javascriptAvoid specifying `--host 0.0.0.0` or setting `server.host: true` when running development servers.
export default {
server: {
host: '127.0.0.1'
}
}
2. Restrict external network access to the development server port (default 5173) using firewalld:
bash
sudo firewall-cmd --zone=public --remove-port=5173/tcp --permanent
sudo firewall-cmd --reload
Caveats: Restricting binding or port access will prevent remote network devices from connecting to the development server.
Warning: Reloading firewall configurations or restarting development instances will briefly interrupt active network connections.
Common Vulnerability Scoring System (CVSS) Score Details
Info alert:Important note
CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).
The following CVSS metrics and score provided are preliminary and subject to review.
CVSS v3 Score Breakdown
| Red Hat | NVD | cve.org | |
|---|---|---|---|
| Base Score | 8.1 | N/A | N/A |
| Attack Vector | Network | N/A | N/A |
| Attack Complexity | High | N/A | N/A |
| Privileges Required | None | N/A | N/A |
| User Interaction | None | N/A | N/A |
| Scope | Unchanged | N/A | N/A |
| Confidentiality | High | N/A | N/A |
| Integrity Impact | High | N/A | N/A |
| Availability Impact | High | N/A | N/A |
Vector
Red Hat: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Understanding the Weakness (CWE)
Access Control
Technical Impact: Bypass Protection Mechanism
In some cases, injectable code controls authentication; this may lead to a remote vulnerability.
Access Control
Technical Impact: Gain Privileges or Assume Identity
Injected code can access resources that the attacker is directly prevented from accessing.
Integrity,Confidentiality,Availability
Technical Impact: Execute Unauthorized Code or Commands
When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. As a result, code injection can often result in the execution of arbitrary code. Code injection attacks can also lead to loss of data integrity in nearly all cases, since the control-plane data injected is always incidental to data recall or writing.
Non-Repudiation
Technical Impact: Hide Activities
Often the actions performed by injected control code are unlogged.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.