llamaCVEVulnerability Intelligence
/
vite

CVE-2024-45812

DOM Clobbering gadget found in vite bundled scripts that leads to XSS in Vite

Parche disponiblecross-site scripting (XSS)
Descargar PNG JSON
CVSS 3.1
6.4
Media
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H Fuente: CNA
ExplotaciónPoC públicaSSVC: poc · no figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche6 versionesPrimer parche a -1 d de la divulgación
Exposición792 dDesde la divulgación, 17 sept 2024, 3:08 p. m.
Detección790 dDesde la divulgación hasta su ingreso al índice
Decisión SSVCSeguir de cerca
Monitorear y programar la remediación
Existe PoC pública, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Evaluación SSVC +1
Explotación
Remediación
Parche 4.5.5 +3
Parche 3.2.11
Parche 5.1.8
Monitoreo
Detectada
16 sept 24
17 sept 24
18 sept 24
19 sept 24
17 nov 26
19 nov 26
16 sept 24
3 abr 25
18 oct 25
5 may 26
19 nov 26
FechaFaseEventoDetalle
Remediación Parche 4.5.5 vite · -1 d desde divulgación
Remediación Parche 5.2.14 vite · -1 d desde divulgación
Remediación Parche 5.3.6 vite · -1 d desde divulgación
Remediación Parche 5.4.6 vite · -1 d desde divulgación
Divulgación Publicada CVE-2024-45812 divulgada · CVSS 6.4 (CNA)
Remediación Parche 3.2.11 vite · 0 d desde divulgación
Divulgación Evaluación SSVC CISA-ADP · explotación PoC pública
Divulgación Modificada Última actualización del registro
Remediación Parche 5.1.8 vite · 2 d desde divulgación
Monitoreo Detectada Ingresó al índice
Resumen

Vite a frontend build tooling framework for javascript. Affected versions of vite were discovered to contain a DOM Clobbering vulnerability when building scripts to `cjs`/`iife`/`umd` output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present. DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. We have identified a DOM Clobbering vulnerability in Vite bundled scripts, particularly when the scripts dynamically import other scripts from the assets folder and the developer sets the build output format to `cjs`, `iife`, or `umd`. In such cases, Vite replaces relative paths starting with `__VITE_ASSET__` using the URL retrieved from `document.currentScript`. However, this implementation is vulnerable to a DOM Clobbering attack. The `document.currentScript` lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server. This vulnerability can result in cross-site scripting (XSS) attacks on websites that include Vite-bundled files (configured with an output format of `cjs`, `iife`, or `umd`) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes. This issue has been patched in versions 5.4.6, 5.3.6, 5.2.14, 4.5.5, and 3.2.11. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · CNA
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:L
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
vite< 3.2.11
vite≥ 4.0.0 < 4.5.4
vite≥ 4.0.0 < 4.5.5
vite≥ 5.0.0 < 5.1.8
vite≥ 5.0.0 < 5.2.14
vite≥ 5.2.0 < 5.2.14
vite≥ 5.3.0 < 5.3.6
vite≥ 5.4.0 < 5.4.6
3.2.11
4.5.4
4.5.5
5.0.0
5.1.8
5.2.0
5.2.14
5.3.0
5.3.6
5.4.0
5.4.6
8.3.8
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmvite
Corregida 3.2.11, 4.5.5, 5.1.8, 5.2.14, 5.3.6, 5.4.6 0 d · -1 d · 2 d · -1 d · -1 d · -1 d 8.3.8 no afectada
Versiones corregidas3.2.114.5.55.1.85.2.145.3.65.4.6
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Fabricantehttps://github.com/vitejs/vite/security/advisories/GHSA-64vr-g452-qvp3
Fabricantehttps://github.com/webpack/webpack/security/advisories/GHSA-4vvj-4cpr-p986
Otrahttps://github.com/vitejs/vite/commit/ade1d89660e17eedfd35652165b0c26905259fad
Otrahttps://research.securitum.com/xss-in-amp4email-dom-clobbering
Otrahttps://scnps.co/papers/sp23_domclob.pdf

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.