Skip to content
HighVulnerability

CVE-2025-9905: Keras Model.load_model arbitrary code execution through crafted .h5 archives

Identifier
CVE-2025-9905
Published
Record updated
View JSON
Affected
  • keras >= 3.0.0, < 3.11.3
Fixed in
3.11.3
  • released August 21, 2025, 29 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.2%

Summary

CVE-2025-9905 is a flaw in the Keras Model.load_model method that allows arbitrary code execution even when safe_mode=True is set. A specially crafted .h5/.hdf5 model archive uses a Lambda layer to embed pickled Python code, and the safe_mode=True option is not honored when reading .h5 archives. The .h5/.hdf5 format is a legacy format that Keras 3 supports for backwards compatibility.

Mitigation

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