PoC Monitor
← All CVEs
CVE-2025-9905published 19 Sep 2025 08:16 UTCData: JSON · API

Keras-team Keras

Arbitary Code execution in Keras load_model()

The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True. One can create a specially crafted .h5/.hdf5 model archive that, when loaded via Model.load_model, will trigger arbitrary code to be executed. This is achieved by crafting a special .h5 archive file that uses the Lambda layer feature of keras which allows arbitrary Python code in the form of pickled code. The vulnerability comes from the fact that the safe_mode=True option is not honored when reading .h5 archives. Note that the .h5/.hdf5 format is a legacy format supported by Keras 3 for backwards compatibility.

First public PoC None yetno public PoC found
Public PoCs00 on GitHub
CVSS7.3high · scored by CNA · CWE-913
CISA KEV Not listednot known exploited

Affected versions and mitigation

From the CVE record, GitHub Security Advisories and the vendor's references.

Affected

Keras-team Keras
  • >= 3.0.0, <= 3.11.2
keras (PyPI)
  • >= 3.0.0, < 3.11.3

Fixed in 3.11.3

from GitHub Security Advisory GHSA-36rr-ww3j-vrjv

Mitigation

Upgrade keras to 3.11.3 or later.

References

Timeline

Days relative to CVE publication
-2t=0+2+4+6+8CVE published19 Sep 2025 · t = 0

No public PoC found yet; not in CISA KEV.

PoC repositories

Found on GitHub.

No PoC repositories found yet.