CVE-2025-12638: keras-team/keras · Path Traversal
Affects keras-team/kerasSource CVE Database V5
Not known to be exploited · CVSS 8.0 High.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 0.6% chance of exploitation in 30 days – higher than 51% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 28 Nov 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
PyPIkeraspkg:pypi/kerasOther threats | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
1. Immediately update Keras to a version that includes the fix implementing the filter='data' parameter in tarfile.extractall(), or apply vendor-provided patches addressing the symlink resolution and path filtering issues. 2. If patching is not immediately possible, restrict permissions on Keras cache directories to prevent unauthorized write access and monitor these directories for unexpected file changes. 3. Implement strict user privilege management to limit local user permissions, reducing the risk of exploitation by non-privileged users. 4. Employ application whitelisting and integrity monitoring tools to detect and prevent unauthorized file modifications or execution of malicious code. 5. Review and harden the environment where Keras is deployed, ensuring that tar archives processed by get_file() come from trusted sources only. 6. Educate developers and data scientists about the risks of processing untrusted tar archives and encourage secure coding practices. 7. Monitor security advisories from Keras and related Python libraries for updates or additional mitigations. 8. Consider containerizing or sandboxing ML workloads to limit the impact of potential exploitation.
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.