{"id":"CVE-2025-8747","published":"2025-08-11T07:21:16Z","modified":"2026-02-26T17:49:45Z","title":"Keras safe_mode bypass allows arbitrary code execution when loading a malicious model.","vendor":"Google","product":"Keras","tier":"tail","description":{"text":"A safe mode bypass vulnerability in the `Model.load_model` method in Keras versions 3.0.0 through 3.10.0 allows an attacker to achieve arbitrary code execution by convincing a user to load a specially crafted `.keras` model archive.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.6,"severity":"HIGH","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/AU:Y/R:A","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00121,"percentile":0.01959,"provenance":"source"},"cwes":[{"id":"CWE-502","name":"Deserialization of Untrusted Data"}],"references":[{"url":"https://github.com/keras-team/keras/pull/21429","tags":["patch"]},{"url":"https://jfrog.com/blog/keras-safe_mode-bypass-vulnerability/","tags":["third-party-advisory"]}],"priority":{"score":6.4,"factors":[{"name":"EPSS percentile","points":0.39},{"name":"CVSS severity","points":6.02}]},"vendorSlug":"google","affectedVersions":[{"vendor":"Google","product":"Keras","versions":[">= 3.0.0, <= 3.10.0"]}],"solutions":{"items":["Upgrade to a version of Keras with the fix implemented (version 3.11.0 or newer)."],"from":"CVE.org CNA","provenance":"source"},"capec":[{"id":"CAPEC-242","name":"Code Injection"}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2025-08-15T03:55:48.540132Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"keras","vulnerableRanges":[">=3.0.0, <3.11.0"],"patched":["3.11.0"],"from":["GHSA-c9rc-mg46-23w3","PYSEC-2025-75"],"provenance":"source"}],"summary":{"text":"A safe mode bypass in the Model.load_model method of Google's Keras (versions 3.0.0 through 3.10.0) allows a malicious .keras model archive to bypass the framework's protections against unsafe deserialization. An attacker who can get a user to load a specially crafted .keras file can achieve arbitrary code execution, and this requires local access to the victim's environment, low privileges, and user interaction to load the model.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:14:53Z"},"euvd":{"id":"EUVD-2025-24127","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-keras-team-keras-cve-2025-1550","parents":[{"from":"CVE-2025-1550","to":"CVE-2025-8747","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:keras","fromFixed":"3.9.0","toFixed":"3.11.0","daysApart":153},{"kind":"same-code","provenance":"machine","files":["keras/src/saving/serialization_lib.py"],"commits":["https://github.com/keras-team/keras/commit/e67ac8ffd0c883bec68eb65bb52340c7f9d3a903","https://github.com/keras-team/keras/commit/713172ab56b864e59e2aa79b1a51b0e728bba858"],"basis":"shared function","functions":["_retrieve_class_or_fn"]}]}],"children":[{"from":"CVE-2025-8747","to":"CVE-2026-12480","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["keras/src/legacy/saving/legacy_h5_format.py"],"commits":["https://github.com/keras-team/keras/commit/713172ab56b864e59e2aa79b1a51b0e728bba858","https://github.com/keras-team/keras/commit/d5a88bdb137c0d3039b8f4bbbe8c7099925cc10c","https://github.com/keras-team/keras/commit/8f987f11bf7512f0df4774a8f1557bba07dc2b49"],"basis":"shared function","functions":["load_model_from_hdf5","save_optimizer_weights_to_hdf5_group"]}]}],"packageHistory":[{"cve":"CVE-2024-3660","published":"2024-04-16","fixed":"2.13.1rc0","kev":false},{"cve":"CVE-2025-1550","published":"2025-03-11","fixed":"3.9.0","kev":false},{"cve":"CVE-2025-8747","published":"2025-08-11","fixed":"3.11.0","kev":false},{"cve":"CVE-2025-9906","published":"2025-09-19","fixed":"3.11.0","kev":false},{"cve":"CVE-2025-49655","published":"2025-10-17","fixed":"3.11.3","kev":false},{"cve":"CVE-2025-9905","published":"2025-09-19","fixed":"3.11.3","kev":false}],"package":"PyPI:keras"}}