Lodash, a popular JavaScript utility library providing modular tools for simplifying common programming tasks, saw a notable update with version 4.17.17 following closely after 4.17.16. Both versions, licensed under MIT, share the core mission of offering developers convenient and performant functions for array manipulation, object handling, string processing, and more. They also keep the same author and repository URL.
A key difference lies in the package size and content. Version 4.17.17 significantly expands, boasting 1044 files and an unpacked size of 1,200,157 bytes compared to 4.17.16's 628 files and 588,290 bytes. This substantial increase suggests the introduction of new functionalities, enhancements, or potentially more granular modularization of existing features. Developers should investigate the specific changes within this version to understand the new capabilities at their disposal.
While both releases happened on the same day, 4.17.17 was released approximately an hour and 20 minutes after 4.17.16, indicating a quick follow-up release. This could imply the initial release necessitated a swift patch, bug fix, or minor feature addition. Developers considering upgrading should check the changelog to identify potential bug fixes or crucial updates that may be vital for their projects, especially those relying heavily on Lodash functions. Analyzing the differences between versions is crucial for a smooth upgrade and leveraging the full potential of this versatile library.
All the vulnerabilities related to the version 4.17.17 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.