Deserialization of Untrusted Data in keras-team/keras
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 fixed, 1 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-502.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| keras-team | keras-team/keras | up to latest | — | No fix listed | CNA |
| — | keras (PyPI) | before 3.12.3 | 3.12.3 | Patch available | GHSA-5gwj-m78q-7pq3 |
| — | keras (PyPI) | 3.13.0 to before 3.15.0 | 3.15.0 | Patch available | GHSA-5gwj-m78q-7pq3 |
- keras-team/keras Vendorkeras-team Affected up to latest Fixed in — No fix listed CNA
- keras (PyPI) Vendor— Affected before 3.12.3 Fixed in 3.12.3 Patch available GHSA-5gwj-m78q-7pq3
- keras (PyPI) Vendor— Affected 3.13.0 to before 3.15.0 Fixed in 3.15.0 Patch available GHSA-5gwj-m78q-7pq3
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:keras:keras:3.14.0:*:*:*:*:*:*:* | 3.14.0 | Vulnerable | keras-team |
- cpe:2.3:a:keras:keras:3.14.0:*:*:*:*:*:*:* Versions 3.14.0 Vulnerable ·keras-team
Remediation
- Fix · GHSA-5gwj-m78q-7pq3 keras (PyPI) Fixed in 3.12.3 Advisory →
- Fix · GHSA-5gwj-m78q-7pq3 keras (PyPI) Fixed in 3.15.0 Advisory →
Red Hat 1 advisory
- RHSA-2026:60520 Released 2026-08-27 · Red Hat rating CriticalRHOAI 3.4.4 - Red Hat OpenShift AI
- Red Hat OpenShift AI 3.4 registry.redhat.io/rhoai/odh-automl-rhel9, registry.redhat.io/rhoai/odh-autorag-rhel9, registry.redhat.io/rhoai/odh-built-in-detector-rhel9 +47
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat OpenShift AI (RHOAI) | Affected | No fix yet |
| Red Hat OpenShift AI 3.4 | Fixed | RHSA-2026:60520 |
Not affected: 2 products
- Red Hat OpenShift AI (RHOAI)
- Red Hat OpenShift AI 3.4
Timeline
- 2026-10-02 Threatist record created from CVE-2026-12481
- 2026-10-03 Alias added: GHSA-5gwj-m78q-7pq3
References
Other 7
- https://github.com/keras-team/keras/pull/23048
- https://github.com/keras-team/keras/pull/23165
- https://github.com/keras-team/keras/commit/55888d3becbdbb45dc16a55b489900f911e2dde5
- https://github.com/keras-team/keras/commit/d338a45204bdc787c8b3c4a9b82c1911cd52dedf
- https://github.com/keras-team/keras
- https://github.com/keras-team/keras/releases/tag/v3.12.3
- https://github.com/keras-team/keras/releases/tag/v3.15.0
More keras-team Keras vulnerabilities
- TI-2026-01159 Safe Mode Bypass in keras-team/keras CVSS 3.0HIGH 8.8
- TI-2025-08001 Keras safe_mode bypass allows arbitrary code execution when loading a malicious model. CVSS 4.0HIGH 8.6
- TI-2026-10199 Path Traversal in keras-team/keras CVSS 3.0HIGH 8.1
- TI-2025-01336 Arbitrary Code Execution via Crafted Keras Config for Model Loading CVSS 4.0HIGH 7.3
- TI-2026-10716 Path Traversal via Symlink Name Validation Bypass in keras-team/keras CVSS 3.1MEDIUM 6.5
- TI-2024-36840 An issue in keras 3.7.0 allows attackers to write arbitrary files to the user's machine… CVSS 3.1MEDIUM 6.5
Sources
- CVE-2026-12481 · CVE Program
- CVE-2026-12481 · NVD
- FIRST EPSS
- GHSA-5gwj-m78q-7pq3 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-12481 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences