CVE-2025-9905
published high CVSS 4.0 · 7.3Arbitary Code execution in Keras load_model()
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Keras-team | — | kerasKeras · 3.0.0 through 3.11.2 · Other versions: unaffected | Affected | Not stated |
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 .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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 7.3 / 10
- Severity
- high
- Provider
- Google · cna
- Vector string
- 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
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Keras-team | Keras | 3.0.0 through 3.11.2 (affected · semver)Default: unaffected | Google · cna |
Weaknesses
1- CWE-913 CWE-913 Improper Control of Dynamically-Managed Code Resources
References
2Provider assertions
2Google · cna
Arbitary Code execution in Keras load_model()
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 358fabcaa2d786e0fad9c7064c287eede6d9a4f2d61df41cdef6ba6890bcba1f
- Ingested
- 23 Sep 2026, 08:59:43 UTC
- Source record
- Official CVE record