{"id":"CVE-2025-9905","url":"https://www.cyber-defence.io/tools/cve/CVE-2025-9905","generatedAt":"2026-10-28T05:58:35.254Z","title":"The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True.","description":"The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True.\n\nOne can create a specially crafted .h5/.hdf5 model archive that, when loaded via Model.load_model, will trigger arbitrary code to be executed.\n\nThis 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.\n\nNote that the .h5/.hdf5 format is a legacy format supported by Keras 3 for backwards compatibility.","published":"2025-09-19T09:15:36.000Z","lastModified":"2026-10-19T16:10:00.000Z","status":"Analyzed","sourceIdentifier":"cve-coordination@google.com","cvss":{"version":"4.0","score":7.3,"severity":"HIGH","vector":"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/M"},"cwe":["CWE-913"],"affected":["keras/keras"],"epss":{"score":0.00223,"percentile":0.12788,"date":"2026-10-27","history":[]},"kev":{"listed":false},"exploits":{"count":0,"verified":false,"firstPublished":null,"source":"Exploit-DB (https://gitlab.com/exploit-database/exploitdb)","entries":[]},"verdict":{"level":"high","text":"High impact if exploited, but EPSS currently rates exploitation as unlikely (0.22%). Schedule it in the normal patch cycle and watch for a rise in EPSS or a public exploit."},"changes":[],"references":[{"url":"https://github.com/keras-team/keras/pull/21602","tags":["Issue Tracking","Patch"],"source":"cve-coordination@google.com"},{"url":"https://github.com/keras-team/keras/security/advisories/GHSA-36rr-ww3j-vrjv","tags":["Exploit","Vendor Advisory"],"source":"cve-coordination@google.com"}],"sources":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-9905","epss":"https://www.first.org/epss/","kev":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","exploitdb":"https://www.exploit-db.com/"},"licence":"CC BY 4.0 — link back to the CVE Explorer if you publish the results; upstream data remains subject to its own terms."}