CVE-2025-12058
Last modified
CVE-2025-12058 is a medium-severity vulnerability rated 5.9/10 on the CVSS scale. 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. EPSS estimates a 0.24% chance of exploitation in the next 30 days.
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.
Metrics
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
Weakness Enumeration
References
Timeline
- Published
- Last Modified
- Status
- Deferred
Frequently Asked Questions
What is CVE-2025-12058?
How severe is CVE-2025-12058?
How do I fix CVE-2025-12058?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2025
- CVE-2025-12051The drivers in the tool packages use RTL_QUERY_REGISTRY_DIRE…7.8
- CVE-2025-12052The drivers in the tool packages use RTL_QUERY_REGISTRY_DIRE…7.8
- CVE-2025-12053The drivers in the tool packages use RTL_QUERY_REGISTRY_DIRE…7.8
- CVE-2025-12055HYDRA X, MIP 2 and FEDRA 2 of MPDV Mikrolab GmbH suffer from…7.5
- CVE-2025-12056Out-of-bounds Read in Shelly Pro 3EM (before v1.4.4) allows …8.3
- CVE-2025-12057The WavePlayer WordPress plugin before 3.8.0 does not have a…9.8
- CVE-2025-12059Insertion of Sensitive Information into Externally-Accessibl…9.8
- CVE-2025-1206A vulnerability was found in Codezips Gym Management System …8.8
- CVE-2025-12060The keras.utils.get_file API in Keras, when used with the ex…8.9
- CVE-2025-12061The TAX SERVICE Electronic HDM WordPress plugin before 1.2.1…8.6
- CVE-2025-12062The WP Maps – Store Locator,Google Maps,OpenStreetMap,Mapbox…8.8
- CVE-2025-12063An insecure direct object reference allowed a non-admin user…5.7
Are you affected by CVE-2025-12058?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
