Arbitrary Code Execution in Keras Model Loading from .h5/.hdf5 Files
CVE-2025-9905
7.3HIGH
What is CVE-2025-9905?
The Keras Model.load_model method is vulnerable to exploitation through specially crafted .h5/.hdf5 model archives. This manipulation can trigger arbitrary code execution, regardless of the safe_mode=True setting. The root of the issue lies in the Lambda layer feature of Keras, which permits arbitrary Python code in pickled format. The vulnerability stems from the failure to respect the safe_mode setting when processing .h5 archives, which are retained for compatibility in Keras 3.

Human OS v1.0:
Ageing Is an Unpatched Zero-Day Vulnerability.
Remediate biological technical debt. Prime Ageing uses 95% high-purity SIRT6 activation to maintain genomic integrity and bolster systemic resilience.
Affected Version(s)
Keras 3.0.0 <= 3.11.2
References
CVSS V4
Score:
7.3
Severity:
HIGH
Confidentiality:
High
Integrity:
High
Availability:
High
Attack Vector:
Local
Attack Complexity:
High
Attack Required:
Physical
Privileges Required:
Undefined
User Interaction:
Unknown
Timeline
Vulnerability published
Vulnerability Reserved
Credit
Gabriele Digregorio
