Junglewise Threat Intelligence

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

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

Technologies: keras (PyPI). Vendors: PyPI.

Executive brief

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.

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

Timeline

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

References

Related threats