{"id":"CVE-2025-1550","published":"2025-03-11T08:12:34Z","modified":"2025-07-24T15:28:42Z","title":"Arbitrary Code Execution via Crafted Keras Config for Model Loading","vendor":"Google","product":"Keras","tier":"tail","description":{"text":"The Keras Model.load_model function permits arbitrary code execution, even with safe_mode=True, through a manually constructed, malicious .keras archive. By altering the config.json file within the archive, an attacker can specify arbitrary Python modules and functions, along with their arguments, to be loaded and executed during model loading.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.3,"severity":"HIGH","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.02604,"percentile":0.85747,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/keras-team/keras/pull/20751","tags":[]},{"url":"https://towerofhanoi.it/writeups/cve-2025-1550/","tags":[]}],"priority":{"score":27.3,"factors":[{"name":"EPSS percentile","points":17.15},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.11}]},"exploitSources":{"exploitdb":{"count":1,"earliest":"2025-07-16"},"first":{"date":"2025-07-16","source":"Exploit-DB","url":"https://www.exploit-db.com/exploits/52359"},"provenance":"source"},"vendorSlug":"google","affectedVersions":[{"vendor":"Google","product":"Keras","versions":[">= 3.0.0, < 3.8.0"]}],"capec":[{"id":"CAPEC-88","name":"OS Command Injection"}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2025-07-24T15:28:37.159599Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"keras","vulnerableRanges":[">=3.0.0, <3.9.0",">=3.0.0, <3.8.0"],"patched":["3.9.0","3.8.0"],"from":["GHSA-48g7-3x6r-xfhp","PYSEC-2025-122"],"provenance":"source"}],"euvd":{"id":"EUVD-2025-7406","exploited":false,"provenance":"source"},"exploits":[{"id":52359,"url":"https://www.exploit-db.com/exploits/52359","title":"Keras 2.15 - Remote Code Execution (RCE)","date":"2025-07-16","verified":false,"provenance":"source"}],"summary":{"text":"The flaw is in Google's Keras, specifically the Model.load_model function, which permits arbitrary code execution even when safe_mode=True is set. An attacker can achieve this by hand-crafting a malicious .keras archive whose config.json specifies arbitrary Python modules and functions with their arguments, which are then loaded and executed during model loading, requiring a victim to load the crafted model file (local access, with user interaction).","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T05:37:46Z"},"lineage":{"familyId":"fam-keras-team-keras-cve-2025-1550","children":[{"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"]}]},{"from":"CVE-2025-1550","to":"CVE-2025-9906","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:keras","fromFixed":"3.9.0","toFixed":"3.11.0","daysApart":192},{"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"]}]},{"from":"CVE-2025-1550","to":"CVE-2026-12480","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["keras/src/models/functional.py"],"commits":["https://github.com/keras-team/keras/commit/e67ac8ffd0c883bec68eb65bb52340c7f9d3a903","https://github.com/keras-team/keras/commit/d5a88bdb137c0d3039b8f4bbbe8c7099925cc10c","https://github.com/keras-team/keras/commit/8f987f11bf7512f0df4774a8f1557bba07dc2b49"],"basis":"shared function","functions":["process_layer"]}]}],"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}],"package":"PyPI:keras"}}