Cross-Site Scripting (XSS) Affecting vite package, versions >=4.4.0-beta.2 <4.4.12 >=4.5.0 <4.5.1 >=5.0.0-beta.0 <5.0.5
Threat Intelligence
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-JS-VITE-6098386
- published 5 Dec 2023
- disclosed 5 Dec 2023
- credit Max Kukartsev
Introduced: 5 Dec 2023
CVE-2023-49293 Open this link in a new tabHow to fix?
Upgrade vite
to version 4.4.12, 4.5.1, 5.0.5 or higher.
Overview
vite is a Native-ESM powered web dev build tool
Affected versions of this package are vulnerable to Cross-Site Scripting (XSS) when the HTML transformation function is invoked manually through server.transformIndexHtml
. The original request URL is passed in unmodified. If the html
being transformed contains inline module scripts, it is possible to inject arbitrary HTML into the transformed output by supplying a malicious URL query string to server.transformIndexHtml
.
This is exploitable by convincing a user running a dev server with appType: 'custom'
set and the default HTML middleware, to follow a malicious link. Additionally, restricted files aren't exposed to the attacker.
PoC
http://localhost:5173/?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3E