CVE-2023-49293: vitejs vite · Cross-site Scripting
Affects vitejs viteSource CVE Database V5
Not known to be exploited · public detection template (Nuclei) · CVSS 6.1 Medium.
Data as of 26 Oct 2026, 11:42 UTC
- EPSS
- 0.9% chance of exploitation in 30 days – higher than 62% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NExploitation evidence
Disclosed: evidence found.
CVE published 4 Dec 2023
Detectable: evidence found.
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
npmvitejs/vitepkg:npm/vitejs/viteOther threats | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
The most effective mitigation is to upgrade Vite to a patched version: 5.0.5, 4.5.1, or 4.4.12 or later. Organizations should enforce strict version control and dependency management to ensure vulnerable versions are not used. Additionally, developers should avoid using appType: 'custom' with the default Vite HTML middleware if possible or sanitize any user-controllable inputs passed to server.transformIndexHtml. Implementing Content Security Policy (CSP) headers during development can help mitigate the impact of injected scripts. Educating developers about the risks of clicking untrusted URLs while running development servers is also important. Network segmentation can limit exposure of development servers to untrusted networks. Monitoring for suspicious URL access patterns and anomalous script injections in development environments can provide early detection. Since no workarounds exist, prioritizing patching is critical. Finally, organizations should review their internal development workflows to minimize exposure to such vulnerabilities.
Description
Vite is a website frontend framework. When Vite's HTML transformation is invoked manually via `server.transformIndexHtml`, the original request URL is passed in unmodified, and the `html` being transformed contains inline module scripts (`<script type="module">...</script>`), it is possible to inject arbitrary HTML into the transformed output by supplying a malicious URL query string to `server.transformIndexHtml`. Only apps using `appType: 'custom'` and using the default Vite HTML middleware are affected. The HTML entry must also contain an inline script. The attack requires a user to click on a malicious URL while running the dev server. Restricted files aren't exposed to the attacker. This issue has been addressed in vite@5.0.5, vite@4.5.1, and vite@4.4.12. There are no known workarounds for this vulnerability.