# CVE-2023-49293: Cross-site Scripting in `server.transformIndexHtml` via URL payload in vite

- Severity: Medium 6.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.00%, higher than 63% of CVEs (2026-12-02)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2023-12-04T23:03:30.752Z
- Modified: 2026-06-17T06:35:47.193Z
- Also known as: GHSA-92r3-m2mg-pj97
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- vitejs vite: >=4.4.0, < 4.4.12; = 4.5.0; >=5.0.0, < 5.0.5; from 4.4.0 up to 4.4.11; from 5.0.0 up to 5.0.4; 5.0.0
- vite (npm): from 4.4.0 before 4.4.12; from 4.5.0 before 4.5.1; from 5.0.0 before 5.0.5

## Every score

- GitHub_M: 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`
- GitHub: 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`
- NVD: 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`

## References

- <https://github.com/vitejs/vite/security/advisories/GHSA-92r3-m2mg-pj97> (exploit, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-49293> (advisory)
- <https://github.com/vitejs/vite> (package)

## Sources

- CVE List: [CVE-2023-49293](https://www.cve.org/CVERecord?id=CVE-2023-49293), CVE Terms of Use, modified 2025-05-29
- GitHub Advisory Database: [GHSA-92r3-m2mg-pj97](https://github.com/advisories/GHSA-92r3-m2mg-pj97), CC-BY-4.0, modified 2023-12-06
- NVD: [CVE-2023-49293](https://nvd.nist.gov/vuln/detail/CVE-2023-49293), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-49293 · Whole record: https://cve.day/CVE-2023-49293.json · Rebuilt by cve.day 2026-11-25T22:58:30.943Z
