If your ML pipelines or model serving infrastructure load .keras files from external, user-controlled, or shared repository sources, patch Keras to 3.12.1 now. A crafted weight archive can crash the Python interpreter with zero authentication required, taking down inference workers or training jobs. If immediate patching is blocked, enforce strict allowlisting of model sources and apply container memory limits to bound blast radius.
What is the risk?
MEDIUM-HIGH for organizations running public model evaluation endpoints, automated fine-tuning pipelines accepting external checkpoints, or transfer learning workflows pulling from shared repositories. LOW for air-gapped environments loading only internally-signed, origin-verified weights. EPSS of 0.00029 indicates minimal active exploitation today, but the attack primitive is trivially reproducible by any attacker who can deliver a crafted file to a pipeline — no ML expertise required beyond understanding HDF5 metadata structure.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Keras | pip | >= 3.0.0, <= 3.12.0 | 3.12.1 |
Do you use Keras? You're affected.
How severe is it?
What should I do?
1 step-
1) Patch immediately: pip install 'keras>=3.12.1'. Verify with pip show keras. 2) If patching is blocked, restrict model loading to cryptographically verified, internally-hosted artifacts only — reject any externally-sourced .keras or .h5 files at the pipeline boundary. 3) Apply container/cgroup memory limits on all ML serving and training pods to prevent host-level memory exhaustion from a single crashing process. 4) Add file size validation and HDF5 shape metadata inspection before invoking keras.saving.load_model() or equivalent. 5) Detection: alert on abnormal RSS/VSZ spikes in Python ML processes, or sudden OOMKilled pod events correlated with model load operations. 6) Audit all publicly-accessible endpoints that trigger weight loading — model fine-tuning APIs, evaluation services, and any user-facing upload flows.
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-0897?
If your ML pipelines or model serving infrastructure load .keras files from external, user-controlled, or shared repository sources, patch Keras to 3.12.1 now. A crafted weight archive can crash the Python interpreter with zero authentication required, taking down inference workers or training jobs. If immediate patching is blocked, enforce strict allowlisting of model sources and apply container memory limits to bound blast radius.
Is CVE-2026-0897 actively exploited?
No confirmed active exploitation of CVE-2026-0897 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-0897?
1) Patch immediately: pip install 'keras>=3.12.1'. Verify with pip show keras. 2) If patching is blocked, restrict model loading to cryptographically verified, internally-hosted artifacts only — reject any externally-sourced .keras or .h5 files at the pipeline boundary. 3) Apply container/cgroup memory limits on all ML serving and training pods to prevent host-level memory exhaustion from a single crashing process. 4) Add file size validation and HDF5 shape metadata inspection before invoking keras.saving.load_model() or equivalent. 5) Detection: alert on abnormal RSS/VSZ spikes in Python ML processes, or sudden OOMKilled pod events correlated with model load operations. 6) Audit all publicly-accessible endpoints that trigger weight loading — model fine-tuning APIs, evaluation services, and any user-facing upload flows.
What systems are affected by CVE-2026-0897?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, transfer learning workflows, MLOps/CI-CD pipelines, model evaluation platforms.
What is the CVSS score for CVE-2026-0897?
No CVSS score has been assigned yet.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0011.000 Unsafe AI Artifacts AML.T0029 Denial of AI Service AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
Allocation of Resources Without Limits or Throttling in the HDF5 weight loading component in Google Keras 3.0.0 through 3.12.0 and 3.13.0 on all platforms allows a remote attacker to cause a Denial of Service (DoS) through memory exhaustion and a crash of the Python interpreter via a crafted .keras archive containing a valid model.weights.h5 file whose dataset declares an extremely large shape.
Exploitation Scenario
An adversary targeting an organization running an automated model evaluation platform or transfer learning pipeline crafts a valid .keras archive. The archive contains a well-formed model.weights.h5 with a legitimate HDF5 header but declares a dataset shape with extreme dimensions (e.g., [2147483647, 2147483647]). When the pipeline invokes keras.saving.load_model() or loads the weights file, the HDF5 component attempts to pre-allocate memory proportional to the declared shape before reading actual data. System RAM is exhausted within seconds, the Python interpreter crashes via an unhandled MemoryError, and the inference worker or training job is terminated. In containerized ML workloads without memory limits, this can cascade to OOMKill events affecting co-located services. No authentication, no ML expertise, and no network-level access beyond file delivery to the target pipeline are required.
Weaknesses (CWE)
CWE-770 — Allocation of Resources Without Limits or Throttling: The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.
- [Requirements] Clearly specify the minimum and maximum expectations for capabilities, and dictate which behaviors are acceptable when resource allocation reaches limits.
- [Architecture and Design] Limit the amount of resources that are accessible to unprivileged users. Set per-user limits for resources. Allow the system administrator to define these limits. Be careful to avoid CWE-410.
Source: MITRE CWE corpus.
References
- github.com/advisories/GHSA-mgx6-5cf9-rr43
- github.com/advisories/GHSA-xfhx-r7ww-5995
- github.com/keras-team/keras/commit/7360d4f0d764fbb1fa9c6408fe53da41974dd4f6
- github.com/keras-team/keras/commit/f704c887bf459b42769bfc8a9182f838009afddb
- github.com/keras-team/keras/pull/21880
- github.com/keras-team/keras/pull/22081
- github.com/keras-team/keras/security/advisories/GHSA-mgx6-5cf9-rr43
- nvd.nist.gov/vuln/detail/CVE-2026-0897
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