CVE-2026-12480: Keras arbitrary HDF5 file read in model loading

CVE-2026-12480 · Severity: medium · CVSS 5.5 · Published 2026-07-01

Keras, a popular deep learning library, is vulnerable to a security flaw that could allow an attacker to read sensitive files from a user's computer. By tricking a user into loading a specially crafted machine learning model file, an attacker can exploit the way Keras handles certain data formats to access local files they shouldn't be able to see. This could lead to the theft of private data or credentials stored on the victim's system.

Technologies: keras (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-12480 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-12480 being exploited in the wild.
How severe is CVE-2026-12480?
Medium severity, with a CVSS score of 5.5, published 1 July 2026.
Which products and versions are affected?
keras (PyPI) ECOSYSTEM:introduced=0,fixed=3.12.3, ECOSYSTEM:introduced=0,fixed=3.12.3,introduced=3.13.0,fixed=3.15.0.
Is there a fix for CVE-2026-12480?
Yes. keras (PyPI): upgrade to 3.12.3, 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-12480 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-12480?
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.12.3, 3.15.0 or later
    pip install "keras>=3.15.0"

Technical details

Keras versions up to 3.13.2 (excluding patched branches) contain a path traversal/information disclosure vulnerability due to an incomplete fix for a previous issue. The vulnerability exists in H5IOStore._verify_dataset() and file_editor.py, which fail to validate the 'dataset.is_virtual' property of HDF5 datasets. An attacker can create a malicious .keras or .h5 file containing a Virtual Dataset (VDS) that points to external files on the host system. When a user calls keras.models.load_model() or keras.saving.load_model(), the library transparently reads the referenced external files. The issue is addressed in versions 3.12.3 and 3.15.0.

Affected products

  • Keras Team Keras < 3.12.3, >= 3.13.0, < 3.15.0

Identifiers

  • CVE-2026-12480
  • GHSA-26c4-7vv6-867j
  • PYSEC-2026-3629

Timeline

  • 2026-07-01: disclosed
  • 2026-07-01: advisory
  • 2026-06-26: patched: Initial patch release for 3.12.x branch

References

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