Arbitrary Code Execution via Crafted Keras Config for Model Loading (Google Keras)
At a glance
- Source
- NVD
- EPSS
- EPSS 2.63 % · percentile 85 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- NVD status
- Analyzed
Description
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.
Weaknesses (CWE)
- CWE-94 — Improper Control of Generation of Code
References
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 4.0 | HIGH 7.3 | 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 | |
| CVSS 4.0 | HIGH 7.3 | 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X | NVD · cve-coordination@google.com (Secondary) |
| CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NVD · nvd@nist.gov (Primary) |
Advisories
- GHSA-48g7-3x6r-xfhp — Arbitrary Code Execution via Crafted Keras Config for Model Loading
- PYSEC-2025-122 — The Keras Model.load_model function permits arbitrary code execution, even with safe_mode=True, through a manually constructed, malicious .keras archive. By alt
European references
- ENISA EUVD · EUVD-2025-7406
- GCVE · GCVE-0-2025-1550
Affected configurations (NVD CPE)
cpe:2.3:a:keras:keras:*:*:*:*:*:*:*:*≥ 3.0.0 < 3.8.0
Affected products
| Product | Versions |
|---|---|
| Google · Keras | affected 3.0.0 < 3.8.0 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |