Commit a5df825
committed
Resolve CVE-2026-4800 by bumping lodash and lodash-es to ^4.18.0
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>1 parent 95d71cb commit a5df825
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
0 commit comments