Arbitrary Code Execution via Crafted Keras Config for Model Loading
CVE-2025-1550 · GHSA-48g7-3x6r-xfhp · published 2025-03-11 · updated 2026-06-06
- Severity
- High
- CVSS score
- 7.3
- Chance of exploitation (EPSS)
- 2.6%
- Fixed in
- 3.9.0
- Exploitation Public proof of concept
- Automatable No
- Technical impact Total
- CISA SSVC
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.
Upgrade keras to 3.9.0 or later.
This problem is fixed starting with version 3.9.
Only load models from trusted sources and model archives created with Keras.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| keras | PyPI | >= 3.0.0, < 3.9.0 | 3.9.0 |
- CriticalUnauthenticated Remote Code Execution in Langflow via Public Flow Build EndpointlangflowExploited
- CriticalRay is vulnerable to Critical RCE via Safari & Firefox Browsers through DNS Rebinding AttackrayExploited
- CriticalLangflow Unauth RCElangflow, langflow-baseExploited
- HighLiteLLM: Authenticated command execution via MCP stdio test endpointslitellmExploited
- CriticalMLflow vulnerable to remote code execution on unauthenticated servers via third-party scorer deserialization importing caller-placed artifacmlflow
- CriticalAgno: Arbitrary code execution via `eval()` on `field_type` in `FunctionCall`agno
- CriticalKeras framework vulnerable to deserialization of untrusted datakeras
- CriticalKeras code injection vulnerabilitykeras
- HighKeras: TorchModuleWrapper can deserialize unsafe PyTorch pickle datakeras, keras
- HighKeras: Lambda deserialization can bypass safe mode and execute codekeras, keras
- HighKeras archive extraction utilities allow path traversal and arbitrary file writeskeras
- HighKeras vulnerable to DoS via Malicious .keras Model (HDF5 Shape Bomb Causes Petabyte Allocation in KerasFileEditor)keras, keras
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.