Description
Rollup is a module bundler for JavaScript. Versions prior to 2.80.0, 3.30.0, and 4.59.0 of 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. Versions 2.80.0, 3.30.0, and 4.59.0 contain a patch for the issue.
Problem types
CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Product status
>= 3.0.0, < 3.30.0
>= 4.0.0, < 4.59.0
References
github.com/...rollup/security/advisories/GHSA-mw96-cpmx-2vgc
github.com/...ommit/c60770d7aaf750e512c1b2774989ea4596e660b2
github.com/...ommit/c8cf1f9c48c516285758c1e11f08a54f304fd44e
github.com/...ommit/d6dee5e99bb82aac0bee1df4ab9efbde455452c3
github.com/rollup/rollup/releases/tag/v2.80.0
github.com/rollup/rollup/releases/tag/v3.30.0
github.com/rollup/rollup/releases/tag/v4.59.0