Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft HDF5 shape-bomb .keras file
-
DeliveryPublish to public model registry or repository
-
ExploitVictim pipeline downloads malicious model file
-
Executionkeras.models.load_model() invoked on crafted file
-
PersistH5IOStore allocates petabyte-scale declared memory without bounds check
-
ImpactOOM condition terminates process with exit code 137
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource allocation limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The target process must call keras.models.load_model() or load_weights() on a file controlled by the attacker - specifically a .keras archive or .weights.h5 file containing an HDF5 dataset with a maliciously large declared shape relative to its actual stored bytes (e.g., shape=(2**50,) with chunked gzip compression and a fill value). User interaction is required (UI:R per CVSS): a user or automated script must actively initiate the model load operation. The attack vector is local (AV:L per CVSS): the crafted file must reside on the local filesystem accessible to the loading process, meaning the attacker must first deliver the file via a poisoned model repository download, a compromised artifact registry, or a malicious model attachment. Pipelines with strict model provenance controls - such as cryptographic signature verification or allowlisted internal registries - are not exploitable in practice even on unpatched versions. Exploitation is limited strictly to the availability dimension; no code execution, credential theft, or data exfiltration is possible via this vector. |
| Impact | The CVSS base score of 5.5 (Medium) with a local attack vector (AV:L) and required user interaction (UI:R) constrains opportunistic exploitation in theory, but the practical risk in ML-intensive organizations substantially exceeds what the raw score implies. No EPSS score was provided in the available data, and the vulnerability is absent from the CISA KEV catalog, so no confirmed widespread active exploitation exists at time of analysis. However, automated model evaluation pipelines that pull from public model hubs or artifact registries may load files without direct human review, effectively collapsing the UI:R constraint to near-zero in operational practice - meaning even a mid-sized data science team in kalisz running a continuous-training pipeline against public model repositories should treat this as a meaningful supply-chain risk. The exploit technique is fully replicable from the upstream patch's own test suite, which constructs a 2^50-element gzip-compressed HDF5 dataset storing near-zero bytes on disk; this lowers the barrier to independent exploitation considerably even without a standalone PoC. The bypass of CVE-2026-0897's fix is noteworthy: it suggests the original remediation was incomplete in scope, and defenders who believed they had addressed the underlying class of attack should re-verify. The impact is strictly availability - no confidentiality or integrity exposure - which limits strategic value for sophisticated adversaries but makes this an effective denial-of-service primitive against ML infrastructure. |
| Exploit ScenarioDerived | An attacker publishes a Keras-compatible model to a public model hub, embedding an HDF5 dataset that declares a shape of 2^50 float64 elements (approximately 8 PiB in memory) while storing near-zero bytes on disk using chunked gzip compression with a fill value of 0.0. When a data scientist or CI/CD pipeline calls keras.models.load_model() on this file, h5py attempts to allocate the full declared memory, immediately exhausting available RAM and triggering a process kill with exit code 137. The construction technique is trivially replicable verbatim from the patch's own test suite using only h5py and a few lines of Python. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 10, 2026
Unbounded memory allocation in Keras (keras-team/keras) versions ≤ 3.15.0 allows an attacker who can supply a crafted .keras or HDF5 weights file to crash the loading process via an out-of-memory condition. The H5IOStore.__getitem__ method in keras/src/saving/saving_lib.py performs no validation of HDF5 dataset shapes against actual on-disk storage, enabling 'shape bomb' files that declare enormous in-memory sizes (e.g., ~8 PiB) while occupying negligible disk space. ML pipelines that consume models from public repositories, third-party registries, or untrusted collaborators are directly at risk; this flaw bypasses the earlier fix for CVE-2026-0897, which only addressed the same class of issue in KerasFileEditor. No public exploit has been identified at time of analysis and the vulnerability is not listed in the CISA KEV catalog.
RemediationAI
Apply the upstream fix from commit 4933ea4a5b3fcc24ceacdc276f5bb5dfbd06756c (https://github.com/keras-team/keras/commit/4933ea4a5b3fcc24ceacdc276f5bb5dfbd06756c); a specific patched release version is not independently confirmed from available data, so monitor the keras-team/keras PyPI releases for a version incorporating this commit and upgrade promptly. As an immediate workaround, restrict model loading to files sourced exclusively from internal, integrity-verified repositories by implementing SHA-256 or GPG signature verification on .keras and .weights.h5 files before passing them to load_model() or load_weights(); the trade-off is added pipeline complexity and key management overhead. Where automated pipelines must consume external models, run load_model() inside a memory-limited subprocess using Python's resource.setrlimit (RLIMIT_AS or RLIMIT_DATA) or container-level memory limits (e.g., Docker --memory), so an OOM crash is contained rather than propagating to the parent process; this mitigates impact but does not prevent the DoS. Enforcing strict model provenance policies - allowlisting only known-good model registries - directly addresses the primary attack vector described in the disclosure.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in pypi, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Keras serializes and deserializes neural network weights using the HDF5 format via the h5py library. The affected code path is H5IOStore.__getitem__ → safe_get_h5_dataset in keras/src/saving/saving_lib.py (CPE: cpe:2.3:a:keras-team:keras-team/keras:*:*:*:*:*:*:*:*). HDF5 supports chunked, compressed datasets with fill values, meaning a dataset can declare an arbitrarily large logical shape while storing almost nothing on disk - a pattern sometimes called a 'shape bomb' or 'decompression bomb,' closely related to CWE-409 (Improper Handling of Highly Compressed Data). The root cause is CWE-770 (Allocation of Resources Without Limits or Throttling): safe_get_h5_dataset does not compare the declared in-memory footprint (shape × dtype.itemsize) against the actual bytes stored on disk (dataset.id.get_storage_size()), so carefully crafted HDF5 metadata can force gigabytes or petabytes of memory allocation. The patch introduces a 4 GiB floor threshold (_H5_DATASET_BOMB_FLOOR_BYTES = 1 << 32) and a 1000× maximum expansion ratio (_H5_DATASET_MAX_EXPANSION) before any allocation proceeds, rejecting datasets that exceed both limits.
Know when Keras Team Keras gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
AV:L because exploitation requires the crafted file to be present on the local filesystem; UI:R since a user or pipeline must actively invoke load_model(); A:H for guaranteed deterministic process termination; no confidentiality or integrity impact.
Primary rating from Vendor (huntr_ai).
CVSS VectorVendor: huntr_ai
Lifecycle Timeline
2DescriptionCVE.org
A vulnerability in keras-team/keras versions <= 3.15.0 allows for a denial of service (DoS) attack when loading malicious .keras model files via the keras.models.load_model() function. The H5IOStore.__getitem__ method in keras/src/saving/saving_lib.py does not validate the shape or size of datasets, leading to unbounded memory allocation. A specially crafted .keras file can exploit this flaw to trigger an out-of-memory (OOM) condition, causing the process to be terminated (exit code 137). This issue bypasses the fix for CVE-2026-0897, which only addressed a similar vulnerability in KerasFileEditor. The attack vector includes poisoned models from public repositories or malicious model registries, posing a risk to machine learning pipelines that process untrusted models.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
More in Keras Team Keras
View allArbitrary code execution in keras-team/keras 3.14.0 lets remote attackers run OS-level commands by supplying a malicious
Arbitrary code execution in Keras 3.13.0 occurs because the TFSMLayer class unconditionally loads attacker-supplied Tens
Local HDF5 file content disclosure in keras-team/keras versions 3.14.0 and earlier allows an attacker who can deliver a
Symlink entries in malicious tar archives bypass the `filter_safe_tarinfos` validation in Keras 3.12.0, enabling directo
Path traversal in Keras 3.14.0 exposes local file systems to arbitrary file and directory creation when processing malic
EUVD-2026-55002
GHSA-74m6-m3xx-3vmj
NVD
CVE.org
EPSS
VulDB
Exploit-DB