CVE-2026-12570 Denial of Service via HDF5 Shape Bomb in keras.models.load_model() in keras-team/keras
Attackers can cause denial of service via memory exhaustion by loading malicious Keras model files, affecting ML pipelines processing untrusted models.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-12570?
CVE-2026-12570 is a medium-severity denial of service vulnerability in keras-team/keras, published on 10 Aug 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
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.
Weakness: CWE-770
Which versions are affected by CVE-2026-12570?
3 open source packages ship an affected version, including keras.
| Package | Affected | Fixed in |
|---|---|---|
keras PyPI | All versions | 3.15.0 |
keras PyPI | All versions | 3.15.0 |
keras PyPI | All versions | 3.15.0 |
How do I fix CVE-2026-12570?
Upgrade keras to 3.15.0 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2026-12570 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-12570 exists.
Sources
Also known as DEBIAN-CVE-2026-12570, GHSA-74m6-m3xx-3vmj, MINI-wxmg-9p5w-p3r3, OESA-2026-3952, OESA-2026-3953, OESA-2026-4052 and 2 more.