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

Keras-team Keras

Arbitrary Code execution in Keras Safe Mode

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 .keras model archive that, when loaded via Model.load_model, will trigger arbitrary code to be executed. This is achieved by crafting a special config.json (a file within the .keras archive) that will invoke keras.config.enable_unsafe_deserialization() to disable safe mode. Once safe mode is disable, one can use the Lambda layer feature of keras, which allows arbitrary Python code in the form of pickled code. Both can appear in the same archive. Simply the keras.config.enable_unsafe_deserialization() needs to appear first in the archive and the Lambda with arbitrary code needs to be second.

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

Affected versions and mitigation

From the CVE record and the vendor's references.

Affected

Keras-team Keras
  • >= 3.0.0, < 3.11.0

Fixed in 3.11.0

Mitigation

Upgrade Keras to 3.11.0 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.