CVE Vulnerabilities

CVE-2026-4800

Improper Control of Generation of Code ('Code Injection')

Published: Mar 31, 2026 | Modified: May 01, 2026
CVSS 3.x
9.8
CRITICAL
Source:
NVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
8.1 IMPORTANT
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

Impact:

The fix for CVE-2021-23337 (https://github.com/advisories/GHSA-35jh-r3h4-6jhm) 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.

Workarounds:

Do not pass untrusted input as key names in options.imports. Only use developer-controlled, static key names.

Weakness

The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Affected Software

NameVendorStart VersionEnd Version
LodashLodash4.0.0 (including)4.18.0 (excluding)
Lodash-amdLodash4.0.0 (including)4.18.0 (excluding)
Lodash-esLodash4.0.0 (including)4.18.0 (excluding)
Lodash.templateLodash4.0.0 (including)4.18.0 (excluding)
Cryostat 4 on RHEL 9RedHatcryostat/cryostat-openshift-console-plugin-rhel9:4.2.0-9*
Cryostat 4 on RHEL 9RedHatcryostat/cryostat-rhel9:4.2.0-9*
Red Hat Ansible Automation Platform 2.6 for RHEL 9RedHatautomation-platform-ui-0:2.6.9-1.el9ap*
Red Hat Data Grid 8.6.1RedHatlodash*
Red Hat Enterprise Linux 10RedHatpcs-0:0.12.1-1.el10_1.3*
Red Hat Enterprise Linux 10RedHatpcs-0:0.12.2-3.el10_2.1*
Red Hat Enterprise Linux 10RedHatcockpit-image-builder-0:94.3-1.el10_2*
Red Hat Enterprise Linux 10.0 Extended Update SupportRedHatpcs-0:0.12.0-3.el10_0.5*
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update SupportRedHatpcs-0:0.10.8-1.el8_4.11*
Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-OnRedHatpcs-0:0.10.8-1.el8_4.11*
Red Hat Enterprise Linux 8.6 Telecommunications Update ServiceRedHatpcs-0:0.10.12-6.el8_6.13*
Red Hat Enterprise Linux 8.6 Update Services for SAP SolutionsRedHatpcs-0:0.10.12-6.el8_6.13*
Red Hat Enterprise Linux 8.8 Telecommunications Update ServiceRedHatpcs-0:0.10.15-4.el8_8.11*
Red Hat Enterprise Linux 8.8 Update Services for SAP SolutionsRedHatpcs-0:0.10.15-4.el8_8.11*
Red Hat Enterprise Linux 9RedHatpcs-0:0.11.10-1.el9_7.3*
Red Hat Enterprise Linux 9RedHatpcs-0:0.11.11-2.el9_8.1*
Red Hat Enterprise Linux 9.0 Update Services for SAP SolutionsRedHatpcs-0:0.11.1-10.el9_0.11*
Red Hat Enterprise Linux 9.2 Update Services for SAP SolutionsRedHatpcs-0:0.11.4-7.el9_2.8*
Red Hat Enterprise Linux 9.4 Extended Update SupportRedHatpcs-0:0.11.7-2.el9_4.7*
Red Hat Enterprise Linux 9.6 Extended Update SupportRedHatpcs-0:0.11.9-2.el9_6.4*
Streams for Apache Kafka 3.2.0RedHatlodash*
Migration Toolkit for Virtualization 2.1RedHatmigration-toolkit-virtualization/mtv-console-plugin-rhel9:1779139872*
Migration Toolkit for Virtualization 2.9RedHatmigration-toolkit-virtualization/mtv-console-plugin-rhel9:1778927462*
Network Observability (NETOBSERV) 1.11.2RedHatnetwork-observability/network-observability-console-plugin-compat-rhel9:1778508956*
Network Observability (NETOBSERV) 1.11.2RedHatnetwork-observability/network-observability-console-plugin-rhel9:1778510461*
Red Hat Ansible Automation Platform 2.5RedHatansible-automation-platform-25/lightspeed-rhel8:1777403872*
Red Hat Ansible Automation Platform 2.6RedHatansible-automation-platform-26/lightspeed-rhel9:1777387242*
Red Hat Developer Hub 1.8RedHatrhdh/rhdh-hub-rhel9:1776784286*
Red Hat Developer Hub 1.9RedHatrhdh/rhdh-hub-rhel9:1777903262*
Red Hat OpenShift AI 2.25RedHatrhoai/odh-dashboard-rhel9:1780467029*
Red Hat OpenShift AI 2.25RedHatrhoai/odh-mod-arch-model-registry-rhel9:1780467147*
Red Hat OpenShift AI 3.3RedHatrhoai/odh-dashboard-rhel9:1779189627*
Red Hat OpenShift AI 3.3RedHatrhoai/odh-mod-arch-gen-ai-rhel9:1778473763*
Red Hat OpenShift AI 3.3RedHatrhoai/odh-mod-arch-model-registry-rhel9:1778666987*
Red Hat OpenShift Container Platform 4.17RedHatopenshift4/ose-networking-console-plugin-rhel9:1778517109*
Red Hat OpenShift Container Platform 4.18RedHatopenshift4/ose-networking-console-plugin-rhel9:1778256287*
Red Hat OpenShift Container Platform 4.18RedHatopenshift4/nmstate-console-plugin-rhel9:1779874967*
Red Hat OpenShift Container Platform 4.19RedHatopenshift4/ose-networking-console-plugin-rhel9:1779256322*
Red Hat OpenShift Container Platform 4.19RedHatopenshift4/nmstate-console-plugin-rhel9:1779249920*
Red Hat OpenShift Container Platform 4.20RedHatopenshift4/ose-networking-console-plugin-rhel9:1778644858*
Red Hat OpenShift Container Platform 4.20RedHatopenshift4/nmstate-console-plugin-rhel9:1778645008*
Red Hat Openshift Data Foundation 4.16RedHatodf4/cephcsi-rhel9:1778076673*
Red Hat Openshift Data Foundation 4.16RedHatodf4/mcg-core-rhel9:1778076741*
Red Hat Openshift Data Foundation 4.16RedHatodf4/mcg-rhel9-operator:1778076916*
Red Hat Openshift Data Foundation 4.16RedHatodf4/ocs-client-console-rhel9:1778077421*
Red Hat Openshift Data Foundation 4.16RedHatodf4/ocs-client-rhel9-operator:1778076861*
Red Hat Openshift Data Foundation 4.16RedHatodf4/ocs-metrics-exporter-rhel9:1778077066*
Red Hat Openshift Data Foundation 4.16RedHatodf4/ocs-rhel9-operator:1778077002*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odf-cli-rhel9:1778077164*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odf-console-rhel9:1778077913*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odf-cosi-sidecar-rhel9:1778077379*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odf-csi-addons-rhel9-operator:1778077455*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odf-csi-addons-sidecar-rhel9:1778077447*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odf-multicluster-console-rhel9:1778078096*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odf-multicluster-rhel9-operator:1778077527*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odf-must-gather-rhel9:1778077651*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odf-rhel9-operator:1778077920*
Red Hat Openshift Data Foundation 4.16RedHatodf4/odr-rhel9-operator:1778077737*
Red Hat Openshift Data Foundation 4.16RedHatodf4/rook-ceph-rhel9-operator:1778077839*
Red Hat Openshift Data Foundation 4.17RedHatodf4/cephcsi-rhel9:1778049594*
Red Hat Openshift Data Foundation 4.17RedHatodf4/cephcsi-rhel9-operator:1778049298*
Red Hat Openshift Data Foundation 4.17RedHatodf4/mcg-core-rhel9:1778049745*
Red Hat Openshift Data Foundation 4.17RedHatodf4/mcg-rhel9-operator:1778049753*
Red Hat Openshift Data Foundation 4.17RedHatodf4/ocs-client-console-rhel9:1778050558*
Red Hat Openshift Data Foundation 4.17RedHatodf4/ocs-client-rhel9-operator:1778049818*
Red Hat Openshift Data Foundation 4.17RedHatodf4/ocs-metrics-exporter-rhel9:1778049878*
Red Hat Openshift Data Foundation 4.17RedHatodf4/ocs-rhel9-operator:1778049920*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odf-cli-rhel9:1778049945*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odf-console-rhel9:1778060364*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odf-cosi-sidecar-rhel9:1778050037*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odf-csi-addons-rhel9-operator:1778050035*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odf-csi-addons-sidecar-rhel9:1778050048*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odf-multicluster-console-rhel9:1778050508*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odf-multicluster-rhel9-operator:1778050119*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odf-must-gather-rhel9:1778050290*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odf-rhel9-operator:1778059723*
Red Hat Openshift Data Foundation 4.17RedHatodf4/odr-rhel9-operator:1778050352*
Red Hat Openshift Data Foundation 4.17RedHatodf4/rook-ceph-rhel9-operator:1778050482*
Red Hat Openshift Data Foundation 4.18RedHatodf4/cephcsi-rhel9:1778045210*
Red Hat Openshift Data Foundation 4.18RedHatodf4/cephcsi-rhel9-operator:1778044961*
Red Hat Openshift Data Foundation 4.18RedHatodf4/mcg-core-rhel9:1778045359*
Red Hat Openshift Data Foundation 4.18RedHatodf4/mcg-rhel9-operator:1778045374*
Red Hat Openshift Data Foundation 4.18RedHatodf4/ocs-client-console-rhel9:1778045891*
Red Hat Openshift Data Foundation 4.18RedHatodf4/ocs-client-rhel9-operator:1778045472*
Red Hat Openshift Data Foundation 4.18RedHatodf4/ocs-metrics-exporter-rhel9:1778045534*
Red Hat Openshift Data Foundation 4.18RedHatodf4/ocs-rhel9-operator:1778045524*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odf-cli-rhel9:1778045587*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odf-console-rhel9:1778046067*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odf-cosi-sidecar-rhel9:1778045627*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odf-csi-addons-rhel9-operator:1778045731*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odf-csi-addons-sidecar-rhel9:1778045700*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odf-multicluster-console-rhel9:1778046234*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odf-multicluster-rhel9-operator:1778045792*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odf-must-gather-rhel9:1778045858*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odf-rhel9-operator:1778045945*
Red Hat Openshift Data Foundation 4.18RedHatodf4/odr-rhel9-operator:1778045931*
Red Hat Openshift Data Foundation 4.18RedHatodf4/rook-ceph-rhel9-operator:1778046079*
Red Hat Openshift Data Foundation 4.19RedHatodf4/cephcsi-rhel9:1776079019*
Red Hat Openshift Data Foundation 4.19RedHatodf4/cephcsi-rhel9-operator:1776706744*
Red Hat Openshift Data Foundation 4.19RedHatodf4/mcg-core-rhel9:1776707205*
Red Hat Openshift Data Foundation 4.19RedHatodf4/mcg-rhel9-operator:1776707231*
Red Hat Openshift Data Foundation 4.19RedHatodf4/ocs-client-console-rhel9:1776707760*
Red Hat Openshift Data Foundation 4.19RedHatodf4/ocs-client-rhel9-operator:1776707301*
Red Hat Openshift Data Foundation 4.19RedHatodf4/ocs-metrics-exporter-rhel9:1776079295*
Red Hat Openshift Data Foundation 4.19RedHatodf4/ocs-rhel9-operator:1776707362*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-cli-rhel9:1776707418*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-cloudnative-pg-rhel9-operator:1776707377*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-console-rhel9:1776707947*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-cosi-sidecar-rhel9:1776707456*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-csi-addons-rhel9-operator:1776707526*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-csi-addons-sidecar-rhel9:1776707526*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-multicluster-console-rhel9:1776707945*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-multicluster-rhel9-operator:1776707569*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-must-gather-rhel9:1776707724*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odf-rhel9-operator:1776707763*
Red Hat Openshift Data Foundation 4.19RedHatodf4/odr-rhel9-operator:1776707771*
Red Hat Openshift Data Foundation 4.19RedHatodf4/rook-ceph-rhel9-operator:1776079774*
Red Hat Openshift Data Foundation 4.20RedHatodf4/cephcsi-rhel9:1775822432*
Red Hat Openshift Data Foundation 4.20RedHatodf4/cephcsi-rhel9-operator:1776403457*
Red Hat Openshift Data Foundation 4.20RedHatodf4/mcg-core-rhel9:1776403991*
Red Hat Openshift Data Foundation 4.20RedHatodf4/mcg-rhel9-operator:1776404009*
Red Hat Openshift Data Foundation 4.20RedHatodf4/ocs-client-console-rhel9:1776404539*
Red Hat Openshift Data Foundation 4.20RedHatodf4/ocs-client-rhel9-operator:1776404060*
Red Hat Openshift Data Foundation 4.20RedHatodf4/ocs-metrics-exporter-rhel9:1775822689*
Red Hat Openshift Data Foundation 4.20RedHatodf4/ocs-rhel9-operator:1776404131*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-cli-rhel9:1776406225*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-cloudnative-pg-rhel9-operator:1776406131*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-console-rhel9:1776406770*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-cosi-sidecar-rhel9:1776406247*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-csi-addons-rhel9-operator:1776406286*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-csi-addons-sidecar-rhel9:1776406291*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-external-snapshotter-rhel9-operator:1776406284*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-external-snapshotter-sidecar-rhel9:1776406291*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-multicluster-console-rhel9:1776406771*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-multicluster-rhel9-operator:1776406384*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-must-gather-rhel9:1776406540*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odf-rhel9-operator:1776406595*
Red Hat Openshift Data Foundation 4.20RedHatodf4/odr-rhel9-operator:1776406594*
Red Hat Openshift Data Foundation 4.20RedHatodf4/rook-ceph-rhel9-operator:1775823207*
Red Hat OpenShift Dev Spaces 3.27RedHatdevspaces/code-rhel9:1776744110*
Red Hat OpenShift Dev Spaces 3.27RedHatdevspaces/dashboard-rhel9:1776795511*
Red Hat OpenShift Dev Spaces 3.27RedHatdevspaces/openvsx-rhel9:1776716842*
Red Hat OpenShift distributed tracing 3.9.3RedHatrhosdt/tempo-jaeger-query-rhel9:1776435608*
Red Hat OpenShift GitOps 1.18RedHatopenshift-gitops-1/console-plugin-rhel8:1779115545*
Red Hat OpenShift GitOps 1.19RedHatopenshift-gitops-1/console-plugin-rhel8:1779210530*
Red Hat OpenShift Service Mesh 2.6RedHatopenshift-service-mesh/kiali-ossmc-rhel8:1776202125*
Red Hat OpenShift Service Mesh 2.6RedHatopenshift-service-mesh/kiali-rhel8:1776191302*
Red Hat OpenShift Service Mesh 3.0RedHatopenshift-service-mesh/kiali-ossmc-rhel9:1776151124*
Red Hat OpenShift Service Mesh 3.0RedHatopenshift-service-mesh/kiali-rhel9:1776151272*
Red Hat OpenShift Service Mesh 3.1RedHatopenshift-service-mesh/kiali-ossmc-rhel9:1776151106*
Red Hat OpenShift Service Mesh 3.1RedHatopenshift-service-mesh/kiali-rhel9:1776151270*
Red Hat OpenShift Service Mesh 3.2RedHatopenshift-service-mesh/kiali-ossmc-rhel9:1776155669*
Red Hat OpenShift Service Mesh 3.2RedHatopenshift-service-mesh/kiali-rhel9:1776149682*
Red Hat OpenShift Service Mesh 3.3RedHatopenshift-service-mesh/kiali-ossmc-rhel9:1776151134*
Red Hat OpenShift Service Mesh 3.3RedHatopenshift-service-mesh/kiali-rhel9:1776151277*
Red Hat Satellite 6.18RedHatsatellite/iop-advisor-frontend-rhel9:1777911535*
Red Hat Satellite 6.18RedHatsatellite/iop-host-inventory-frontend-rhel9:1777498806*
Red Hat Satellite 6.18RedHatsatellite/iop-remediations-rhel9:1776194798*
Red Hat Trusted Artifact Signer 1.3RedHatrhtas/rekor-search-ui-rhel9:1776330093*
Node-lodashUbuntuesm-apps-legacy/xenial*
Node-lodashUbuntuesm-apps/bionic*
Node-lodashUbuntuesm-apps/focal*
Node-lodashUbuntuesm-apps/jammy*
Node-lodashUbuntuesm-apps/noble*
Node-lodashUbuntuesm-apps/resolute*
Node-lodashUbuntuesm-apps/xenial*
Node-lodashUbuntujammy*
Node-lodashUbuntunoble*
Node-lodashUbuntuquesting*
Node-lodashUbunturesolute*
Node-lodashUbuntuupstream*

Potential Mitigations

  • Run your code in a “jail” or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.
  • Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
  • This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
  • Be careful to avoid CWE-243 and other weaknesses related to jails.
  • Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
  • For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].

References