Skip to content
HighVulnerability

GHSA-mgx6-5cf9-rr43: Keras vulnerable to DoS via Malicious .keras Model (HDF5 Shape Bomb Causes Petabyte Allocation in KerasFileEditor)

Published
Record updated
View JSON
Affected
  • keras >= 3.13.0, < 3.13.2, fixed in 3.13.2, released January 29, 2026, 96 days before disclosure
  • keras >= 3.0.0, <= 3.12.0, fixed in 3.12.1, released January 30, 2026, 96 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.3%

Summary

The Keras model loader, KerasFileEditor, reads HDF5 weight files inside user-supplied .keras archives without validating dataset metadata. A crafted model.weights.h5 declaring a dataset shape of (50000000, 50000000) with only a few bytes of stored data triggers a full-shape allocation via value[()] in h5py, producing an attempted 8.88 PiB allocation that crashes the process. The advisory describes the impact as denial of service for any environment or pipeline that loads untrusted .keras models.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.