Keras is vulnerable to arbitrary local file loading and Server-Side Request Forgery
CVE-2025-12058 · GHSA-mq84-hjqx-cwf2 · published 2025-10-29
- Severity
- Medium
- CVSS score
- 5.9
- Chance of exploitation (EPSS)
- 0.25%
- Fixed in
- 3.12.0
- Exploitation No known exploitation
- Automatable No
- Technical impact Partial
- CISA SSVC
The Keras.Model.loadmodel method, including when executed with the intended security mitigation safemode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF).
Upgrade keras to 3.12.0 or later.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| keras | PyPI | < 3.12.0 | 3.12.0 |
- CriticalMLflow: Unauthenticated full-read SSRF in webhook delivery: _validate_webhook_url bypassed via unvalidated HTTP redirects (and DNS rebindingmlflowExploited
- Critical@zereight/mcp-gitlab Vulnerable to Server-Side Request Forgery@zereight/mcp-gitlab
- CriticalSSRF + LLM API key exfiltration via user-controlled basepath / baseUrl in 8 chat-model nodesflowise, flowise-components
- CriticalLocalAI POST /models/apply permits unauthenticated server-side request forgery through gallery URLsgithub.com/mudler/LocalAI
- CriticalFastMCP OpenAPI Provider has an SSRF & Path Traversal Vulnerabilityfastmcp
- CriticalBentoML SSRF Vulnerability in File Upload Processingbentoml
- 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.