Rollup Plugin License saw a notable update moving from version 2.2.0 to 2.3.0, bringing several dependency upgrades that enhance both the developer experience and potentially improve the plugin's performance and security. Key dependency updates include lodash (from 4.17.19 to 4.17.21) and moment (from 2.27.0 to 2.29.1), addressing potential bug fixes and security vulnerabilities inherent in older versions.
Furthermore, the development environment received significant attention. Babel core jumped from version 7.11.1 to 7.13.8, providing access to newer JavaScript features and optimizations. Similarly, @rollup/plugin-babel went from 5.1.0 to 5.3.0, and @rollup/plugin-commonjs from 14.0.0 to 17.1.0, ensuring better compatibility and functionality with modern Rollup configurations. Node resolve plugin updated from 8.4.0 to 11.2.0, probably solving dependency resolution issues. Other development dependency bumps include eslint (7.6.0 to 7.21.0), fs-extra (9.0.1 to 9.1.0), prettier (2.0.5 to 2.2.1). The package-name-regex dependency was updated from 1.0.8 to 1.0.9. Developers adopting version 2.3.0 benefit from these dependency improvements. With no listed breaking changes, upgrading should be relatively straightforward, granting access to a more up-to-date and reliable toolchain for managing licenses in their Rollup bundles. The updated dependencies should also provide better support for newer JavaScript syntax.
All the vulnerabilities related to the version 2.3.0 of the package
Path Traversal: 'dir/../../filename' in moment.locale
This vulnerability impacts npm (server) users of moment.js, especially if user provided locale string, eg fr
is directly used to switch moment locale.
This problem is patched in 2.29.2, and the patch can be applied to all affected versions (from 1.0.1 up until 2.29.1, inclusive).
Sanitize user-provided locale name before passing it to moment.js.
Are there any links users can visit to find out more?
If you have any questions or comments about this advisory:
Moment.js vulnerable to Inefficient Regular Expression Complexity
The problem is patched in 2.29.4, the patch can be applied to all affected versions with minimal tweaking.
In general, given the proliferation of ReDoS attacks, it makes sense to limit the length of the user input to something sane, like 200 characters or less. I haven't seen legitimate cases of date-time strings longer than that, so all moment users who do pass a user-originating string to constructor are encouraged to apply such a rudimentary filter, that would help with this but also most future ReDoS vulnerabilities.
There is an excellent writeup of the issue here: https://github.com/moment/moment/pull/6015#issuecomment-1152961973=
The issue is rooted in the code that removes legacy comments (stuff inside parenthesis) from strings during rfc2822 parsing. moment("(".repeat(500000))
will take a few minutes to process, which is unacceptable.