Cyber Resilience

CVE-2025-9905

Keras 3.0.0 – 3.11.3

Public PoC
Published
19 September 2025
Modified
23 September 2025
Patch / advisory
CVSS Score v4 7.3
Click a component to see what it means
Raw vectorCVSS: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
EPSS Score 0.0020 10th percentile
Risk Priority 55 floored blend · peak EPSS

Summary

CVE-2025-9905 is a high-severity Improper Control of Dynamically-Managed Code Resources (CWE-913) vulnerability in Keras Keras. Its CVSS base score is 7.3 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Reflective Code Loading (T1620); ranked at the 10th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

This vulnerability is AI-related — categorised as Deep Learning Frameworks; in the Supply Chain and Deployment risk domain.

The strongest mitigations our analysis identified map to AC-3 (Access Enforcement) and AC-6 (Least Privilege) — see the control section below for these in your framework.

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

AI Security AnalysisAI

AI Category
Deep Learning Frameworks
Risk Domain
Supply Chain and Deployment
OWASP Top 10 for LLMs 2025
None mapped
Classification Reason
Matched keywords: keras

Related Threats

MITRE ATT&CK Enterprise Techniques

T1620 Reflective Code Loading Stealth
Adversaries may reflectively load code into a process in order to conceal the execution of malicious payloads.
T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1059.007 JavaScript Execution
Adversaries may abuse various implementations of JavaScript for execution.
T1059.001 PowerShell Execution
Adversaries may abuse PowerShell commands and scripts for execution.
T1059.006 Python Execution
Adversaries may abuse Python commands and scripts for execution.
T1059.011 Lua Execution
Adversaries may abuse Lua commands and scripts for execution.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2024-3660Same product: Keras Keras
CVE-2025-1550Same product: Keras Keras
CVE-2025-9906Same product: Keras Keras
CVE-2026-12481Same product: Keras Keras
CVE-2025-8747Same product: Keras Keras
CVE-2026-11816Same product: Keras Keras
CVE-2026-12482Same product: Keras Keras
CVE-2026-1669Same product: Keras Keras
CVE-2024-55459Same product: Keras Keras
CVE-2026-0897Same product: Keras Keras

Affected Assets

keras
keras
3.0.0 — 3.11.3

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)
  • 2 hardening rules · 2 OS baselines
Validate
Prove the fix (OWASP ASVS)

Mitigating Controls (NIST 800-53 r5) AI

Access enforcement directly stops unauthorized reads/writes to dynamic code resources by applying authorization checks at access time.

Least privilege reduces the set of subjects that can reach or modify dynamic code resources, limiting the weakness's reach.

Isolating security functions from non-security code prevents unintended manipulation of dynamically managed executable resources.

Process isolation keeps each process's dynamic code resources in separate domains, blocking cross-process tampering.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 full match
prevents

Secure SDLC practices explicitly include controls that prevent improper handling of dynamic code resources.

PR.PS-05 mostly match
prevents

Blocking unauthorized code execution directly limits the ability to abuse dynamically-managed resources.

DE.CM-09 partial match
prevents

Runtime-environment monitoring can detect exploitation of the weakness but does not prevent it.

ID.RA-01 partial match
prevents

Vulnerability identification can surface instances of CWE-913 but does not mitigate the root weakness.

PR.PS-01 partial match
prevents

Hardened configuration baselines can restrict dynamic code execution and variable access at runtime.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing can detect dynamic code weaknesses but does not prevent them at design or coding time.

prevents

Secure development lifecycle mandates controls on dynamic code generation and resource management.

prevents

Application security requirements explicitly address restrictions on dynamic code execution and resource access.

prevents

Secure architecture principles require design controls that prevent improper dynamic code resource manipulation.

prevents

Secure coding standards directly prohibit unsafe dynamic code resource handling and injection patterns.

none

Environment separation reduces exposure of dynamic code resources but does not address the underlying weakness.

Hardening callouts derived

Configuration rules from DISA STIG baselines that bear on weaknesses of the type cited by this CVE. Each rule is shown with the relationship its mapping actually records, against the CWE it was authored against. Derived via CVE→CWE over `controls_xwalks` (authoritative rows only; rows rated `none` are excluded).

Windows 10 (1 rule)
  • V-220726 Data Execution Prevention (DEP) must be configured to at least OptOut. prevents CWE-913
Windows 11 (1 rule)
  • V-253283 Data Execution Prevention (DEP) must be configured to at least OptOut. prevents CWE-913

References