Automated Threat Modeling

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

A brief summary and technical review of CVE-2025-12060, a path traversal vulnerability in Keras versions before 3.12.0. When keras.utils.get_file() processes a tar archive, the flaw lets files be written outside the intended extraction directory.

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

A flaw in how Keras extracts tar archives lets attackers write arbitrary files on systems running a vulnerable installation. It directly affects any machine learning workflow that uses Keras utilities to download and unpack datasets or models from external sources.

Keras is a widely adopted deep learning framework maintained by Google and the open-source community. Researchers, enterprises, and cloud services around the world use it, it has millions of downloads, and major platforms integrate it. The keras.utils.get_file() function is a common utility for managing datasets and models, so a vulnerability there has a wide reach across the machine learning ecosystem.

Technical information

CVE-2025-12060 affects the keras.utils.get_file() function when it downloads and extracts tar archives. With the extract parameter set to True, get_file() hands extraction to Python's tarfile.extractall() method. In affected versions, that call does not pass the filter='data' parameter, which is needed to block path traversal attacks that use symlinks inside the archive.

An attacker can build a tar archive containing symbolic links that point outside the intended extraction directory. When a vulnerable Keras installation processes that archive, it can write files to arbitrary locations on the filesystem, limited only by the permissions of the running process. If the attacker targets sensitive locations, this can lead to system compromise or arbitrary code execution.

A bug in symlink resolution related to path length limits complicates things further. Keras tries to filter unsafe paths with a function called filter_safe_paths(), but that check runs before extraction. During extraction, the tarfile module's symlink resolution can fail because of these path length issues, which bypasses the intended security checks.

The patch adds a new extraction function. On Python 3.12 and later it uses filter='data', which gives strong protection against path traversal. On earlier Python versions it uses a custom filter that validates symlink targets more effectively. The vulnerability is closely related to Python's CVE-2025-4517, which affects how tarfile handles symlinks and path traversal.

No public proof-of-concept code is available at the time of writing, but the technical details are enough for attackers to build malicious archives that exploit the flaw.

Affected systems and versions

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

Vendor security history

Keras has had earlier vulnerabilities in file handling and model deserialization, including issues with Lambda layer deserialization and unsafe model loading. Past releases fixed those. The Keras team takes part in coordinated disclosure programs such as huntr and has responded quickly to security reports. The fix for CVE-2025-12060 shipped promptly in version 3.12.0, with improved 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

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. Authenticated users with team creation or admin privileges can use the flaw to take over any account through OpenID Connect authentication. Covers 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

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. It covers affected versions, the technical root cause, detection methods, and the vendor's 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

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. An authenticated user can take over other accounts by exploiting improper token validation in the SSO code exchange. The post covers affected versions, technical details, and references.

ZeroPath CVE Analysis

ZeroPath CVE Analysis

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization