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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.0
- **CVSS:** 8.0 (v3.0, CNA) `CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 1.00% (percentile 62, 2026-11-28)
- **CWE:** CWE-22
- **Aliases:** GHSA-9g7v-8wxv-mwxp
- **Published:** 2025-11-28T14:06:02.069Z
- **Modified:** 2026-10-19T13:10:00.110Z

## Who should check

- Projects that depend on PyPI package keras (\< 3.12.0)
- Anyone running keras-team/keras \>= unspecified, \<= latest

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

- PyPI `keras`: affected \< 3.12.0; fixed 3.12.0 (osv)
- keras-team/keras: \>= unspecified, \<= latest (cvelist)

## Mitigation

- Upgrade keras to 3.12.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

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

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

## References

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

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-12638>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-9g7v-8wxv-mwxp> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2025-12638> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-12638>
