- 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.
- Source
- cve-coordination@google.com
- NVD status
- Analyzed
- Products
- keras
CVSS 4.0
- Type
- Secondary
- Base score
- 7.3
- Impact score
- -
- Exploitability score
- -
- 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- Severity
- HIGH
CVSS 3.1
- Type
- Primary
- Base score
- 7.3
- Impact score
- 5.9
- Exploitability score
- 1.3
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
- Severity
- HIGH
- cve-coordination@google.com
- CWE-913
- Hype score
- Not currently trending
🚨 CVE-2025-9905: High severity (CVSS 7.3) flaw in Keras load_model() allows arbitrary code execution. Attackers can inject malicious code via model files, compromising systems running affected versions. Patch immediately! #CVE #CyberSecurity #Keras #Python #MachineLearning
@m0n1x90
19 Jan 2026
54 Impressions
0 Retweets
0 Likes
0 Bookmarks
0 Replies
0 Quotes
CVE-2025-9905 (CVSS:7.3, HIGH) is Analyzed. The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True. One c..https://t.co/Sxup8xYwiu #cybersecurityawareness #cybersecurity #CVE #infosec #hacker #nvd #mitre
@cracbot
24 Sept 2025
2 Impressions
0 Retweets
0 Likes
0 Bookmarks
0 Replies
0 Quotes
Critical Alert: New vulnerabilities (CVE-2025-9906 & CVE-2025-9905) in the Keras library allow for arbitrary code execution. 🔗 https://t.co/h0GeuYFQg7 #Keras #Cybersecurity https://t.co/N2ROz1XNsn
@cyberbivash
22 Sept 2025
3 Impressions
0 Retweets
0 Likes
0 Bookmarks
0 Replies
0 Quotes
[
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:keras:keras:*:*:*:*:*:*:*:*",
"matchCriteriaId": "315FD6FA-C1F3-47FD-AE5D-DF4D556D657F",
"versionEndExcluding": "3.11.3",
"versionStartIncluding": "3.0.0",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
]
}
]