Skip to content

Update dependency lodash to v4.18.1 [SECURITY] - #431

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/npm-lodash-vulnerability
Open

renovate[bot] wants to merge 1 commit into
masterfrom
renovate/npm-lodash-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Aug 6, 2024

Copy link
Copy Markdown

This PR contains the following updates:

Package Change Age Confidence
lodash (source) 4.17.194.18.1 age confidence

Command Injection in lodash

CVE-2021-23337 / GHSA-35jh-r3h4-6jhm

More information

Details

lodash versions prior to 4.17.21 are vulnerable to Command Injection via the template function.

Severity

  • CVSS Score: 7.2 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Prototype Pollution in lodash

CVE-2019-10744 / GHSA-jf85-cpcp-j695

More information

Details

Versions of lodash before 4.17.12 are vulnerable to Prototype Pollution. The function defaultsDeep allows a malicious user to modify the prototype of Object via {constructor: {prototype: {...}}} causing the addition or modification of an existing property that will exist on all objects.

Recommendation

Update to version 4.17.12 or later.

Severity

  • CVSS Score: 9.1 / 10 (Critical)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Prototype Pollution in lodash

CVE-2020-8203 / GHSA-p6mc-m468-83gw

More information

Details

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.

Severity

  • CVSS Score: 7.4 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Regular Expression Denial of Service (ReDoS) in lodash

CVE-2020-28500 / GHSA-29mw-wpgm-hmr9

More information

Details

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);

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Lodash has Prototype Pollution Vulnerability in _.unset and _.omit functions

CVE-2025-13465 / GHSA-xxjr-mmjv-4gpg

More information

Details

Impact

Lodash versions 4.0.0 through 4.17.22 are vulnerable to prototype pollution in the _.unset and _.omit functions. An attacker can pass crafted paths which cause Lodash to delete methods from global prototypes.

The issue permits deletion of properties but does not allow overwriting their original behavior.

Patches

This issue is patched on 4.17.23.

Severity

  • CVSS Score: 6.9 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:H/SI:H/SA:H/E:P

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


lodash vulnerable to Code Injection via _.template imports key names

CVE-2026-4800 / GHSA-r5fr-rjxr-66jc

More information

Details

Impact

The fix for CVE-2021-23337 added validation for the variable option in _.template but did not apply the same validation to options.imports key names. Both paths flow into the same Function() constructor sink.

When an application passes untrusted input as options.imports key names, an attacker can inject default-parameter expressions that execute arbitrary code at template compilation time.

Additionally, _.template uses assignInWith to merge imports, which enumerates inherited properties via for..in. If Object.prototype has been polluted by any other vector, the polluted keys are copied into the imports object and passed to Function().

Patches

Users should upgrade to version 4.18.0.

The fix applies two changes:

  1. Validate importsKeys against the existing reForbiddenIdentifierChars regex (same check already used for the variable option)
  2. Replace assignInWith with assignWith when merging imports, so only own properties are enumerated
Workarounds

Do not pass untrusted input as key names in options.imports. Only use developer-controlled, static key names.

Severity

  • CVSS Score: 8.1 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


lodash vulnerable to Prototype Pollution via array path bypass in _.unset and _.omit

CVE-2026-2950 / GHSA-f23m-r3pf-42rh

More information

Details

Impact

Lodash versions 4.17.23 and earlier are vulnerable to prototype pollution in the _.unset and _.omit functions. The fix for CVE-2025-13465 only guards against string key members, so an attacker can bypass the check by passing array-wrapped path segments. This allows deletion of properties from built-in prototypes such as Object.prototype, Number.prototype, and String.prototype.

The issue permits deletion of prototype properties but does not allow overwriting their original behavior.

Patches

This issue is patched in 4.18.0.

Workarounds

None. Upgrade to the patched version.

Severity

  • CVSS Score: 6.5 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

lodash/lodash (lodash)

v4.18.1

Compare Source

Bugs

Fixes a ReferenceError issue in lodash lodash-es lodash-amd and lodash.template when using the template and fromPairs functions from the modular builds. See #​6167 (comment)

These defects were related to how lodash distributions are built from the main branch using https://github.com/lodash-archive/lodash-cli. When internal dependencies change inside lodash functions, equivalent updates need to be made to a mapping in the lodash-cli. (hey, it was ahead of its time once upon a time!). We know this, but we missed it in the last release. It's the kind of thing that passes in CI, but fails bc the build is not the same thing you tested.

There is no diff on main for this, but you can see the diffs for each of the npm packages on their respective branches:

v4.18.0

Compare Source

v4.18.0

Full Changelog: lodash/lodash@4.17.23...4.18.0

Security

_.unset / _.omit: Fixed prototype pollution via constructor/prototype path traversal (GHSA-f23m-r3pf-42rh, fe8d32e). Previously, array-wrapped path segments and primitive roots could bypass the existing guards, allowing deletion of properties from built-in prototypes. Now constructor and prototype are blocked unconditionally as non-terminal path keys, matching baseSet. Calls that previously returned true and deleted the property now return false and leave the target untouched.

_.template: Fixed code injection via imports keys (GHSA-r5fr-rjxr-66jc, CVE-2026-4800, 879aaa9). Fixes an incomplete patch for CVE-2021-23337. The variable option was validated against reForbiddenIdentifierChars but importsKeys was left unguarded, allowing code injection via the same Function() constructor sink. imports keys containing forbidden identifier characters now throw "Invalid imports option passed into _.template".

Docs
  • Add security notice for _.template in threat model and API docs (#​6099)
  • Document lower > upper behavior in _.random (#​6115)
  • Fix quotes in _.compact jsdoc (#​6090)
lodash.* modular packages

Diff

We have also regenerated and published a select number of the lodash.* modular packages.

These modular packages had fallen out of sync significantly from the minor/patch updates to lodash. Specifically, we have brought the following packages up to parity w/ the latest lodash release because they have had CVEs on them in the past:

v4.17.23

Compare Source

v4.17.21

Compare Source

v4.17.20

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch 2 times, most recently from 569d88a to eb43e50 Compare January 30, 2025 14:24
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from eb43e50 to 4fb88c0 Compare February 9, 2025 14:47
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from 4fb88c0 to 75a63c2 Compare March 3, 2025 15:24
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch 3 times, most recently from 6a68d29 to a5f4cc9 Compare March 17, 2025 18:55
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from a5f4cc9 to c0ccb90 Compare April 1, 2025 11:12
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from c0ccb90 to aa48f48 Compare April 8, 2025 14:02
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from aa48f48 to dda63bf Compare April 24, 2025 08:53
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from dda63bf to 15f791b Compare May 19, 2025 20:42
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from 15f791b to 40a425d Compare May 28, 2025 13:02
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from 40a425d to c5923d6 Compare June 5, 2025 22:52
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from c5923d6 to 8b42294 Compare June 22, 2025 15:34
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from 8b42294 to 556dc0d Compare July 2, 2025 16:15
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from 556dc0d to 46d4b88 Compare August 10, 2025 13:13
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from 46d4b88 to de13387 Compare January 23, 2026 18:48
@renovate renovate Bot changed the title Update dependency lodash to v4.17.21 [SECURITY] Update dependency lodash to v4.17.21 [SECURITY] - autoclosed Mar 27, 2026
@renovate renovate Bot closed this Mar 27, 2026
@renovate
renovate Bot deleted the renovate/npm-lodash-vulnerability branch March 27, 2026 02:00
@renovate renovate Bot changed the title Update dependency lodash to v4.17.21 [SECURITY] - autoclosed Update dependency lodash to v4.17.21 [SECURITY] Mar 30, 2026
@renovate renovate Bot reopened this Mar 30, 2026
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch 2 times, most recently from de13387 to 9d1a8e6 Compare March 30, 2026 21:03
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch from 9d1a8e6 to 013adc7 Compare April 8, 2026 17:47
@renovate renovate Bot changed the title Update dependency lodash to v4.17.21 [SECURITY] Update dependency lodash to v4.17.21 [SECURITY] - autoclosed Apr 27, 2026
@renovate renovate Bot closed this Apr 27, 2026
@renovate renovate Bot changed the title Update dependency lodash to v4.17.21 [SECURITY] - autoclosed Update dependency lodash to v4.17.21 [SECURITY] Apr 27, 2026
@renovate renovate Bot reopened this Apr 27, 2026
@renovate
renovate Bot force-pushed the renovate/npm-lodash-vulnerability branch 2 times, most recently from 013adc7 to 2091ea8 Compare April 27, 2026 23:02
@renovate renovate Bot changed the title Update dependency lodash to v4.17.21 [SECURITY] Update dependency lodash to v4.18.1 [SECURITY] Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants