Summary
A vulnerability in Vite (from 4.0.0 up to the fixed releases) and in vite-plus (before 1.5.1) is caused by improper output escaping (CWE-116). A network-exposed development server embeds request-derived module identifiers from the __vite-browser-external:<suffix> and __vite-optional-peer-dep:<suffix> virtual modules into trusted generated JavaScript without escaping them.
According to the CVSS 4.0 vector (score 9.1, critical), the attack is network-based, low complexity, and requires no authentication or user interaction. The precondition is that the development server is reachable by the attacker over the network (AT:P). The attacker can add an outside file to the server.fs allow list and reach server-side evaluation through new Worker or import.meta.glob processing.
The impact is disclosure of local files and arbitrary code execution in the development server process. The vulnerability is not listed in CISA KEV; EPSS is about 1.8% (79th percentile).
Who is affected
Development teams and organizations using Vite or vite-plus, especially where the development server is reachable over the network (e.g. started with --host or server.host).
What to do
- Upgrade Vite to the fixed release for your branch: 6.4.6, 7.3.8, 8.1.7, 8.2.5 or 8.3.7.
- Upgrade vite-plus to version 1.5.1 or later.
- Check installed versions across projects and CI environments (e.g. npm ls vite) and update lock files.
- Do not expose the dev server to the network: check for --host or server.host usage and restrict access to localhost or a trusted network.
- See the official advisory GHSA-p4f5-76q4-ffq7 on GitHub for details.
Affected products and versions
CVSS vector, explained
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
- Attack vector
- Network (from the internet)
- Attack complexity
- Low
- Attack requirements
- Present
- Privileges required
- None (no login)
- User interaction
- Not required
- Confidentiality
- High impact
- Integrity
- High impact
- Availability
- None
Weakness type (CWE)
- CWE-116 Improper Encoding or Escaping of Output
References
- github.com/vitejs/vite/security/advisories/GHSA-p4f5-76q4-ffq7
- github.com/vitejs/vite/pull/24043
- github.com/vitejs/vite/pull/24044
- github.com/vitejs/vite/commit/4b4291018a34d1591a6a18ab5c406d5b6a7a4ea1
- github.com/vitejs/vite/commit/517affb174632db347a6a2426f12eab020277946
- github.com/vitejs/vite/commit/8ef8a1b27bcd0e8e7693569f98b52b1b111025ca
- github.com/vitejs/vite/commit/e5f23b60f0c46a906a60986faad88a5bd7611a15
- github.com/vitejs/vite/blob/v6.4.6/packages/vite/CHANGELOG.md
- github.com/vitejs/vite/blob/v7.3.8/packages/vite/CHANGELOG.md
- github.com/vitejs/vite/blob/v8.1.7/packages/vite/CHANGELOG.md
- github.com/vitejs/vite/blob/v8.2.5/packages/vite/CHANGELOG.md
- github.com/vitejs/vite/releases/tag/v6.4.6
- github.com/vitejs/vite/releases/tag/v7.3.8
- github.com/vitejs/vite/releases/tag/v8.1.7
- github.com/vitejs/vite/releases/tag/v8.2.5
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Always check the vendor's official advisory.