CVE-2026-12481: Deserialization of Untrusted Data in keras-team/keras

Published Jul 3, 2026
·
Updated

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 raiseforlambdadeserialization() function fails to enforce the safe-mode guard when safemode is set to None, which is the default value when fromconfig() 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.clonemodel(model), and any direct invocation of Lambda.fromconfig(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 Software

2 affected components
keras-team/keras=3.14.0
Keras Keras=3.14.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade keras-team/keras to a version that resolves this vulnerability.

    Fixed in 3.14.0
  2. Configuration

    When using `keras.layers.deserialize(config)`, `keras.models.clone_model(model)`, or `Lambda.from_config(config)`, ensure deserialization of potentially untrusted data occurs inside `SafeModeScope(True)` so the safe-mode guard is enforced (avoid calling these outside a `SafeModeScope` context, where `safe_mode` defaults to `None`).

    keras-team/keras (SafeModeScope / from_config) safe_mode (SafeModeScope(True) vs default) = Enforce SafeModeScope(True) when deserializing untrusted configs

Event History

Jul 3, 2026
CVE Published
via MITRE·08:36 PM
Data Sourced
via MITRE·08:36 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-12481?

The severity of CVE-2026-12481 is rated high with a CVSS score of 8.8.

2

How do I fix CVE-2026-12481?

To fix CVE-2026-12481, update keras-team/keras to version 3.14.1 or later, where the deserialization issue has been resolved.

3

What type of vulnerability is CVE-2026-12481?

CVE-2026-12481 is a deserialization of untrusted data vulnerability that allows for arbitrary code execution.

4

Who is affected by CVE-2026-12481?

Users of keras-team/keras version 3.14.0 are affected by CVE-2026-12481.

5

What components of keras are impacted by CVE-2026-12481?

The vulnerability specifically impacts the `Lambda` layer's handling of deserialization in keras-team/keras.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203