{"id":"CVE-2025-1550","aliases":["CVE-2025-1550","GHSA-48g7-3x6r-xfhp","PYSEC-2025-122"],"related":[],"kind":"vulnerability","state":"published","title":"Arbitrary Code Execution via Crafted Keras Config for Model Loading","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nThe 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.\n\n### Patches\n\nThis problem is fixed starting with version `3.9`.\n\n### Workarounds\n\nOnly load models from trusted sources and model archives created with Keras.\n\n### References\n\n- https://www.cve.org/cverecord?id=CVE-2025-1550\n- https://github.com/keras-team/keras/pull/20751","format":"markdown","source":"ghsa"},{"lang":"es","text":"La función Keras Model.load_model permite la ejecución de código arbitrario, incluso con safe_mode=True, a través de un archivo .keras malicioso creado manualmente. Al alterar el archivo config.json dentro del archivo, un atacante puede especificar módulos y funciones Python arbitrarios, junto con sus argumentos, para que se carguen y ejecuten durante la carga del modelo.","source":"nvd"}],"published":"2025-03-11T08:12:34.974Z","modified":"2026-09-10T03:50:56.790Z","severity":{"scorer":"Google","scheme":"CVSS: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","score":7.3,"rating":"HIGH"},"severities":[{"scorer":"Google","scheme":"CVSS: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","score":7.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS: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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"type":"python","introduced":"3.0.0","fixed":"3.8.0","status":"affected"}],"vendor":"Google","product":"Keras","repo":"https://github.com/keras-team/keras","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0","status":"affected","fixed":"3.9.0"}],"ecosystem":"PyPI","package":"keras","purl":"pkg:pypi/keras","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"3.0.0","fixed":"3.8.0"}],"vendor":"keras","product":"keras","cpe":"cpe:2.3:a:keras:keras:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0","status":"affected","fixed":"3.8.0"}],"ecosystem":"PyPI","package":"keras","purl":"pkg:pypi/keras","source":"pysec"}],"references":[{"url":"https://github.com/keras-team/keras/pull/20751","tags":["fix","issue-tracking","patch","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://towerofhanoi.it/writeups/cve-2025-1550/","tags":["evidence","exploit","third-party-advisory"],"sources":["cvelist","nvd","pysec"]},{"url":"https://github.com/keras-team/keras/security/advisories/GHSA-48g7-3x6r-xfhp","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-1550","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/keras-team/keras/commit/e67ac8ffd0c883bec68eb65bb52340c7f9d3a903","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/keras-team/keras","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/keras-team/keras/releases/tag/v3.9.0","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/keras/PYSEC-2025-122.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://towerofhanoi.it/writeups/cve-2025-1550","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-48g7-3x6r-xfhp","tags":["advisory"],"sources":["pysec"]}],"credits":["Gabriele Digregorio"],"assigner":"Google","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2025-07-24T15:28:37.159Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-1550","url":"https://www.cve.org/CVERecord?id=CVE-2025-1550","licence":"CVE Terms of Use","modified":"2025-07-24T15:28:42.230Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-48g7-3x6r-xfhp","url":"https://github.com/advisories/GHSA-48g7-3x6r-xfhp","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:56.790Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-1550","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-1550","licence":"Public domain","modified":"2026-06-17T08:39:21.253Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2025-122","url":"https://osv.dev/vulnerability/PYSEC-2025-122","licence":"CC-BY-4.0","modified":"2026-06-10T17:01:53.711Z"}],"updatedAt":"2026-11-25T22:58:55.106Z","epss":{"score":0.02882,"percentile":0.87606,"date":"2026-11-30T12:00:22.000Z"}}