Skip to content

Resolve CVE-2026-4800 by bumping lodash and lodash-es to ^4.18.0#1506

Open
KashKondaka wants to merge 1 commit intoopensearch-project:3.0from
KashKondaka:fix/cve-2026-4800-3.0
Open

Resolve CVE-2026-4800 by bumping lodash and lodash-es to ^4.18.0#1506
KashKondaka wants to merge 1 commit intoopensearch-project:3.0from
KashKondaka:fix/cve-2026-4800-3.0

Conversation

@KashKondaka
Copy link
Copy Markdown
Collaborator

Summary

Resolves CVE-2026-4800 (HIGH severity) by bumping lodash and lodash-es yarn resolutions to ^4.18.0 in package.json.

Details

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().

Impact

An attacker can inject default-parameter expressions that execute arbitrary code at template compilation time via untrusted options.imports key names. Prototype pollution can also be exploited via assignInWith.

Fix

  • Bumped lodash and lodash-es resolutions to ^4.18.0 in package.json
  • Version 4.18.0 validates importsKeys against reForbiddenIdentifierChars and replaces assignInWith with assignWith

Test Plan

  • Verify lodash and lodash-es resolve to >=4.18.0 after yarn install
  • Verify no regressions in build or tests

Details:
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().

Impact:
When an application passes untrusted input as options.imports key names
to _.template, an attacker can inject default-parameter expressions
that execute arbitrary code at template compilation time. Additionally,
prototype pollution can be exploited via assignInWith to inject keys
into the Function() constructor.

Fix:
Bumped lodash and lodash-es resolutions to ^4.18.0 in package.json.
Version 4.18.0 validates importsKeys against reForbiddenIdentifierChars
and replaces assignInWith with assignWith when merging imports.

Signed-off-by: KashKondaka <37753523+KashKondaka@users.noreply.github.com>
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.

1 participant