Skip to content

← Actionable
High, CVSS 8.1amended

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

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

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (lodash.template 4.18.0; lodash-es 4.18.0; lodash 4.18.0; lodash-amd 4.18.0), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • npm lodash.template

    Affected
    >= 4.0.0, < 4.18.0
    Fixed in
    4.18.0
  • npm lodash-es

    Affected
    >= 4.0.0, <= 4.17.23
    Fixed in
    4.18.0
  • npm lodash

    Affected
    >= 4.0.0, <= 4.17.23
    Fixed in
    4.18.0
  • npm lodash-amd

    Affected
    >= 4.0.0, <= 4.17.23
    Fixed in
    4.18.0

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
8.1 · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
  • CVE-2026-4800: 2.81% estimated exploitation activity in the next 30 days; percentile 86.52 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

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…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-r5fr-rjxr-66jc

  2. Revision 1 · created ·

    Published from osv record GHSA-r5fr-rjxr-66jc

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-4800

Advisory: lodash vulnerable to Code Injection via `_.template` imports key names
IDs: CVE-2026-4800, GHSA-r5fr-rjxr-66jc
Record: https://patchnext.com/advisories/cve-2026-4800 (revision 2, source checked 26 Oct 2026, 12:47 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: High (CVSS 8.1)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: lodash.template 4.18.0; lodash-es 4.18.0; lodash 4.18.0; lodash-amd 4.18.0. A vendor fix does not mean a deployment is fixed.

## Affected components
- npm lodash.template: affected >= 4.0.0, < 4.18.0; fixed in 4.18.0
- npm lodash-es: affected >= 4.0.0, <= 4.17.23; fixed in 4.18.0
- npm lodash: affected >= 4.0.0, <= 4.17.23; fixed in 4.18.0
- npm lodash-amd: affected >= 4.0.0, <= 4.17.23; fixed in 4.18.0

## Suggested inspection (read-only)
- `npm ls lodash.template --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.
- `npm ls lodash-es --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.
- `npm ls lodash --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.
- `npm ls lodash-amd --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on lodash.template, lodash-es, lodash, lodash-amd.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-r5fr-rjxr-66jc (OSV record GHSA-r5fr-rjxr-66jc lists affected ranges: npm lodash >=4.0.0 =4.0.0 =4.0.0 =4.0.0 <4.18.0 (fixed))
- Verified: https://github.com/advisories/GHSA-r5fr-rjxr-66jc (GitHub-reviewed advisory GHSA-r5fr-rjxr-66jc lists affected ranges: npm lodash >=4.0.0 =4.0.0 =4.0.0 =4.0.0 <4.18.0)

Commands are suggestions: review each one before running it.

Loading voting…