Skip to content

build(deps): bump lodash from 4.17.23 to 4.18.1 - #2357

Merged
martastn merged 1 commit into
masterfrom
dependabot/npm_and_yarn/lodash-4.18.1
Sep 21, 2026
Merged

martastn merged 1 commit into
masterfrom
dependabot/npm_and_yarn/lodash-4.18.1

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

Bumps lodash from 4.17.23 to 4.18.1.

Release notes

Sourced from lodash's releases.

4.18.1

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 lodash/lodash#6167

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:

4.18.0

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:

Commits
  • cb0b9b9 release(patch): bump main to 4.18.1 (#6177)
  • 75535f5 chore: prune stale advisory refs (#6170)
  • 62e91bc docs: remove n_ Node.js < 6 REPL note from README (#6165)
  • 59be2de release(minor): bump to 4.18.0 (#6161)
  • af63457 fix: broken tests for _.template 879aaa9
  • 1073a76 fix: linting issues
  • 879aaa9 fix: validate imports keys in _.template
  • fe8d32e fix: block prototype pollution in baseUnset via constructor/prototype traversal
  • 18ba0a3 refactor(fromPairs): use baseAssignValue for consistent assignment (#6153)
  • b819080 ci: add dist sync validation workflow (#6137)
  • Additional commits viewable in compare view

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Apr 8, 2026
@martastn martastn self-assigned this Sep 21, 2026
@martastn

Copy link
Copy Markdown
Contributor

@dependabot rebase

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.23...4.18.1)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.18.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/lodash-4.18.1 branch from a18b7c0 to fa62caa Compare September 21, 2026 15:25
@martastn

Copy link
Copy Markdown
Contributor

Review: transitive build-time dep, closes 2 advisories, one live call site, build passes — safe to merge.

lodash 4.17.23 → 4.18.1, minor, lockfile-only (3 lines). Rebased onto current master — diff vs master is exactly those 3 lines.

Not a direct dependency: absent from package.json, zero hits in src/. Six transitive consumers, all build/test-time — nothing reaches the browser.

What it fixes

Advisory Sev What
GHSA-r5fr-rjxr-66jc (CVE-2026-4800) HIGH Code injection via _.template imports keys — completes the incomplete CVE-2021-23337 patch
GHSA-f23m-r3pf-42rh MOD Prototype pollution in _.unset/_.omit via constructor/prototype paths

Both list 4.17.23 as vulnerable. Silent behaviour change: _.unset/_.omit now return false instead of true where they previously deleted.

4.18.1 is why this is safe, not 4.18.0. 4.18.0 shipped a ReferenceError in template/fromPairs in the modular builds — i.e. exactly require('lodash/template'), how our consumers import it. Stale lodash-cli mapping; passed CI, broke on publish.

Why nothing breaks

  • imports validation — unreachable. Never passed anywhere: react-scripts gives inject/template/minify, config-overrides.js doesn't touch HtmlWebpackPlugin, the loader passes interpolate/variable: "data" (a plain identifier, already validated in 4.17.x).
  • _.unset/_.omit — unused. Zero hits across all six consumers and src/.
  • Only one live template call site. workbox-build's is dead here: populateSWTemplate is used only by GenerateSW, CRA uses InjectManifest, and there's no src/service-worker.js — no SW is emitted.
  • lodash-es/lodash-amd absent from the tree. Not what saved us though — the 4.18.0 bug hit the main package's modular paths too.

Verified

npm ci + npm run build, Node 25 / npm 11.6:

Check Result
npm run build exit 0, index.html valid (567 B, correct title/meta)
lodash installed 4.18.1, single deduped instance
npm audit for lodash* zero advisories
main lodash in bundle absent — sourcemap's only lodash* source is lodash.debounce, a different package

Also ran 4.18.1 in isolation against our exact call patterns (_template(html, {interpolate, variable:'data'}), .source, <%= %> execution, fromPairs, uniq) — all pass. public/index.html has no <% markers, so the template pass is effectively a copy; %PUBLIC_URL% is InterpolateHtmlPlugin, unrelated.

Caveats

  • Tests: 28 passed, 10 failed — all Selenium ERR_CONNECTION_REFUSED, no dev server was running. Pre-existing pattern; nothing references lodash.
  • No control build from master — "build passes" is shown, "output unchanged" is not.
  • Full 4.17.23→4.18.1 source diff not read line by line — findings rest on release notes, the advisory DB, and executing the paths we use.
  • npm ci needs --legacy-peer-deps on Node ≥ 25 (canvas@2 / jsdom) — pre-existing, unrelated, already filed via the browserslist review.
Follow-ups (non-blocking)
  1. Five frozen lodash.* packages in the tree (debounce, memoize, merge, sortby, uniq) — independent packages, unaffected here, no current advisories. 4.18.0's notes say upstream regenerated a batch of these precisely because they had drifted and collected CVEs; ours weren't in that batch.
  2. PWA is half-configured — workbox installed and manifest.json present, but no src/service-worker.js, so no service worker is ever emitted. Wire it up or drop the dependency.

@martastn
martastn added this pull request to the merge queue Sep 21, 2026
Merged via the queue into master with commit 0739350 Sep 21, 2026
7 checks passed
@martastn
martastn deleted the dependabot/npm_and_yarn/lodash-4.18.1 branch September 21, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant