CVE-2025-1550 Details
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.
A vulnerability in the Keras library's Model.load_model function allows for arbitrary code execution, even when safe_mode is enabled. This issue arises from the ability to create a malicious .keras archive that, when loaded, executes specified Python modules and functions with their arguments. The vulnerability is present in Keras versions 3.6 and prior, and is caused by insufficient validation during the deserialization of functional models, which can be exploited by manipulating the config.json file within the .keras archive.
Users can update to Keras version 3.7 or later, where this vulnerability has been addressed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 24, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/keras-team/keras/pull/20751 | [email protected] | Issue TrackingPatch |
| https://towerofhanoi.it/writeups/cve-2025-1550/ | [email protected] | ExploitThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| keras keras | >= 3.0.0, < 3.8.0 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jul 31, 2025 | Initial Analysis | [email protected] |
| Jul 22, 2025 | CVE Modified | [email protected] |
| Mar 11, 2025 | New CVE Received | [email protected] |