CVE-2023-49293

Public Exploit
Cross-site Scripting in `server.transformIndexHtml` via URL payload in vite

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.

Category

6.1
CVSS
Severity: Medium
CVSS 3.1 •
EPSS 0.26%
Third-Party Advisory github.com
Affected: vitejs vite
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2023-49293?
CVE-2023-49293 has been scored as a medium severity vulnerability.
How to fix CVE-2023-49293?
To fix CVE-2023-49293, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2023-49293 being actively exploited in the wild?
It is possible that CVE-2023-49293 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2023-49293?
CVE-2023-49293 affects vitejs vite.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.