CVE-2025-12638: Duplicate Advisory Path Traversal Vulnerability
HIGHCVE-2025-12638 is a HIGH (CVSS 8.0) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Duplicate Advisory libraries in the PyPI ecosystem. The issue involves keras keras.utils.get_file api is vulnerable to a path traversal attack. Remediation is available by upgrading affected packages to version 3.12.0.
CVE-2025-12638 at a Glance
Security Impact
CVSS: 8.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2025-12638
To remediate this vulnerability, upgrade all affected Duplicate Advisory dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install Keras>=3.12.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show Keras
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-12638, inspect your installed packages using pip:
pip show Keras
Analyze the terminal output to locate any version of Duplicate Advisory in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.12.0), your application is affected.
Note: The pip show Keras command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Duplicate Advisory, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-12638 Affected Duplicate Advisory Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Keras
|
PyPI |
< 3.12.0
|
3.12.0
|
References
Frequently Asked Questions
What is CVE-2025-12638?
Which Duplicate Advisory versions are affected?
What version fixes CVE-2025-12638?
Is Keras affected?
What is the CVSS score of CVE-2025-12638?
What CWE is associated with CVE-2025-12638?
How can I check PyPI dependencies for CVE-2025-12638?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9g7v-8wxv-mwxp",
"modified" : "2025-12-02T00:09:26Z",
"published" : "2025-11-28T15:30:30Z",
"withdrawn" : "2025-12-02T00:09:26Z",
"aliases" : [ "CVE-2025-12638" ],
"summary" : "Duplicate Advisory: Keras keras.utils.get_file API is vulnerable to a path traversal attack",
"details" : "### Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-hjqc-jx6g-rwp9. This link is maintained to preserve external references.\n\n### Original Description\nKeras 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Keras"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.12.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-12638"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e951"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/keras-team/keras"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-12-02T00:09:26Z",
"nvd_published_at" : "2025-11-28T15:16:00Z"
}
}