cve.bz

CVE-2023-49293 vitejs vite: Cross-site Scripting

6.1 mediumExploit referenceEPSS 1.0%Fix available

Medium (6.1) in vitejs vite. EPSS 1.0% estimated probability of exploitation activity in the next 30 days. Fixed in vite 4.4.12, 4.5.1, 5.0.5.

On this page
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.

Severity

CVSS 3.1

6.1 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
EPSS
1.0% (unchanged from 1.0% a week ago; 1.0% 30 days ago) estimated probability of exploitation activity in the next 30 days; 64th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2025-05-29. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-79 Improper Neutralization of Input During Web Page Generation (Cross-site Scripting)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

  • vite (npm): fixed in 4.4.12, 4.5.1, 5.0.5

Ask an AI about this CVE

Show the promptExplain CVE-2023-49293 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2023-49293?via=ask-ai-copy and https://cve.bz/cve/CVE-2023-49293?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2023-49293 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
vitejs:vitefrom 4.4.0 through 4.4.11
vitejs:vitefrom 5.0.0 through 5.0.4
vitejs:vite5.0.0
vitejs:vite5.0.0:beta0
vitejs:vite5.0.0:beta1
vitejs:vite5.0.0:beta10
vitejs:vite5.0.0:beta11
vitejs:vite5.0.0:beta12
vitejs:vite5.0.0:beta13
vitejs:vite5.0.0:beta14
vitejs:vite5.0.0:beta15
vitejs:vite5.0.0:beta16
vitejs:vite5.0.0:beta17
vitejs:vite5.0.0:beta18
vitejs:vite5.0.0:beta19
vitejs:vite5.0.0:beta2
vitejs:vite5.0.0:beta20
vitejs:vite5.0.0:beta3
vitejs:vite5.0.0:beta4
vitejs:vite5.0.0:beta5
vitejs:vite5.0.0:beta6
vitejs:vite5.0.0:beta7
vitejs:vite5.0.0:beta8
vitejs:vite5.0.0:beta9

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-92r3-m2mg-pj97npmvite>=4.4.0 <4.4.124.4.12
GHSA-92r3-m2mg-pj97npmvite>=4.5.0 <4.5.14.5.1
GHSA-92r3-m2mg-pj97npmvite>=5.0.0 <5.0.55.0.5

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

The vulnerability within Vite's HTML transformation process poses a moderate severity issue due to its potential for exploitation in specific development environments. While it requires certain conditions to be met, such as utilizing the appType: 'custom' configuration and containing inline module scripts in the HTML, the impact can still be significant. Attackers can inject arbitrary HTML into the transformed output by manipulating the request URL, leading to Cross-Site Scripting (XSS) attacks. Although exploitation relies on users clicking on malicious URLs during development server runtime, the ability to inject arbitrary code into the transformed output could facilitate further attacks or unauthorized access to sensitive data.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2automation-controllerNot affected
Red Hat Ansible Automation Platform 2automation-eda-controllerNot affected
Red Hat Build of KeycloakvitejsWill not fix
Red Hat JBoss Enterprise Application Platform 8vitejsNot affected
Red Hat OpenShift distributed tracing 2rhosdt/jaeger-agent-rhel8Affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2023-49293.

Detection rules

Ways to detect this CVE, not exploit code: the nuclei template that checks a system for it, and the Suricata and Snort rules that name it. A rule set may ship a rule turned off, so check yours by its sid.

Attack patterns (CAPEC)

  • CAPEC-63 Cross-Site Scripting (XSS) Likelihood: High · Severity: Very High
  • CAPEC-85 AJAX Footprinting Likelihood: High · Severity: Low
  • CAPEC-209 XSS Using MIME Type Mismatch Severity: Medium
  • CAPEC-588 DOM-Based XSS Likelihood: High · Severity: Very High
  • CAPEC-591 Reflected XSS Likelihood: High · Severity: Very High
  • CAPEC-592 Stored XSS Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON