CVE-2025-9905Arbitary Code execution in Keras load_model()
Updated under an hour ago ()
Does this affect you?
It affects Keras-team Keras and 1 other product. Add what you run to find out whether that includes you.
No exploitation reported and no EPSS estimate yet.
Do this next
Free account, 1 product
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.
- CVSS
- 7.3 HIGH (v4.0, CNA)CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
- Weakness (CWE)
- CWE-913
- Known exploited
- Not in CISA's KEV catalog
- EPSS (exploitation in the next 30 days)
- Not loaded for this CVE
- Assigned by
- NVD analysis
- Analyzed
- Record last updated
- Feb 26, 2026
- First seen by InfoSec Signals
- Oct 19, 2026
Affected products
Keras-team Keras keras_team:keras (from the name) | from 3.0.0 through 3.11.2 | CNA record |
keras keras keras:keras | from 3.0.0 before 3.11.3 | NVD |
References
- https://github.com/keras-team/keras/pull/21602patch, issue-tracking
- https://github.com/keras-team/keras/security/advisories/GHSA-36rr-ww3j-vrjvexploit, vendor-advisory
The CVE record on cve.org NVD's entry
The CVE record is authoritative. Products marked “from the name” were identified from the CNA's free-text names, not a CPE, and are matched less certainly. This product uses the NVD API but is not endorsed or certified by the NVD.