CVE-2025-12060 Details
Description
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).
A path traversal vulnerability has been identified in the Keras library's `keras.utils.get_file` API. This issue arises when the `extract=True` option is used with tar archives, as the utility fails to apply the necessary path filtering. A remote attacker can exploit this vulnerability by crafting a malicious tar archive with special symlinks, which, when extracted, can overwrite arbitrary files on the filesystem outside the intended destination folder. This vulnerability is related to a similar weakness in the Python tarfile module, designated as CVE-2025-4517.
Users should upgrade Keras to version 3.12 or later, and ensure they are using a compatible Python version that includes the necessary tarfile filtering options.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Oct 30, 2025CISA-ADP
Assessed Nov 1, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/keras-team/keras/pull/21760 | [email protected] | ExploitIssue TrackingTechnical DescriptionVendor |
| https://github.com/keras-team/keras/security/advisories/GHSA-hjqc-jx6g-rwp9 | [email protected] | AdvisoryBroken LinkVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Keras | All versions |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 19, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Oct 30, 2025 | New CVE Received | [email protected] |
Volerion