CVEFinder.io

CVE-2025-12058

πŸ”Ά medium
πŸ” Scan for this CVE
Summary

The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF). This vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path. * Arbitrary Local File Read: A

Description

The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF).


This vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path.

* Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system.


* Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition.


The security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.

CVSS Score
-
EPSS Score
0.1
Exploit Probability
Published Date
2025-10-29
First Seen: 2026-01-05
🎯 CISA SSVC Assessment Updated: Oct 29, 2025
πŸ” Exploitation Status
None
No known exploits
βš™οΈ Automatable
NO
Requires human interaction
πŸ’₯ Technical Impact
Partial
Limited system impact
πŸ† Discovered By
Jayashwa Singh Chauhan
SSVC data provided by CISA
Last Modified 2025-10-30
CVSS Vector 4.0 CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L/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
CWE IDs (Weakness Types)

πŸ“¦ Affected Products 1

πŸ”— References 2

πŸ”— Related CVEs 6

CVE ID Severity CVSS EPSS Summary Published
CVE-2026-12481 β›” critical 9.8 0.4 A vulnerability in keras-team/keras version 3.14.0 allows for arbitrary code execution due to improper handling of deser... 2026-07-03
CVE-2026-11816 ⚠️ high 8.1 0.6 Keras versions prior to 3.14.0 are vulnerable to a path traversal issue in the archive extraction utilities located in `... 2026-06-11
CVE-2026-1462 ⚠️ high 7.8 0.4 A vulnerability in the `TFSMLayer` class of the `keras` package, version 3.13.0, allows attacker-controlled TensorFlow S... 2026-04-13
CVE-2026-1669 ⚠️ high 7.5 0.3 Arbitrary file read in the model loading mechanism (HDF5 integration) in Keras versions 3.0.0 through 3.13.1 on all supp... 2026-02-11
CVE-2026-0897 ⚠️ high 7.5 0.3 Allocation of Resources Without Limits or Throttling in the HDF5 weight loading component in Google Keras 3.0.0 throu... 2026-01-15
CVE-2025-12060 πŸ”Ά medium - 0.1 The keras.utils.get_file API in Keras, when used with the extract=True option for tar archives, is vulnerable to a path ... 2025-10-30
These CVEs affect the same products