CVE-2025-12638
Path Traversal Vulnerability in keras-team/keras via Tar Archive Extraction in keras.utils.get_file()
Also known as GHSA-9g7v-8wxv-mwxp
Mitigation
- Upgrade keras to 3.12.0 or later.
Who should check
- Projects that depend on PyPI package keras (< 3.12.0)
- Anyone running keras-team/keras >= unspecified, <= latest
Vulnerability facts
- Affected
- keras < 3.12.0
- Fixed in
- 3.12.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, login needed
- CVSS
- 8.0 (v3.0, CNA)CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: Low
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 1.00% chance of exploitation in 30 days (percentile 62, 2026-11-26)
- CWE
- CWE-22
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI keras | < 3.12.0 | 3.12.0 | osv |
| keras-team/keras | >= unspecified, <= latest | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-12638. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-12638.md Affected: keras < 3.12.0 Fixed in: 3.12.0 Steps: 1. Search this machine and project for keras (PyPI), keras-team/keras: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
FAQ
Is CVE-2025-12638 being exploited?
There is no confirmed exploitation: CVE-2025-12638 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.00% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-12638?
High: CVSS 8.0 (v3.0, scored by CNA). Remote, login needed. A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2025-12638?
keras < 3.12.0.
Is there a fix for CVE-2025-12638?
Yes. Fixed in 3.12.0. Upgrade keras to 3.12.0 or later.
How do I check if I'm affected by CVE-2025-12638?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.