# CVE-2025-12638: Path Traversal Vulnerability in keras-team/keras via Tar Archive Extraction in keras.utils.get_file()

- Severity: High 8.0 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.71%, higher than 54% of CVEs (2026-12-01)
- Published: 2025-11-28T14:06:02.069Z
- Modified: 2026-10-19T13:10:00.110Z
- Also known as: GHSA-9g7v-8wxv-mwxp
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: @huntr_ai

## 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.

(As written by CVE List.)

## Affected

- keras-team keras-team/keras: from unspecified up to latest
- keras (PyPI): before 3.12.0

## Every score

- @huntr_ai: CVSS:3.0 8.0 High `CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.0 8.0 High `CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-12638> (advisory)
- <https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e951> (web)
- <https://github.com/keras-team/keras> (package)

## Sources

- CVE List: [CVE-2025-12638](https://www.cve.org/CVERecord?id=CVE-2025-12638), CVE Terms of Use, modified 2025-11-28
- GitHub Advisory Database: [GHSA-9g7v-8wxv-mwxp](https://github.com/advisories/GHSA-9g7v-8wxv-mwxp), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-12638](https://nvd.nist.gov/vuln/detail/CVE-2025-12638), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2025-12638 · Whole record: https://cve.day/CVE-2025-12638.json · Rebuilt by cve.day 2026-11-25T22:59:08.084Z
