Lodash, a popular JavaScript utility library, provides developers with a wealth of modular functions designed to simplify common programming tasks. Comparing versions 4.17.11 and 4.17.12 reveals subtle but potentially valuable differences. Both versions maintain the core functionality of Lodash, offering tools for array manipulation, object handling, function composition, and more under the MIT license. The descriptions for both remain nearly identical, emphasizing Lodash's commitment to providing modular utilities.
A key difference lies in the release dates: version 4.17.12 was published in July 2019, approximately ten months after version 4.17.11, released in September 2018. This suggests that 4.17.12 contains bug fixes, performance improvements, or minor feature enhancements accumulated over that period. The dist property also shows slight variations. Version 4.17.12 has a fileCount of 1050 with unpackedSize of 1402075, contrasting with 4.17.11 (fileCount: 1049, unpackedSize: 1399577). These changes imply that 4.17.12 includes at least one updated or additional file leading to a slightly larger size of the package when unpacked. Developers should consider upgrading to version 4.17.12 to benefit from these improvements and ensure they're using the most stable and up-to-date version of the library. While the changes may seem minor, incremental updates like these contribute to a more robust and efficient development experience.
All the vulnerabilities related to the version 4.17.12 of the package
Prototype Pollution in lodash
Versions of lodash prior to 4.17.19 are vulnerable to Prototype Pollution. The functions pick
, set
, setWith
, update
, updateWith
, and zipObjectDeep
allow a malicious user to modify the prototype of Object if the property identifiers are user-supplied. Being affected by this issue requires manipulating objects based on user-provided property values or arrays.
This vulnerability causes the addition or modification of an existing property that will exist on all objects and may lead to Denial of Service or Code Execution under specific circumstances.
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.