{"id":"CVE-2023-49293","summary":"Cross-site Scripting in `server.transformIndexHtml` via URL payload in vite","details":"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 (`\u003cscript type=\"module\"\u003e...\u003c/script\u003e`), 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.","aliases":["GHSA-92r3-m2mg-pj97"],"modified":"2026-08-12T03:51:14.747764821Z","published":"2023-12-04T23:03:30.752Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/49xxx/CVE-2023-49293.json","cna_assigner":"GitHub_M","cwe_ids":["CWE-79"]},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/49xxx/CVE-2023-49293.json"},{"type":"ADVISORY","url":"https://github.com/vitejs/vite/security/advisories/GHSA-92r3-m2mg-pj97"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-49293"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/vitejs/vite","events":[{"introduced":"3b47e34af89b8220c0aeb119f813e8315e98668e"},{"fixed":"09626f898bbb9e3d68facd0330d4a0acef0cba6a"},{"introduced":"0c3125833033fec4356ab4e90e806e02e8644c40"},{"fixed":"fa7976732e815a7f4268369596f6df872201d0e9"},{"introduced":"055d2b86b0543a7c1a2a4d5bc7298af62bc51fa7"},{"last_affected":"055d2b86b0543a7c1a2a4d5bc7298af62bc51fa7"}],"database_specific":{"source":"AFFECTED_FIELD","extracted_events":[{"introduced":"4.4.0"},{"fixed":"4.4.12"},{"introduced":"5.0.0"},{"fixed":"5.0.5"},{"introduced":"= 4.5.0"},{"last_affected":"= 4.5.0"}]}}],"versions":["= 4.5.0","v4.4.11","v5.0.4","v5.0.3","plugin-legacy@5.2.0","v5.0.2","plugin-legacy@5.1.0","v5.0.1","create-vite@5.0.0","plugin-legacy@5.0.0","v5.0.0","v4.5.0","v4.4.10","v4.4.9","v4.4.8","v4.4.7","v4.4.6","create-vite@4.4.1","plugin-legacy@4.1.1","v4.4.5","v4.4.4","v4.4.3","v4.4.2","v4.4.1","create-vite@4.4.0","plugin-legacy@4.1.0","v4.4.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-49293.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"}]}