Keras CVE-2025-12060 Path Traversal Vulnerability: Brief Summary and Technical Review

This post provides a brief summary and technical review of CVE-2025-12060, a path traversal vulnerability in Keras affecting versions before 3.12.0. The flaw allows arbitrary file writes outside the intended extraction directory when processing tar archives with keras.utils.get_file().
CVE Analysis

8 min read

ZeroPath CVE Analysis

ZeroPath CVE Analysis

2025-11-28

Keras CVE-2025-12060 Path Traversal Vulnerability: Brief Summary and Technical Review
Experimental AI-Generated Content

This CVE analysis is an experimental publication that is completely AI-generated. The content may contain errors or inaccuracies and is subject to change as more information becomes available. We are continuously refining our process.

If you have feedback, questions, or notice any errors, please reach out to us.

[email protected]

Introduction

Attackers can gain arbitrary file write capabilities on systems running vulnerable Keras installations by exploiting a flaw in how tar archives are extracted. This vulnerability has direct implications for any machine learning workflow that downloads and unpacks datasets or models from external sources using Keras utilities.

Keras is a widely adopted deep learning framework maintained by Google and the open-source community. It is used by researchers, enterprises, and cloud services globally, with millions of downloads and integration into major platforms. The keras.utils.get_file() function is a common utility for dataset and model management, making any vulnerability in this area highly impactful for the machine learning ecosystem.

Technical Information

The vulnerability tracked as CVE-2025-12060 affects the keras.utils.get_file() function when used to download and extract tar archives. When the extract parameter is set to True, get_file() delegates extraction to Python's tarfile.extractall() method. In affected versions, this call does not use the filter='data' parameter, which is required to prevent path traversal attacks that leverage symlinks within the archive.

Attackers can create tar archives containing symbolic links that point outside the intended extraction directory. When such an archive is processed by a vulnerable Keras installation, files can be written to arbitrary locations on the filesystem, limited only by the permissions of the running process. This can lead to system compromise or arbitrary code execution if sensitive locations are targeted.

The vulnerability is further complicated by a bug in symlink resolution related to path length limits. Keras attempts to filter unsafe paths using a function called filter_safe_paths(), but this occurs before extraction. During extraction, the tarfile module's symlink resolution can fail due to these path length issues, bypassing the intended security checks.

The patch for this vulnerability introduces a new extraction function that uses filter='data' on Python 3.12 and later, which provides robust protection against path traversal. For earlier Python versions, a custom filter is implemented to validate symlink targets more effectively. The vulnerability is closely related to Python's CVE-2025-4517, which affects tarfile's handling of symlinks and path traversal.

No public proof of concept code is available at this time, but the technical details are sufficient for attackers to construct malicious archives capable of exploiting the flaw.

Affected Systems and Versions

  • Keras versions prior to 3.12.0 are affected.
  • The vulnerability impacts any use of keras.utils.get_file() with extract=True on tar or tar.gz archives.
  • Systems running Python versions vulnerable to CVE-2025-4517 are at additional risk if Keras is not updated.

Vendor Security History

Keras has previously experienced vulnerabilities related to file handling and model deserialization. Notable examples include issues with Lambda layer deserialization and unsafe model loading, which have been addressed in past releases. The Keras team participates in coordinated disclosure programs such as huntr and has demonstrated rapid response to security reports. The fix for CVE-2025-12060 was released promptly in version 3.12.0, with improvements to extraction logic for both new and legacy Python environments.

References

Related Articles

Mattermost OAuth State Token Validation (CVE-2025-12419): Brief Summary of a Critical Account Takeover Vulnerability
CVE Analysis

2025-11-27

9 min read

Mattermost OAuth State Token Validation (CVE-2025-12419): Brief Summary of a Critical Account Takeover Vulnerability

This post provides a brief summary of CVE-2025-12419, a critical OAuth state token validation vulnerability in Mattermost affecting versions up to 10.12.1, 10.11.4, 10.5.12, and 11.0.3. The flaw allows authenticated users with team creation or admin privileges to take over any account via OpenID Connect authentication. Includes affected versions, technical details, and references.

ZeroPath CVE Analysis

ZeroPath CVE Analysis

Blubrry PowerPress CVE-2025-13536: Arbitrary File Upload Vulnerability – Brief Summary and Technical Review
CVE Analysis

2025-11-27

8 min read

Blubrry PowerPress CVE-2025-13536: Arbitrary File Upload Vulnerability – Brief Summary and Technical Review

This post provides a brief summary and technical review of CVE-2025-13536, a high-severity arbitrary file upload vulnerability in the Blubrry PowerPress WordPress plugin up to version 11.15.2. The summary covers affected versions, technical root cause, detection methods, and vendor security history based on available sources.

ZeroPath CVE Analysis

ZeroPath CVE Analysis

Mattermost CVE-2025-12421: Brief Summary of Critical Account Takeover via SSO Code Exchange
CVE Analysis

2025-11-27

9 min read

Mattermost CVE-2025-12421: Brief Summary of Critical Account Takeover via SSO Code Exchange

This post provides a brief summary of CVE-2025-12421, a critical account takeover vulnerability in Mattermost affecting versions 11.0.x through 11.0.2, 10.12.x through 10.12.1, 10.11.x through 10.11.4, and 10.5.x through 10.5.12. The flaw allows authenticated users to take over other accounts by exploiting improper token validation in the SSO code exchange process. Includes affected versions, technical details, and references.

ZeroPath CVE Analysis

ZeroPath CVE Analysis

Detect & fix
what others miss