{"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-11-13T05:00:26.659808Z","published":"2023-12-04T23:03:30.752Z","database_specific":{"unresolved_ranges":[{"extracted_events":[{"range":[{"introduced":"= 4.5.0"},{"last_affected":"= 4.5.0"}],"source":"AFFECTED_FIELD","strategy":"StandaloneSingleVersion"}]},{"extracted_events":[{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"4.4.0"},{"fixed":"4.4.12"},{"introduced":"5.0.0"},{"fixed":"5.0.5"}]}]}],"cna_assigner":"GitHub_M","cwe_ids":["CWE-79"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/49xxx/CVE-2023-49293.json"},"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"},{"last_affected":"b50db04a5a47aa855cae6ced026290c2761ffa8d"},{"introduced":"0c3125833033fec4356ab4e90e806e02e8644c40"},{"last_affected":"73ef074b80fa7252e0c46a37a2c94ba8cba46504"},{"last_affected":"0c3125833033fec4356ab4e90e806e02e8644c40"}],"database_specific":{"extracted_events":[{"range":[{"introduced":"4.4.0"},{"last_affected":"4.4.11"}],"source":"CPE_RANGE","cpe":"cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*"},{"range":[{"introduced":"5.0.0"},{"last_affected":"5.0.4"}],"source":"CPE_RANGE","cpe":"cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*"},{"cpe":"cpe:2.3:a:vitejs:vite:5.0.0:-:*:*:*:node.js:*:*","range":[{"introduced":"5.0.0-NA"},{"last_affected":"5.0.0-NA"}],"source":"CPE_STRING"}]}}],"versions":["v4.4.11","v5.0.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/osv-test-cve-osv-conversion/osv-output/CVE-2023-49293.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"}]}