5.9

CVE-2025-12058: keras Deserialization of Untrusted Data

CVSS: 5.9v4.0MediumDeferred
AliasesGHSA-mq84-hjqx-cwf2GHSA-qg93-c7p6-gg7fPYSEC-2026-1487
Published 29-10-2025Last modified 29-10-2025

Vulnerability summary

CVE-2025-12058 is a medium (CVSS 5.9) Deserialization of Untrusted Data vulnerability in keras. EPSS estimates a 0.25% chance of exploitation in the next 30 days, higher than 14.9% of scored vulnerabilities.

Overall risk
24/100
0100
Low · default modelHow is this calculated?
CVSS score
5.9/10
010
Medium · v4.0 (CVE.org)
EPSS score
0.25%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 0 · Related 3

Timeline

  1. 29-10-2025
    PublishedVulnerability first disclosed.
  2. 29-10-2025
    Last modifiedVulnerability information updated.

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 metrics

7 scores · 7 sources · 1 version

EPSS trend

Probability

0.25%

Chance of exploitation in the next 30 days

Percentile

15%

Versus all other CVEs

30-day change

0.00 pp

From 0.25% on 18-09-2026

18-09-202618-10-2026
EPSS score
0.25%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Chainguard3 products
  • kubeflow-pipelines-visualization-server< 2.14.3-r2
  • tensorflow-cpu-jupyter< 2.20.0-r4
  • tensorflow-gpu-jupyter< 2.20.0-r3
Debian1 product
  • kerasAll versions (No fix recorded)
Keras1 product
PyPI1 product
  • keras< 3.12.0
Ubuntu1 product
  • kerasAll versions (No fix recorded)
Wolfi1 product
  • kubeflow-pipelines-visualization-server< 2.14.3-r2

6 vendors · 8 products

References

11 links
Show all 11 references