CVE-2024-45812
DOM Clobbering gadget found in vite bundled scripts that leads to XSS in Vite
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.
Exposure status: unknown. This page does not establish whether an installed system is affected or corrected.
Severity and exploitation evidence
EPSS: 0.636% · score date 2026-11-19. EPSS is an estimated probability over the next 30 days, not proof of exploitation.
CISA KEV: not included in the checked catalog; exploitation may still occur. Last checked: 2026-11-19T17:28:52.703Z. Public exploit availability is not used to set this status.
CVSS 3.1 · 6.4 · published by GitHub_MCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H
Assessment source · checked 2026-11-19T12:57:18.593Z
Verification by field
| Field | Status | Checked at (UTC) | Source |
|---|---|---|---|
| kev | verified | 2026-11-19T17:28:52.703Z | CISA KEV |
| cvss | verified | 2026-11-19T12:57:18.593Z | CVE Program |
| epss | verified | 2026-11-19T16:04:39.116Z | FIRST EPSS |
| patches | verified | 2026-11-19T12:51:58.234Z | OSV |
| affected | verified | 2026-11-19T12:57:18.593Z | CVE Program |
| lifecycle | verified | 2026-11-19T12:57:18.593Z | CVE Program |
Affected versions and configuration
vitejs vite; default status: unknown: >= 5.4.0, < 5.4.6 [affected; scheme: unspecified]; >= 5.3.0, < 5.3.6 [affected; scheme: unspecified]; >= 5.0.0, < 5.2.14 [affected; scheme: unspecified]; >= 4.0.0, < 4.5.5 [affected; scheme: unspecified]; < 3.2.11 [affected; scheme: unspecified]
Defaults, conditional configuration, package status and version schemes are retained below. A version range alone is not an exposure verdict.
CVE Program · cve-json · full conditions
{
"affected": [
{
"vendor": "vitejs",
"product": "vite",
"versions": [
{
"status": "affected",
"version": ">= 5.4.0, < 5.4.6"
},
{
"status": "affected",
"version": ">= 5.3.0, < 5.3.6"
},
{
"status": "affected",
"version": ">= 5.0.0, < 5.2.14"
},
{
"status": "affected",
"version": ">= 4.0.0, < 4.5.5"
},
{
"status": "affected",
"version": "< 3.2.11"
}
]
}
],
"additionalContainers": [
{
"title": "CISA ADP Vulnrichment",
"metrics": [
{
"other": {
"type": "ssvc",
"content": {
"id": "CVE-2024-45812",
"role": "CISA Coordinator",
"options": [
{
"Exploitation": "poc"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"version": "2.0.3",
"timestamp": "2024-09-18T13:57:07.046459Z"
}
}
}
],
"affected": [
{
"cpes": [
"cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*"
],
"vendor": "vitejs",
"product": "vite",
"versions": [
{
"status": "affected",
"version": "5.4.0",
"lessThan": "5.4.6",
"versionType": "custom"
},
{
"status": "affected",
"version": "5.3.0",
"lessThan": "5.3.6",
"versionType": "custom"
},
{
"status": "affected",
"version": "5.0.0",
"lessThan": "5.2.14",
"versionType": "custom"
},
{
"status": "affected",
"version": "4.0.0",
"lessThan": "4.5.5",
"versionType": "custom"
},
{
"status": "affected",
"version": "0",
"lessThan": "3.2.11",
"versionType": "custom"
}
],
"defaultStatus": "unknown"
}
],
"providerMetadata": {
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP",
"dateUpdated": "2024-09-18T13:59:14.314Z"
}
}
]
}Archived source JSONOSV · osv · full conditions
{
"id": "GHSA-64vr-g452-qvp3",
"aliases": [
"CVE-2024-45812"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "5.4.0"
},
{
"fixed": "5.4.6"
}
]
}
],
"package": {
"name": "vite",
"purl": "pkg:npm/vite",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/09/GHSA-64vr-g452-qvp3/GHSA-64vr-g452-qvp3.json"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "5.3.0"
},
{
"fixed": "5.3.6"
}
]
}
],
"package": {
"name": "vite",
"purl": "pkg:npm/vite",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/09/GHSA-64vr-g452-qvp3/GHSA-64vr-g452-qvp3.json"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "5.2.0"
},
{
"fixed": "5.2.14"
}
]
}
],
"package": {
"name": "vite",
"purl": "pkg:npm/vite",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/09/GHSA-64vr-g452-qvp3/GHSA-64vr-g452-qvp3.json"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "4.0.0"
},
{
"fixed": "4.5.4"
}
]
}
],
"package": {
"name": "vite",
"purl": "pkg:npm/vite",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/09/GHSA-64vr-g452-qvp3/GHSA-64vr-g452-qvp3.json"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "3.2.11"
}
]
}
],
"package": {
"name": "vite",
"purl": "pkg:npm/vite",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/09/GHSA-64vr-g452-qvp3/GHSA-64vr-g452-qvp3.json"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "5.0.0"
},
{
"fixed": "5.1.8"
}
]
}
],
"package": {
"name": "vite",
"purl": "pkg:npm/vite",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/09/GHSA-64vr-g452-qvp3/GHSA-64vr-g452-qvp3.json"
}
}
],
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H"
},
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
}
],
"upstream": [],
"withdrawn": null,
"references": [
{
"url": "https://github.com/vitejs/vite/security/advisories/GHSA-64vr-g452-qvp3",
"type": "WEB"
},
{
"url": "https://github.com/webpack/webpack/security/advisories/GHSA-4vvj-4cpr-p986",
"type": "WEB"
},
{
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-45812",
"type": "ADVISORY"
},
{
"url": "https://github.com/vitejs/vite/commit/179b17773cf35c73ddb041f9e6c703fd9f3126af",
"type": "WEB"
},
{
"url": "https://github.com/vitejs/vite/commit/2691bb3ff6b073b41fb9046909e1e03a74e36675",
"type": "WEB"
},
{
"url": "https://github.com/vitejs/vite/commit/2ddd8541ec3b2d2e5b698749e0f2362ef28056bd",
"type": "WEB"
},
{
"url": "https://github.com/vitejs/vite/commit/ade1d89660e17eedfd35652165b0c26905259fad",
"type": "WEB"
},
{
"url": "https://github.com/vitejs/vite/commit/e8127166979e7ace6eeaa2c3b733c8994caa31f3",
"type": "WEB"
},
{
"url": "https://github.com/vitejs/vite/commit/ebb94c5b3bf41950f45562595adec117a4d0ba5e",
"type": "WEB"
},
{
"url": "https://github.com/vitejs/vite",
"type": "PACKAGE"
},
{
"url": "https://research.securitum.com/xss-in-amp4email-dom-clobbering",
"type": "WEB"
},
{
"url": "https://scnps.co/papers/sp23_domclob.pdf",
"type": "WEB"
}
],
"relatedGitRanges": [],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": "2024-09-17T20:15:06Z",
"github_reviewed_at": "2024-09-17T19:28:01Z"
}
}Archived source JSONCorrection evidence
Distribution packages and upstream releases are distinct. ESM channels may require the corresponding Ubuntu entitlement. Notes and branch ranges are not installable package versions. OSV fixed boundaries are ecosystem-specific version thresholds, not proof that a package is currently available or installed.
| Evidence type | Distribution / release | Package | Channel | Version or source note | Source |
|---|---|---|---|---|---|
| ecosystem-boundary | npm / package | vite | Not a distribution channel | 5.4.6 | Official record |
| ecosystem-boundary | npm / package | vite | Not a distribution channel | 5.3.6 | Official record |
| ecosystem-boundary | npm / package | vite | Not a distribution channel | 5.2.14 | Official record |
| ecosystem-boundary | npm / package | vite | Not a distribution channel | 4.5.4 | Official record |
| ecosystem-boundary | npm / package | vite | Not a distribution channel | 3.2.11 | Official record |
| ecosystem-boundary | npm / package | vite | Not a distribution channel | 5.1.8 | Official record |
Vendor notices and operational guidance
No connected vendor notice is available for this record.
Original sources and dates
- CISA KEVConsulted: 2026-11-19T17:28:52.703ZArchived source JSON
Source publication: not supplied
Source modification: 2026-11-18T19:17:41.0354ZDocument fingerprint
a35fdc67c7d9802988dcfc1d3ff1198da327948d1db122ab7692ac201055ac56 - OSVConsulted: 2026-11-19T12:51:58.234ZArchived source JSON
Source publication: 2024-09-17T19:28:01.000Z
Source modification: 2026-09-10T03:50:18.740ZDocument fingerprint
18ee2ac2ac93eab49131193db51d1c75d04979859dfd42d9bef2e8f57776c368 - CVE ProgramConsulted: 2026-11-19T12:57:18.593ZArchived source JSON
Source publication: 2024-09-17T20:08:13.372Z
Source modification: 2024-09-18T13:59:14.314ZDocument fingerprint
960bc817c4b082d696962b1be84ef5ded2f099d068579278ad5cd91a43bd6967 - FIRST EPSSConsulted: 2026-11-19T16:04:39.116ZArchived source JSON
Source publication: not supplied
Source modification: not suppliedDocument fingerprint
9f0dcd79a206c1e9df7af3ccc3246b94763cde2daafc074aaa6c06dadb41d7a7
Official status history
- UNKNOWN → PUBLISHED · · evidence