CVE-2025-9905
CVSS v3
7.3
HIGH
EPSS Score
0.2 %
exploit probability, as of 2026-10-17
CISA KEV
No
known exploited
Exploitation
—
SSVC status
Get an alert for each new CVE published for keras. Watch keras in CVE Watch Free account · no credit card
Affected and fixed versions
Packages from OSV.dev and products from the vendors' CSAF advisories.
version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.
Packages
- kerasPyPIfrom 3.0.0 · fixed in 3.11.3
Vendor advisories
keras: Arbitary Code execution in Keras load_model()
rhoai/odh-modelmesh-runtime-adapter-rhel8 as a component of Red Hat OpenShift AI (RHOAI)
Red Hat Security Advisory: RHOAI 2.25.1 - Red Hat OpenShift AI
Red Hat Security Advisory: RHOAI 2.22.3 - Red Hat OpenShift AI
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.
Technical details
- Published
- 2025-09-19
Frequently asked questions
What is CVE-2025-9905?
Is CVE-2025-9905 actively exploited?
What is the CVSS score for CVE-2025-9905?
Running keras? Hear about its next vulnerability
CVE Watch matches each new CVE to the vendors and products you list (vendor and product, not the version) and puts it in your alerts with its KEV and EPSS status.
Already have an account? Open CVE WatchNo credit card required · 50 free checks/month · Free API key
Go further
- Following what attackers exploit right now? The CISA KEV additions of the month, with their patch deadlines.
- Running this software? CVE Watch alerts you to new vulnerabilities in your products.
Related vulnerabilities
Same product first, then the same vendor advisory and the same publication week.