{"id":"CVE-2025-49655","kind":"vulnerability","aliases":["CVE-2025-49655","GHSA-cvhh-q5g5-qprp"],"related":[],"title":"Keras framework vulnerable to deserialization of untrusted data","description":"Deserialization of untrusted data can occur in versions of the Keras framework running versions 3.11.0 up to but not including 3.11.3, enabling a maliciously uploaded Keras file containing a TorchModuleWrapper class to run arbitrary code on an end user’s system when loaded despite safe mode being enabled. The vulnerability can be triggered through both local and remote files.","summary":"Keras versions 3.11.0 up to 3.11.3 deserialize a TorchModuleWrapper class from a model file, so a malicious .keras file can run arbitrary code when loaded. The code runs even with safe mode enabled.","severity":"critical","cvss":9.8,"epss":0.0075,"exploited":false,"exploited_at":null,"products":[{"name":"keras","fixed":["3.11.3"],"affected":">= 3.11.0, < 3.11.3","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["cwe-502","keras","ml-pipelines","model-serving","package","python"],"not_affected_if":["keras-3.11.3-or-later","keras-below-3.11.0","only-trusted-local-models"],"how_to_check":"- Run `pip show keras` and look for a version from `3.11.0` up to but not including `3.11.3`\n- Search requirements files and lockfiles for `keras` pins in that range","fix":"- Upgrade the pypi package keras to `3.11.3`\n- Only load model files from trusted sources until the upgrade is done","status":"open","published_at":"2025-10-17T16:15:37+00:00","first_seen_at":"2026-10-27T17:22:22+00:00","triaged_at":"2026-10-27T17:23:41+00:00","updated_at":"2026-10-27T17:32:47+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-27T17:23:41Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade the pypi package keras to `3.11.3`\n- Only load model files from trusted sources until the upgrade is done","reach":"network","title":"Keras: crafted model file runs code on load despite safe mode","impact":"high","summary":"Keras versions 3.11.0 up to 3.11.3 deserialize a TorchModuleWrapper class from a model file, so a malicious .keras file can run arbitrary code when loaded. The code runs even with safe mode enabled.","category":"package","nicknames":[],"who_cares":["python","keras","ml-pipelines","model-serving"],"confidence":0.8,"needs_auth":"unknown","worst_case":"Code runs on the machine that loads the model file","analyst_note":"","how_to_check":"- Run `pip show keras` and look for a version from `3.11.0` up to but not including `3.11.3`\n- Search requirements files and lockfiles for `keras` pins in that range","needs_analyst":false,"not_affected_if":["keras-below-3.11.0","keras-3.11.3-or-later","only-trusted-local-models"],"who_is_affected":"Any application that loads Keras model files from a path or URL it does not fully control, such as user uploads, model hubs or shared artifacts. Systems that only load models they built and stored themselves are much less exposed. Teams not using Keras 3.11.x can skip it.","user_interaction":"yes","needs_special_setup":"no","severity_if_unknown":"critical"},"cost_usd":0.000593,"input_tokens":3391,"output_tokens":508,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2025':10A,18A '-49655':11A,19A '-502':22B '3.11.0':34B,79C '3.11.3':37B,85C 'arbitrari':53B,98C 'class':41B,95C 'code':54B,58B,99C 'contain':92C 'cve':9A,17A 'cvhh':14A 'cwe':21B 'data':8A,68C 'deseri':5A,38B,65C 'despit':108C 'enabl':64B,86C,112C 'end':102C 'even':60B 'file':45B,50B,91C,123C 'framework':2A,76C 'ghsa':13A 'ghsa-cvhh-q5g5-qprp':12A 'includ':84C 'kera':1A,23B,32B,49B,75C,90C 'keras':20A 'load':56B,107C 'local':120C 'malici':48B,88C 'ml':25B 'ml-pipelin':24B 'mode':63B,110C 'model':28B,44B 'model-serv':27B 'occur':70C 'packag':30B 'pipelin':26B 'python':31B 'q5g5':15A 'qprp':16A 'remot':122C 'run':52B,59B,77C,97C 'safe':62B,109C 'serv':29B 'system':105C 'torchmodulewrapp':40B,94C 'trigger':117C 'untrust':7A,67C 'upload':89C 'user':103C 'version':33B,72C,78C 'vulner':3A,114C","nicknames":[],"mitigations":[],"who_affected":"Any application that loads Keras model files from a path or URL it does not fully control, such as user uploads, model hubs or shared artifacts. Systems that only load models they built and stored themselves are much less exposed. Teams not using Keras 3.11.x can skip it.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2025-10-17T16:15:37+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-cvhh-q5g5-qprp","url":"https://github.com/advisories/GHSA-cvhh-q5g5-qprp","severity":"critical","published_at":"2025-10-17T18:31:07+00:00","modified_at":"2026-10-27T17:19:23+00:00","first_seen_at":"2026-10-27T17:22:22+00:00","fetched_at":"2026-10-27T17:27:30+00:00","note":null},{"source":"nvd","external_id":"CVE-2025-49655","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-49655","severity":null,"published_at":"2025-10-17T16:15:37+00:00","modified_at":"2026-10-19T16:10:00+00:00","first_seen_at":"2026-10-27T17:32:47+00:00","fetched_at":"2026-10-27T17:32:47+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}