cbcvebase.
CVE-2026-12481
published 2026-07-03

CVE-2026-12481: A vulnerability in keras-team/keras version 3.14.0 allows for arbitrary code execution due to improper handling of deserialization in the `Lambda` layer…

PriorityP264critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EPSS
0.72%
51.3th percentile
A vulnerability in keras-team/keras version 3.14.0 allows for arbitrary code execution due to improper handling of deserialization in the `Lambda` layer. Specifically, the `_raise_for_lambda_deserialization()` function fails to enforce the safe-mode guard when `safe_mode` is set to `None`, which is the default value when `from_config()` is called outside of a `SafeModeScope` context. This logic error conflates `None` (unset/default-deny) with `False` (explicitly disabled), bypassing the guard and allowing attacker-controlled `marshal` bytecode to be deserialized. Affected call sites include `keras.layers.deserialize(config)`, `keras.models.clone_model(model)`, and any direct invocation of `Lambda.from_config(config)` without an enclosing `SafeModeScope(True)`. This vulnerability can be exploited to achieve arbitrary OS-level code execution in the context of the server or user process.

Affected

10 ranges
VendorProductVersion rangeFixed in
keras-teamkeras-team_kerasunspecified – latest
keraskeras
keraskeras>= 0 < 3.12.33.12.3
keraskeras>= 3.13.0 < 3.15.03.15.0
rhoaiodh-kserve-storage-initializer-rhel9
rhoaiodh-modelmesh-runtime-adapter-rhel9
rhoaiodh-pipeline-runtime-tensorflow-cuda-py312-rhel9
rhoaiodh-pipeline-runtime-tensorflow-rocm-py312-rhel9
rhoaiodh-workbench-jupyter-tensorflow-cuda-py312-rhel9
rhoaiodh-workbench-jupyter-tensorflow-rocm-py312-rhel9

Detection & IOCsextracted from sources · hover to see the quote

  • Flag deserialization calls to `keras.layers.deserialize(config)` without an enclosing `SafeModeScope(True)` context, as this is a vulnerable call site for CVE-2026-12481
  • Flag deserialization calls to `keras.models.clone_model(model)` without an enclosing `SafeModeScope(True)` context, as this is a vulnerable call site for CVE-2026-12481
  • Flag direct invocations of `Lambda.from_config(config)` without an enclosing `SafeModeScope(True)` context, as this is a vulnerable call site for CVE-2026-12481
  • The root cause function `_raise_for_lambda_deserialization()` in Keras 3.14.0 fails to block deserialization when `safe_mode` is `None`; monitor or audit code paths invoking this function with a `None` safe_mode value
  • The exploit vector involves attacker-controlled `marshal` bytecode being deserialized via the Keras Lambda layer; detect or alert on `marshal` module usage within Keras model loading workflows
  • Exploitation requires loading a specially crafted Keras model file; monitor file ingestion pipelines and model-loading events for externally sourced Keras model configs
  • ·The vulnerability is specific to keras-team/keras version 3.14.0; other versions are not confirmed affected by these sources
  • ·The logic error conflates `None` (unset/default-deny) with `False` (explicitly disabled); detection logic must distinguish between these two states — a `safe_mode` of `None` is the vulnerable default, not an explicit opt-out
  • ·Several Red Hat OpenShift AI (RHOAI) container images are confirmed affected; others (odh-kserve-agent-rhel9, odh-kserve-controller-rhel9, odh-kserve-router-rhel9) are confirmed NOT affected

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv3.08.8HIGHCVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vendor_redhat8.8HIGH
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.