Read the docs
TI-2025-11056 Aliases CVE-2025-12058GHSA-mq84-hjqx-cwf2

Vulnerability in Keras Model.load_model Leading to Arbitrary Local File Loading and SSRF

Priority LOW 26CWE-502Published · Updated

Key facts

Attack vector
Adjacent network
Privileges required
Low
User interaction
Passive
Attack complexity
High
Attack requirements
Present
Impact type
Code execution
Confidentiality · integrity · availability
High · Low · Low
Fix status
Partial Red Hat: 2 without a fix

Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-502.

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: 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.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00248 16th percentileScored 2026-11-07
Fix Partial Keras (Keras): 3.12.0keras (PyPI): 3.12.0Red Hat: 2 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
keras-teamKerasbefore 3.12.03.12.0Patch availableCNA
—keras (PyPI)before 3.12.03.12.0Patch availableGHSA-mq84-hjqx-cwf2
  • Keras Vendorkeras-team Affected before 3.12.0 Fixed in 3.12.0 Patch available CNA
  • keras (PyPI) Vendor— Affected before 3.12.0 Fixed in 3.12.0 Patch available GHSA-mq84-hjqx-cwf2

Remediation

  • Fix · CNA Keras (Keras) Fixed in 3.12.0
  • Fix · GHSA-mq84-hjqx-cwf2 keras (PyPI) Fixed in 3.12.0 Advisory →

Vendor assessments

Red Hat

Red Hat rating: Moderate. Red Hat's page for this CVE →

ProductStatusPlan or fix
Red Hat OpenShift AI (RHOAI)AffectedNo fix yet: Fix deferred
Red Hat Trusted Artifact SignerAffectedNo fix yet: Fix deferred

Timeline

  1. 2026-10-02 Threatist record created from CVE-2025-12058
  2. 2026-10-03 Alias added: GHSA-mq84-hjqx-cwf2

References

  • TI-2025-31626 Deserialization of untrusted data in keras-team Keras CVSS 3.1CRITICAL 9.8
  • TI-2026-10715 Deserialization of Untrusted Data in keras-team/keras CVSS 3.1CRITICAL 9.8
  • TI-2026-01159 Safe Mode Bypass in keras-team/keras CVSS 3.0HIGH 8.8
  • TI-2025-08001 Keras safe_mode bypass allows arbitrary code execution when loading a malicious model. CVSS 4.0HIGH 8.6
  • TI-2026-10199 Path Traversal in keras-team/keras CVSS 3.0HIGH 8.1
  • TI-2025-11591 Path Traversal Vulnerability in keras-team/keras via Tar Archive Extraction in keras.utils.get_file() CVSS 3.0HIGH 8.0
See all 20 →

Sources