CVE-2025-9906: Keras · Deserialization of Untrusted Data
Affects KerasSource CVE Database V5
Not known to be exploited · CVSS 8.6 High.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 0.2% chance of exploitation in 30 days – higher than 10% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/AU:Y/R:AExploitation evidence
Disclosed: evidence found.
CVE published 19 Sep 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| Keras-team Keras | Affected
| Fixed in– |
AI-suggested
To mitigate CVE-2025-9906, organizations should: 1) Avoid loading untrusted or unauthenticated .keras model files, especially from external or unknown sources. 2) Implement strict access controls and code execution policies around environments where Keras models are loaded. 3) Monitor and restrict the use of the Model.load_model method to trusted personnel and automated systems only. 4) Use containerization or sandboxing to isolate model loading processes, limiting potential damage from arbitrary code execution. 5) Stay alert for official patches or updates from the Keras team and apply them promptly once available. 6) Consider static or dynamic analysis of model archives before loading to detect suspicious config.json or Lambda layers. 7) Educate developers and data scientists about the risks of deserializing untrusted data in ML workflows. 8) Employ runtime monitoring and endpoint detection to identify anomalous behavior indicative of exploitation attempts. These steps go beyond generic advice by focusing on operational controls and proactive detection tailored to this vulnerability’s exploitation vector.
Description
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.