Rollup Plugin License, a tool designed to enhance your Rollup.js bundles, has a couple of interesting updates from version 2.1.0 to the newer 2.2.0, which might influence your decision when choosing which one to install. Both versions share the core functionality of adding license banners to your final bundles and generating third-party license reports, offering essential compliance features for open-source projects.
Looking at the dependencies you can see that lodash has been updated from 4.17.15 to 4.17.19 and moment from 2.25.1 to 2.27.0 which include bug fixes and potentially security enhancements.
The development dependencies show more changes: eslint was updated from 6.8.0 to 7.6.0, rollup to version 2.23.0 from 2.10.7, fs-extra from 9.0.0 to 9.0.1, @babel/core from 7.9.6 to 7.11.1, @babel/preset-env from 7.9.6 to 7.11.0, @rollup/plugin-babel from 5.0.2 to 5.1.0, @rollup/plugin-commonjs from 12.0.0 to 14.0.0, @rollup/plugin-node-resolve from 8.0.0 to 8.4.0 and gulp-bump was updated from version 3.1.3 to 3.2.0
Developers should consider the updates to rollup and the rollup plugins, and babel, particularly if they are already using these tools in their projects. Ensure compatibility with your existing configurations. Consider upgrading to leverage the latest features and improvements in the Rollup ecosystem. The release dates also indicate that version 2.2.0 includes more recent updates reflecting a more current set of dependencies, which could translate to better compatibility.
All the vulnerabilities related to the version 2.2.0 of the package
Regular Expression Denial of Service (ReDoS) in lodash
All versions of package lodash prior to 4.17.21 are vulnerable to Regular Expression Denial of Service (ReDoS) via the toNumber
, trim
and trimEnd
functions.
Steps to reproduce (provided by reporter Liyuan Chen):
var lo = require('lodash');
function build_blank(n) {
var ret = "1"
for (var i = 0; i < n; i++) {
ret += " "
}
return ret + "1";
}
var s = build_blank(50000) var time0 = Date.now();
lo.trim(s)
var time_cost0 = Date.now() - time0;
console.log("time_cost0: " + time_cost0);
var time1 = Date.now();
lo.toNumber(s) var time_cost1 = Date.now() - time1;
console.log("time_cost1: " + time_cost1);
var time2 = Date.now();
lo.trimEnd(s);
var time_cost2 = Date.now() - time2;
console.log("time_cost2: " + time_cost2);
Command Injection in lodash
lodash
versions prior to 4.17.21 are vulnerable to Command Injection via the template function.
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.