CVEMETERBack to radar
OFFICIAL RECORD · JavaScript packages

CVE-2024-45812

PUBLISHEDOfficial status check: verifiedCVSS 3.1: 6.4 · medium

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_M
CVSS: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

FieldStatusChecked at (UTC)Source
kevverified2026-11-19T17:28:52.703ZCISA KEV
cvssverified2026-11-19T12:57:18.593ZCVE Program
epssverified2026-11-19T16:04:39.116ZFIRST EPSS
patchesverified2026-11-19T12:51:58.234ZOSV
affectedverified2026-11-19T12:57:18.593ZCVE Program
lifecycleverified2026-11-19T12:57:18.593ZCVE 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 JSON
OSV · 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 JSON

Correction 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 typeDistribution / releasePackageChannelVersion or source noteSource
ecosystem-boundarynpm / packageviteNot a distribution channel5.4.6Official record
ecosystem-boundarynpm / packageviteNot a distribution channel5.3.6Official record
ecosystem-boundarynpm / packageviteNot a distribution channel5.2.14Official record
ecosystem-boundarynpm / packageviteNot a distribution channel4.5.4Official record
ecosystem-boundarynpm / packageviteNot a distribution channel3.2.11Official record
ecosystem-boundarynpm / packageviteNot a distribution channel5.1.8Official record

Vendor notices and operational guidance

No connected vendor notice is available for this record.

Original sources and dates

Official status history