CVE-2026-12481
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.
Weakness
- CWE-502: Deserialization of Untrusted Data
CISA SSVC decision points
| Exploitation | poc |
|---|---|
| Automatable | no |
| Technical impact | total |
| Scored | 2026-07-06 |
Timeline
- 2026-07-03Published by the CNA20:36 UTC
- 2026-07-03GitHub advisory published (GHSA-5gwj-m78q-7pq3)same day
- 2026-07-06CISA SSVC decision recorded3 days after publication
Exploit and advisory records
GitHub advisory GHSA-5gwj-m78q-7pq3, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| PyPI keras | before 3.12.3 | 3.12.3 |
| PyPI keras | from 3.13.0 before 3.15.0 | 3.15.0 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| keras keras | 3.14.0no fix listed | not listed |
References
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2026-12481'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2026-12481'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2026-12481'curl 'https://api.contrastcyber.com/cve_products/CVE-2026-12481'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).