Monitor vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
8.8

CVE-2026-12481: Keras: Untrusted Data Can Run Malicious Code

CVE-2026-12481 CVE-2026-12481
Summary

A security issue in Keras version 3.14.0 allows attackers to run unauthorized code on the server or user's computer. This could lead to data theft, system crashes, or other malicious actions. To stay safe, update Keras to the latest version, and be cautious when loading untrusted data into Keras models.

What to do

No fix is available yet. Check with your software vendor for updates.

Affected software
VendorProductAffected versions
keras-team keras-team/keras <= latest
Original title
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_deseri...
Original description
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.
mitre CVSS3.0 8.8
Vulnerability type
CWE-502 Deserialization of Untrusted Data
Published: 3 Jul 2026 · Updated: 23 Jul 2026 · First seen: 3 Jul 2026