PoC Monitor
← All CVEs
CVE-2026-12481published 3 Jul 2026 20:36 UTCData: JSON · API

Keras-team keras-team/keras

Deserialization of Untrusted Data in keras-team/keras

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.

First public PoC None yetno public PoC found
Public PoCs00 on GitHub
CVSS9.8critical · scored by NVD · CWE-502
CISA KEV Not listednot known exploited

Affected versions and mitigation

From the CVE record, GitHub Security Advisories and the vendor's references.

Affected

keras-team keras-team/keras
  • >= unspecified, <= latest
keras (PyPI)
  • < 3.12.3

Fixed in 3.12.3

from GitHub Security Advisory GHSA-5gwj-m78q-7pq3

keras (PyPI)
  • >= 3.13.0, < 3.15.0

Fixed in 3.15.0

from GitHub Security Advisory GHSA-5gwj-m78q-7pq3

Mitigation

Upgrade keras to 3.12.3 or later.

Upgrade keras to 3.15.0 or later.

Timeline

Days relative to CVE publication
-2t=0+2+4+6+8CVE published3 Jul 2026 · t = 0

No public PoC found yet; not in CISA KEV.

PoC repositories

Found on GitHub.

No PoC repositories found yet.