CVE-2025-9905
CVE-2025-9905 is a high-severity vulnerability in Keras with a CVSS 3.x base score of 7.3. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-913.
Key facts
- Severity: High (CVSS 3.x base score 7.3)
- CVSS v4: 7.3
- EPSS exploit prediction: 0% (11th percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2025-30277
- Weakness: CWE-913
- Affected product: Keras
- Published:
- Last modified:
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.
Frequently asked questions
- What is CVE-2025-9905?
- 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.
- How severe is CVE-2025-9905?
- CVE-2025-9905 has a CVSS 3.x base score of 7.3, rated high severity. It is exploitable over local access with low attack complexity, requires low privileges and user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2025-9905 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 0% (11th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2025-9905?
- CVE-2025-9905 affects Keras. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2025-9905?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
- Does CVE-2025-9905 have an EU (EUVD) identifier?
- Yes. CVE-2025-9905 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2025-30277.
- When was CVE-2025-9905 published?
- CVE-2025-9905 was published on 2025-09-19 and last updated on 2026-06-17.
References
- https://github.com/keras-team/keras/pull/21602
- https://github.com/keras-team/keras/security/advisories/GHSA-36rr-ww3j-vrjv
Affected products (1)
- cpe:2.3:a:keras:keras:*:*:*:*:*:*:*:*
More vulnerabilities in Keras
- CVE-2026-12481 — Critical (CVSS 9.8): A vulnerability in keras-team/keras version 3.14.0 allows for arbitrary code execution due to improper handling of…
- CVE-2025-1550 — Critical (CVSS 9.8): The Keras Model.load_model function permits arbitrary code execution, even with safe_mode=True, through a manually…
- CVE-2024-3660 — Critical (CVSS 9.8): A arbitrary code injection vulnerability in TensorFlow's Keras framework (<2.13) allows attackers to execute arbitrary…
- CVE-2026-11816 — High (CVSS 8.1): Keras versions prior to 3.14.0 are vulnerable to a path traversal issue in the archive extraction utilities located in…
- CVE-2026-1462 — High (CVSS 7.8): A vulnerability in the `TFSMLayer` class of the `keras` package, version 3.13.0, allows attacker-controlled TensorFlow…
- CVE-2025-8747 — High (CVSS 7.8): A safe mode bypass vulnerability in the `Model.load_model` method in Keras versions 3.0.0 through 3.10.0 allows an…
Other CWE-913 vulnerabilities
- CVE-2026-47208 — Critical (CVSS 10.0): vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, VM2 suffers from a sandbox breakout…
- CVE-2026-47137 — Critical (CVSS 10.0): vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, the fix for GHSA-8hg8-63c5-gwmx (CVE-2023-37903)…
- CVE-2026-47131 — Critical (CVSS 10.0): vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, by combining…
- CVE-2023-29017 — Critical (CVSS 10.0): vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Prior to version 3.9.15, vm2 was…
- CVE-2022-36067 — Critical (CVSS 10.0): vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. In versions prior to version…
- CVE-2026-34156 — Critical (CVSS 9.9): NocoBase is an AI-powered no-code/low-code platform for building business applications and enterprise solutions. Prior…