Commit 879aaa9
fix: validate imports keys in _.template
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.
This patch:
1. Validates `importsKeys` against `reForbiddenIdentifierChars`
2. Replaces `assignInWith` with `assignWith` when merging imports
Ref: GHSA-r5fr-rjxr-66jc
Ref: CVE-2026-4800
---------
Co-authored-by: Jon Church <[email protected]>1 parent fe8d32e commit 879aaa9
4 files changed
Lines changed: 192 additions & 132 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
14889 | 14890 | | |
14890 | 14891 | | |
14891 | 14892 | | |
14892 | | - | |
| 14893 | + | |
14893 | 14894 | | |
14894 | | - | |
| 14895 | + | |
14895 | 14896 | | |
14896 | 14897 | | |
14897 | 14898 | | |
| 14899 | + | |
| 14900 | + | |
| 14901 | + | |
| 14902 | + | |
| 14903 | + | |
| 14904 | + | |
14898 | 14905 | | |
14899 | 14906 | | |
14900 | 14907 | | |
| |||
0 commit comments