Skip to main content

Keras CVE-2025-12060

HIGH
Path Traversal (CWE-22)
2025-10-30 cve-coordination@google.com
8.9
CVSS 4.0 · Vendor: google
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Host malicious tar archive with crafted symlinks
  2. Delivery
    Victim app calls get_file(extract=True)
  3. Exploit
    Symlink/PATH_MAX quirk bypasses path filter
  4. Execution
    Write arbitrary file outside target dir
  5. Impact
    Overwrite startup/module file for code execution

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires a victim application to call keras.utils.get_file() with the non-default extract=True option on a tar archive whose source or contents are attacker-controlled; plain (non-extracted) downloads and zip archives via the same API are not the vector described. The bypass further depends on the underlying Python tarfile PATH_MAX symlink-resolution behavior (CVE-2025-4517), so it needs sufficiently long/crafted symlink paths to make failed resolution fall back to literal traversal paths. Limiting factors that reduce real-world risk: the victim must initiate the fetch/extraction of an attacker-influenced archive (user interaction), the target must still run Keras <= 3.11.3 (upgrading Python alone does NOT remediate - Keras 3.12.0 is required), and deployments that only extract trusted vendor datasets/models are not practically exposed.

Impact

The vendor CVSS 4.0 base score of 8.9 (AV:N/AC:L/AT:P/PR:L/UI:P) looks severe at first glance, but several signals temper the real-world urgency. The network vector (AV:N) reflects that the malicious tar is fetched remotely, yet exploitation is gated by two conditions the attacker does not fully control: a victim application must call keras.utils.get_file() with extract=True against attacker-influenced content (UI:P), and the bypass depends on the Python tarfile PATH_MAX symlink-resolution quirk inherited from CVE-2025-4517 (AT:P). No CISA KEV listing is present, so this is NOT confirmed actively exploited; no EPSS score was supplied, so widespread-exploitation probability cannot be quantified from the input. However, publicly available exploit code exists - the GHSA advisory (GHSA-hjqc-jx6g-rwp9) includes a Proof of Concept section with working code - which raises the practical risk above a theoretical path-traversal. Signals conflict on access: the vendor vector encodes PR:L (implying some privilege/authentication), but the actual gate is victim interaction plus an attacker-controlled archive, not authentication to the target - treat the 'authenticated' implication of PR:L with caution and verify against your deployment. No SSVC decision data (exploitation/automatable/technical-impact) was provided. Net: a genuine, high-impact arbitrary-file-write-to-RCE risk for ML pipelines that download and extract untrusted or user-supplied tar archives, but materially lower risk for deployments that only fetch from trusted, vendor-controlled sources.

Exploit ScenarioDerived

An attacker hosts a specially crafted tar archive containing long-path symlinks and induces a victim ML application to retrieve it via keras.utils.get_file(url, extract=True). During extraction, tarfile.extractall() runs without filter="data" and the PATH_MAX symlink-resolution bug causes a traversal path to be written literally, placing attacker files (e.g. a malicious Python module, cron entry, or SSH authorized_keys) outside the intended directory and enabling code execution. A working Proof of Concept is published in the GHSA advisory; because the trigger relies on a normal library call and a symlink quirk, exploitation is realistic but requires the victim to extract attacker-controlled content.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 19, 2026

Directory traversal in Keras through 3.11.3 allows an attacker who supplies a crafted tar archive to keras.utils.get_file(..., extract=True) to write files outside the intended extraction directory, including via symlink-based traversal that bypasses Keras's existing path filter. The issue is tied to Python tarfile's PATH_MAX symlink-resolution behavior (CVE-2025-4517) and to Keras calling tarfile.extractall without filter='data'; upgrading Python alone does not remediate it. Publicly available exploit code exists (a proof-of-concept is included in the GitHub advisory), exploitation requires the victim application to fetch and extract an attacker-influenced tar archive, and no CISA KEV entry is available.

RemediationAI

Upgrade Keras to 3.12.0 or later; this is required even if Python has already been updated for CVE-2025-4517 (for example, Python 3.13.4). Vendor advisories and the fix are at https://github.com/keras-team/keras/security/advisories/GHSA-hjqc-jx6g-rwp9 and https://github.com/keras-team/keras/pull/21760. If upgrading immediately is not possible, do not call keras.utils.get_file with extract=True on tar archives from untrusted or attacker-influenced sources; instead download and inspect or extract archives with an external tool that enforces filter='data' on Python 3.12 or later, and restrict extraction to a sandboxed directory with minimal filesystem permissions. These workarounds reduce exposure but do not fix the in-process Keras code path, and they trade automation convenience for manual archive handling.

Affected Packages

pypi keras fix: 3.12.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability is a CWE-22 path traversal in Keras's archive-handling utilities, specifically keras.utils.get_file with the non-default extract=True option for tar archives. Keras previously enumerated archive members with filter_safe_paths() but still invoked Python's tarfile.extractall without the security-critical filter='data' option introduced in Python 3.12. During extraction, tarfile's symlink resolution can fail when crafted paths exceed PATH_MAX, causing the symlink to be interpreted as a literal path; this allows archive members to escape the destination directory despite the pre-filter. The same underlying Python defect is tracked as CVE-2025-4517. Zip archives and plain, non-extracted downloads through the same API are not the described vector. The upstream fix replaces direct extractall calls with extract_open_archive(), applies filter='data' on Python 3.12 through 3.13, and adds tar and zip member filtering.

Know when Keras gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (google) PRIMARY 8.9 HIGH
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
vuln.today AI 8.3 HIGH

Victim must extract an attacker-supplied tar via get_file(extract=True) (UI:R) and the PATH_MAX symlink quirk raises complexity (AC:H); no target privileges (PR:N), arbitrary write escapes the extraction dir (S:C) enabling code execution (C/I/A:H).

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Red Hat 8.3 HIGH

Primary rating from Vendor (google).

CVSS VectorVendor: google

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
High

DescriptionCVE.org

The keras.utils.get_file API in Keras, when used with the extract=True option for tar archives, is vulnerable to a path traversal attack. The utility uses Python's tarfile.extractall function without the filter="data" feature. A remote attacker can craft a malicious tar archive containing special symlinks, which, when extracted, allows them to write arbitrary files to any location on the filesystem outside of the intended destination folder. This vulnerability is linked to the underlying Python tarfile weakness, identified as CVE-2025-4517. Note that upgrading Python to one of the versions that fix CVE-2025-4517 (e.g. Python 3.13.4) is not enough. One additionally needs to upgrade Keras to a version with the fix (Keras 3.12).

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 3 pypi packages depend on keras (3 direct, 0 indirect)

Ecosystem-wide dependent count for version 3.12.0.

Executive ViewAI

Why It Matters

Keras, a widely used open-source machine learning library embedded in many internal data-science and model-training pipelines, has a high-severity file-write vulnerability in versions through 3.11.3 that can let an attacker plant or overwrite files on systems that download and unpack model or dataset archives. Any team that uses Keras to fetch third-party archives is exposed, which raises supply-chain and data-integrity concerns beyond a single application. Leadership should care because the flaw has publicly available exploit code and no vendor patch yet, so exposure persists until engineering changes how archives are handled.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: avoid keras.utils.get_file(..., extract=True) on untrusted tar archives; pre-validate archive members and reject absolute paths, traversal sequences, and symlinks/hardlinks that resolve outside the destination; perform extraction in a sandboxed, low-privilege container with read-only mounts and no access to sensitive paths; restrict outbound fetches to allowlisted, hash-verified sources; monitor for unexpected file creation outside extraction directories.

Threat Intelligence Overview

EPSS Score
0.6%
Top 51% exploitable
Prevalence
High
Keras is a widely deployed deep-learning library across ML/AI production stacks
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

More in Keras

View all
CVE-2025-9905 HIGH POC
7.3 Sep 19

The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True. Rated

CVE-2025-49655 CRITICAL
9.8 Oct 17

Deserialization of untrusted data in Keras 3.11.0 through 3.11.2 allows remote code execution when a victim loads a mali

CVE-2024-3660 CRITICAL
9.8 Apr 16

A arbitrary code injection vulnerability in TensorFlow's Keras framework (<2.13) allows attackers to execute arbitrary c

CVE-2025-9906 HIGH
8.6 Sep 19

The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True. Rated

CVE-2026-11816 HIGH
8.1 Jun 11

Path traversal in Keras archive extraction utilities prior to version 3.14.0 allows remote attackers to write files outs

CVE-2026-0897 HIGH
7.1 Jan 15

Memory-exhaustion denial of service in Google Keras 3.0.0 through 3.13.0 lets a remote attacker crash the Python interpr

CVE-2026-1669 HIGH
7.1 Feb 11

Arbitrary local file disclosure in Keras 3.0.0 through 3.13.1 allows a remote attacker to read sensitive files from a vi

CVE-2025-12058 MEDIUM
5.9 Oct 29

Keras Model.load_model fails to enforce safe_mode=True for the StringLookup layer's vocabulary path handling, so a malic

CVE-2025-8747 HIGH
8.6 Aug 11

A safe mode bypass vulnerability in the `Model.load_model` method in Keras versions 3.0.0 through 3.10.0 allows an attac

CVE-2024-55459 MEDIUM
6.5 Jan 08

An issue in keras 3.7.0 allows attackers to write arbitrary files to the user's machine via downloading a crafted tar fi

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy