CVE-2026-1462: Keras: safe_mode bypass allows RCE via model deserialization
GHSA-4f3f-g24h-fr8m HIGH CISA: ATTENDA critical deserialization flaw in Keras 3.13.0 allows attackers to bypass safe_mode=True — the framework's explicit defense against loading untrusted models — by embedding references to attacker-controlled TensorFlow SavedModels within a .keras file, resulting in arbitrary code execution under the victim's process privileges during model loading. With 1,515 downstream dependents and EPSS placing this in the top 81% of CVEs by exploitation likelihood, any organization loading third-party .keras models faces meaningful near-term risk even without a public exploit or KEV listing. Patch to keras 3.13.2 immediately and restrict all model loading to cryptographically verified internal repositories until the fix is validated across your ML pipeline.
What is the risk?
CVSS 8.8 High with network-accessible attack vector and no privileges required makes this a significant threat. The safe_mode=True bypass is particularly damaging: teams that explicitly set this flag believed their pipelines were protected from untrusted model loading, creating a false sense of security in production. The combination of 1,515 downstream dependents, top-81st-percentile EPSS, and 12 prior CVEs in the same package signals a library under sustained adversarial attention. Risk is elevated in MLOps environments where .keras files regularly cross trust boundaries — model hubs, shared storage, automated CI validation — and process accounts often carry elevated cloud credentials.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Keras | pip | < 3.13.2 | 3.13.2 |
Do you use Keras? You're affected.
How severe is it?
What is the attack surface?
What should I do?
1 step-
1) Patch immediately: upgrade keras to 3.13.2, which removes the unconditional SavedModel loading in TFSMLayer.from_config(). 2) Audit all code calling keras.models.load_model() or using TFSMLayer and enforce source allowlisting — only load models from cryptographically verified internal repositories. 3) Implement model signing and SHA-256 hash verification before any .keras file enters a pipeline. 4) Run model loading operations in isolated containers with dropped capabilities, no outbound network access, and read-only mounts on sensitive directories. 5) Scan model repositories for .keras files containing TFSMLayer definitions referencing external or absolute paths. 6) Monitor ML workloads for anomalous subprocess spawning, outbound connections to non-registry hosts, or cloud metadata service queries during model load operations.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-1462?
A critical deserialization flaw in Keras 3.13.0 allows attackers to bypass safe_mode=True — the framework's explicit defense against loading untrusted models — by embedding references to attacker-controlled TensorFlow SavedModels within a .keras file, resulting in arbitrary code execution under the victim's process privileges during model loading. With 1,515 downstream dependents and EPSS placing this in the top 81% of CVEs by exploitation likelihood, any organization loading third-party .keras models faces meaningful near-term risk even without a public exploit or KEV listing. Patch to keras 3.13.2 immediately and restrict all model loading to cryptographically verified internal repositories until the fix is validated across your ML pipeline.
Is CVE-2026-1462 actively exploited?
No confirmed active exploitation of CVE-2026-1462 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-1462?
1) Patch immediately: upgrade keras to 3.13.2, which removes the unconditional SavedModel loading in TFSMLayer.from_config(). 2) Audit all code calling keras.models.load_model() or using TFSMLayer and enforce source allowlisting — only load models from cryptographically verified internal repositories. 3) Implement model signing and SHA-256 hash verification before any .keras file enters a pipeline. 4) Run model loading operations in isolated containers with dropped capabilities, no outbound network access, and read-only mounts on sensitive directories. 5) Scan model repositories for .keras files containing TFSMLayer definitions referencing external or absolute paths. 6) Monitor ML workloads for anomalous subprocess spawning, outbound connections to non-registry hosts, or cloud metadata service queries during model load operations.
What systems are affected by CVE-2026-1462?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, ML development environments, CI/CD model validation pipelines.
What is the CVSS score for CVE-2026-1462?
CVE-2026-1462 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.36%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0011.000 Unsafe AI Artifacts AML.T0018.002 Embed Malware AML.T0058 Publish Poisoned Models Compliance Controls Affected
What are the technical details?
Original Advisory
A vulnerability in the `TFSMLayer` class of the `keras` package, version 3.13.0, allows attacker-controlled TensorFlow SavedModels to be loaded during deserialization of `.keras` models, even when `safe_mode=True`. This bypasses the security guarantees of `safe_mode` and enables arbitrary attacker-controlled code execution during model inference under the victim's privileges. The issue arises due to the unconditional loading of external SavedModels, serialization of attacker-controlled file paths, and the lack of validation in the `from_config()` method.
Exploitation Scenario
An adversary crafts a malicious .keras model file where TFSMLayer's serialized config references an attacker-controlled TensorFlow SavedModel — either hosted externally or embedded with a crafted local path resolved at load time. The file is published to a public model hub (e.g., Hugging Face, Kaggle), inserted into a compromised shared S3 bucket used by a target's MLOps pipeline, or delivered via spearphishing to an ML engineer. The engineer or automated CI job executes keras.models.load_model('victim_model.keras', safe_mode=True), trusting the explicit safety flag. Keras unconditionally invokes TFSMLayer.from_config() without path validation, loading and executing the adversary's SavedModel payload under the pipeline service account's privileges — which typically includes access to cloud storage containing training datasets, secrets manager credentials, and internal API tokens.
Weaknesses (CWE)
CWE-502 — Deserialization of Untrusted Data: The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
- [Architecture and Design, Implementation] If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
- [Implementation] When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H References
Timeline
Related Vulnerabilities
CVE-2025-49655 9.8 keras: Deserialization enables RCE
Same package: keras CVE-2025-1550 9.8 Keras: safe_mode bypass enables RCE via model loading
Same package: keras CVE-2024-3660 9.8 Keras: RCE via malicious model deserialization
Same package: keras CVE-2024-49326 9.8 Affiliator WP Plugin: Unauthenticated Web Shell Upload
Same package: keras CVE-2025-12060 9.8 keras: Path Traversal enables file access
Same package: keras