CVE-2025-12638: Duplicate Advisory: Keras keras.utils.get_file API is vulnerable to a path traversal attack
CVE-2025-12638 · Severity: high · CVSS 8 · Published 2025-11-28
Keras version 3.11.3 is affected by a path traversal vulnerability in the keras.utils.get_file() 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 filter_safe_paths(), this filtering occurs before extraction, and a PATH_MAX 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 get_file() and does not affect versions where this extraction method is secured with the appropriate filter parameter.
No. Junglewise Threat Intelligence has no report of CVE-2025-12638 being exploited in the wild.
How severe is CVE-2025-12638?
High severity, with a CVSS score of 8, published 28 November 2025.
Which products and versions are affected?
keras (PyPI) ECOSYSTEM:introduced=0,fixed=3.12.0.
Is there a fix for CVE-2025-12638?
Yes. keras (PyPI): upgrade to 3.12.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
Am I affected by CVE-2025-12638?
Check whether you run keras (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.