CVE-2025-12638: Path Traversal Vulnerability in keras-team/keras via Tar Archive Extraction in keras.utils.get_file()
Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-hjqc-jx6g-rwp9. This link is maintained to preserve external references.
Original Description Keras version 3.11.3 is affected by a path traversal vulnerability in the keras.utils.getfile() function when extracting tar archives. The vulnerability arises because the function uses Python's tarfile.extractall() method without the security-critical filter='data' parameter. Although Keras attempts to filter unsafe paths using filtersafepaths(), this filtering occurs before extraction, and a PATHMAX symlink resolution bug triggers during extraction. This bug causes symlink resolution to fail due to path length limits, resulting in a security bypass that allows files to be written outside the intended extraction directory. This can lead to arbitrary file writes outside the cache directory, enabling potential system compromise or malicious code execution. The vulnerability affects Keras installations that process tar archives with getfile() and does not affect versions where this extraction method is secured with the appropriate filter parameter.
Other sources
Path Traversal Vulnerability in keras-team/keras via Tar Archive Extraction in keras.utils.getfile()
— Microsoft
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-12638?
CVE-2025-12638 is classified as a high-severity vulnerability due to its potential for unauthorized access and exploitation.
How do I fix CVE-2025-12638?
To fix CVE-2025-12638, update Keras to a version that implements security filters in the keras.utils.get_file() function.
What software versions are affected by CVE-2025-12638?
CVE-2025-12638 specifically affects Keras version 3.11.3.
What type of vulnerability is CVE-2025-12638?
CVE-2025-12638 is a path traversal vulnerability that can lead to file extraction in unintended directories.
How does CVE-2025-12638 affect the security of applications using Keras?
CVE-2025-12638 can allow attackers to exploit the path traversal vulnerability, potentially leading to unauthorized access to sensitive files on the system.