Home / Keras / Keras / CVE-2025-12058
CVE-2025-12058: is it exploited, and which versions of Keras are affected and fixed?
CVE-2025-12058 is a deserialization of untrusted data vulnerability in Keras. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 18:39 UTC). Affected: keras before 3.12.0 (GitHub advisory GHSA-mq84-hjqx-cwf2). Fixed in 3.12.0 (GitHub advisory GHSA-mq84-hjqx-cwf2). Severity: Medium (5.9, CVSS 4.0, from Google).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 18:39 UTC, CVE record November 19, 2026, 07:10 UTC and NVD November 19, 2026, 07:16 UTC.
What is CVE-2025-12058?
Vulnerability in Keras Model.load_model Leading to Arbitrary Local File Loading and SSRF
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.
From the CVE record by Google, last updated October 29, 2025, 14:11 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| Keras | Keras | before 3.12.0 | 3.12.0 |
As the CVE record by Google states it, last updated October 29, 2025. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| PyPI | keras | < 3.12.0 | 3.12.0 | GHSA-mq84-hjqx-cwf2 |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated October 29, 2025. Summary: Keras is vulnerable to arbitrary local file loading and Server-Side Request Forgery.
How severe is CVE-2025-12058?
| Score | Version | Vector | Source |
|---|---|---|---|
| Medium 5.9 | CVSS 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 |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2025-12058 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- CISA SSVC
- Exploitation: none; automatable: no; technical impact: partial (CISA ADP, October 29, 2025)
- EPSS
- 0.25% probability of exploitation activity in the next 30 days, percentile 17.7 (FIRST EPSS, scores of December 3, 2026)
What kind of flaw is it?
Where are the vendor advisories and references?
- https://github.com/keras-team/keras/security/advisories/GHSA-qg93-c7p6-gg7f
- https://github.com/keras-team/keras/pull/21751
Who found and reported it?
- Jayashwa Singh Chauhan (finder)
As published in the CVE record; contact details are removed.
When was it published, and where is the official record?
- Reserved
- October 22, 2025
- Published
- October 29, 2025, 08:48 UTC
- CVE record updated
- October 29, 2025, 14:11 UTC by Google
- NVD
- Deferred, last modified October 19, 2026, 13:10 UTC
- Last checked
- CVE list November 19, 2026, 07:10 UTC; NVD November 19, 2026, 07:16 UTC; KEV December 3, 2026, 18:39 UTC; EPSS December 3, 2026
- Official record
- cve.org · NVD
What other CVEs affect Keras?
- Oct 30, 2025CVE-2025-12060 Keras: path traversal (reading or writing files outside the intended folder)
- Oct 17, 2025CVE-2025-49655 Keras: deserialization of untrusted data
- Jan 8, 2025CVE-2024-55459 Keras: download of Code Without Integrity Check
Questions about CVE-2025-12058
Is CVE-2025-12058 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 18:39 UTC. FIRST's EPSS gives it a 0.25% chance of exploitation activity in the next 30 days (scores of December 3, 2026).
Which versions of Keras are affected by CVE-2025-12058?
keras before 3.12.0, per the GitHub advisory GHSA-mq84-hjqx-cwf2. The tables above give every range the sources list.
Which version fixes CVE-2025-12058?
3.12.0, per the GitHub advisory GHSA-mq84-hjqx-cwf2. Check the vendor's advisory before you rely on it.
How severe is CVE-2025-12058?
Medium (5.9, CVSS 4.0, from Google). The severity table above shows each score with its source.
Where is the official record of CVE-2025-12058?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.