CVE-2025-1550
Arbitrary Code Execution via Crafted Keras Config for Model Loading
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.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- Active
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.3
Arbitrary Code Execution via Crafted Keras Config for Model Loading
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.
- Record
CVE-2025-1550- CVSS 4.0
- 7.3 High
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 - Weakness
- CWE-94
- Updated
- 2026-11-02
EUVDEUVD-2025-7406
7.3
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.
- Record
EUVD-2025-7406- CVSS 4.0
- 7.3 High
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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-48g7-3x6r-xfhp
7.3
Arbitrary Code Execution via Crafted Keras Config for Model Loading
Impact
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.
Patches
This problem is fixed starting with version 3.9.
Workarounds
Only load models from trusted sources and model archives created with Keras.
References
- Record
GHSA-48g7-3x6r-xfhp- CVSS 4.0
- 7.3 High
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 - Weakness
- CWE-94
- Updated
- 2026-11-02
NVD
7.3
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.
- Record
CVE-2025-1550- CVSS 4.0
- 7.3 High
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 - CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
OSV
7.3
Arbitrary Code Execution via Crafted Keras Config for Model Loading
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.
- Record
CVE-2025-1550- CVSS 4.0
- 7.3 High
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 - Weakness
- CWE-94
- Updated
- 2026-11-02
OSVGHSA-48g7-3x6r-xfhp
7.3
Arbitrary Code Execution via Crafted Keras Config for Model Loading
Impact
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.
Patches
This problem is fixed starting with version 3.9.
Workarounds
Only load models from trusted sources and model archives created with Keras.
References
- Record
GHSA-48g7-3x6r-xfhp- CVSS 4.0
- 7.3 High
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 - Weakness
- CWE-94
- Updated
- 2026-11-02
OSVPYSEC-2025-122
9.8
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.
- Record
PYSEC-2025-122- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2025-1550
7.3
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.
- Record
UBUNTU-CVE-2025-1550- CVSS 4.0
- 7.3 High
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 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVAZL-58360 No score
CVE-2025-1550 affecting package keras for versions less than 3.3.3-2
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.
- Record
AZL-58360- Updated
- 2026-11-05
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
kerasPyPI |
3.0.0 up to 3.9.0 | 3.9.0 |
kerasAzure Linux:3 |
before 3.3.3-2 | 3.3.3-2 |
kerasPyPI |
3.0.0 up to 3.9.0, plus listed versions 3.0.13.0.23.0.33.0.43.0.5 Show 14 moreShow less3.1.03.1.13.2.03.2.13.3.03.3.13.3.23.3.33.4.03.4.13.5.03.6.03.7.03.8.0 |
3.9.0 |
kerasPyPI |
3.0.0 up to 3.8.0, plus listed versions 3.0.13.0.23.0.33.0.43.0.5 Show 13 moreShow less3.1.03.1.13.2.03.2.13.3.03.3.13.3.23.3.33.4.03.4.13.5.03.6.03.7.0 |
3.8.0 |
kerasUbuntu:18.04:LTS |
All versions, plus listed versions 1.0.7-22.1.1-1 |
None known |
kerasUbuntu:20.04:LTS |
All versions, plus listed versions 2.2.4-1 |
None known |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| Exploit-DB | Keras 2.15 - Remote Code Execution (RCE) | 2025-07-16 |
| PoC in GitHub | ChCh0i/cve-2025-1550 | 2025-10-24 |
History
| Recorded | Changed | Sources |
|---|---|---|
| facts | OSV | |
| first indexed | CVE List, EUVD, Exploit-DB, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-1550 is a high vulnerability (CVSS 7.3) in Google Keras, published March 11, 2025. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 2.60%, the 85th percentile. Fixed in keras 3.9.0.
References
github.com/keras-team/keras/pull/20751
towerofhanoi.it/writeups/cve-2025-1550
github.com/keras-team/keras/security/advisories/GHSA-48g7-3x6r-xfhp
nvd.nist.gov/vuln/detail/CVE-2025-1550
github.com/keras-team/keras/commit/e67ac8ffd0c883bec68eb65bb52340c7f9d3a903
github.com/keras-team/keras/releases/tag/v3.9.0
Show 7 moreShow less
github.com/pypa/advisory-database/tree/main/vulns/keras/PYSEC-2025-122.yaml
github.com/advisories/GHSA-48g7-3x6r-xfhp
github.com/CVEProject/cvelistV5/tree/main/cves/2025/1xxx/CVE-2025-1550.json
github.com/keras-team/keras
pypi.org/project/keras
ubuntu.com/security/CVE-2025-1550
cve.org/CVERecord?id=CVE-2025-1550