cbcvebase.
CVE-2025-1550
published 2025-03-11

CVE-2025-1550: The Keras Model.load_model function permits arbitrary code execution, even with safe_mode=True, through a manually constructed, malicious .keras archive. By…

PriorityP266critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EXPLOIT
EPSS
2.80%
84.8th percentile
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.

Affected

7 ranges
VendorProductVersion rangeFixed in
debiankeras
googlekeras>= 3.0.0 < 3.8.03.8.0
keraskeras>= 3.0.0 < 3.8.03.8.0
keraskeras>= 3.0.0 < 3.11.03.11.0
keraskeras>= 3.0.0 < 3.9.03.9.0
msrcazl3_keras_3.3.3-2_on_azure_linux_3.0
msrcazl3_mozjs_102.15.1-1_on_azure_linux_3.0

Detection & IOCsextracted from sources · hover to see the quote

filenamemalicious_model.keras
path/tmp/malicious_model.keras
filenameconfig.json
yara
rule CVE_2025_1550_malicious_keras_config { strings: $class_name = "\"class_name\": \"function\"" $module_os = "\"module\": \"os\"" $fn_system = "\"function_name\": \"system\"" condition: all of them }
  • Monitor for .keras archive files containing a config.json with 'class_name': 'function' entries specifying arbitrary 'module' and 'function_name' fields — this is the core deserialization gadget used to achieve RCE.
  • Detect Lambda layers in Keras config.json with a 'function' object whose 'module' is set to 'os' and 'function_name' is set to 'system' — this is the specific payload pattern used in the PoC exploit.
  • Alert on processes spawning child processes (e.g., shell commands) from within a Python process that has loaded a .keras model file — indicates successful exploitation of the deserialization vulnerability.
  • Inspect .keras ZIP archives (they are ZIP files) for a config.json containing 'class_name': 'Lambda' layers with embedded 'function' deserialization objects referencing non-Keras Python modules.
  • The exploit is effective even when safe_mode=True is set; do not rely on safe_mode as a security control for untrusted .keras files.
  • Watch for creation of unexpected files in /tmp (e.g., /tmp/pwned_by_keras) immediately following a keras load_model() call — a common canary indicator of exploitation.
  • ·safe_mode=True does NOT prevent exploitation — the vulnerability bypasses this protection entirely via manually crafted .keras archives.
  • ·Affected versions are Keras <= 2.15 and TensorFlow versions using unsafe deserialization paths prior to the April 2025 patch.
  • ·The attack vector is client-side: exploitation occurs at model load time via load_model() or model_from_json(), not over a network service — any system loading untrusted .keras files is at risk.

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv4.07.3HIGHCVSS: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
ghsa7.3HIGH
osv7.3HIGH
vendor_msrc9.8CRITICAL
vendor_debian7.3LOW
vendor_redhat7.3HIGH
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.