CVE-2026-12570: Keras model loading denial of service via HDF5 shape bombs

CVE-2026-12570 · Severity: medium · CVSS 5.5 · Published 2026-08-10

Keras is a popular machine learning library used to build and load trained neural network models. A vulnerability in versions before 3.15.0 allows an attacker to craft a malicious model file that causes the application to consume unbounded memory and crash when loaded, disrupting any ML pipeline that processes untrusted models from public repositories or model registries.

Technologies: keras (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-12570 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-12570 being exploited in the wild.
How severe is CVE-2026-12570?
Medium severity, with a CVSS score of 5.5, published 10 August 2026.
Which products and versions are affected?
keras (PyPI) < 3.15.0, ECOSYSTEM:introduced=0,fixed=3.15.0.
Is there a fix for CVE-2026-12570?
Yes. keras (PyPI): upgrade to 3.15.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-12570 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-12570?
Check whether you run keras (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • keras (PyPI): upgrade to 3.15.0 or later
    pip install "keras>=3.15.0"

Technical details

The vulnerability exists in Keras's HDF5 dataset loading code (keras/src/saving/saving_lib.py, H5IOStore.__getitem__ method) which does not validate the declared shape or size of datasets before materialization. An attacker can craft a specially-designed HDF5 file with chunked, compressed, or fill-value-only datasets that declare an enormous shape (e.g., petabytes) while storing only kilobytes on disk. When load_model() or load_weights() is called on such a file, the code attempts to allocate memory equal to the declared shape, causing an out-of-memory condition and process termination (exit code 137). The attack requires user interaction to load the model but no privileges; the attack vector is local/network-supplied malicious model files from untrusted sources. The patch (released in v3.15.0) adds validation to reject datasets where the declared in-memory size exceeds a 4 GiB floor and vastly exceeds the actual on-disk storage size.

Affected products

  • Keras Team Keras < 3.15.0

Identifiers

  • CVE-2026-12570
  • GHSA-74m6-m3xx-3vmj
  • PYSEC-2026-3856

Timeline

  • 2026-08-10: disclosed: Vulnerability published to GitHub Advisory Database and NVD
  • 2026-06-23: patched: Fix released in Keras v3.15.0 (commit 4933ea4); patch merged June 1, 2026
  • 2026-09-01: advisory: GitHub Security Advisory reviewed and updated

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.