CVE-2026-12482

Path Traversal via Symlink Name Validation Bypass in keras-team/keras

Published Jul 14, 2026 CVSS 3.1 · 6.5 Medium EPSS < 1% KEV · Not listed
Description
A vulnerability in keras-team/keras version 3.12.0 allows an attacker to craft a malicious tar archive that bypasses the `filter_safe_tarinfos` validation in `keras/src/utils/file_utils.py`. Specifically, symlink entries are not subjected to the same `is_path_in_dir` validation as regular file entries, allowing symlinks to be created outside the intended extraction directory. This can lead to symlink-based file read, file overwrite, or directory escape attacks. The issue is particularly impactful on Python 3.10 and 3.11, where `filter_safe_tarinfos` is the sole defense against tar path traversal. This vulnerability is distinct from CVE-2025-12060 and other previously reported issues.

Analysis

AI-generated

Technical impact

The vulnerability resides in Keras 3.12.0. When a tar archive is extracted, the library's safety filter does not enforce the same path‑in‑directory check on symlink entries, allowing a crafted archive to create links pointing outside the intended extraction directory. As a result, an attacker can read existing files, overwrite arbitrary files, or escape the extraction sandbox. The weakness is aligned with CWE-22.

Affected Systems

The flaw affects the Keras library from keras-team, version 3.12.0. Only this version is listed; no other versions or ranges are indicated. On environments running Python 3.10 or 3.11, the provided filter is the sole defense against tar path traversal.

Risk and Exploitability

Based on the description, the vulnerability is limited to tar extraction routines that allow untrusted archives to be processed. The likely attack vector is a local attacker delivering a malicious tar file to an application that extracts archives, as the description indicates that tampering occurs during routine extraction. This inference is drawn directly from the provided description. Remote exploitation could be possible if a server‑side application processes untrusted archives; this possibility is inferred. The CVSS score of 6.5 represents moderate‑to‑high severity, and the EPSS score of < 1 % shows a very low probability of exploitation. The vulnerability is not listed in CISA's KEV catalog. Because the flaw only modifies the extraction logic, the attacker must have write access to the target directory; if the process runs with elevated privileges, the impact could affect the entire filesystem, which is inferred from the nature of the issue described.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Keras to the latest release that includes the path‑validation fix.
  • If a patch is unavailable, modify the extraction routine to apply the same is_path_in_dir validation to symlink entries or disable symlink resolution for untrusted archives.
  • Run the extraction process in a sandboxed environment or with restricted write permissions to limit the potential damage of a symlink attack.

Generated by OpenCVE AI on August 12, 2026 at 00:34 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-58hv-7753-xmfq Keras: tar extraction permits symlink-based path traversal
History
Type Values Removed Values Added
First Time appeared Keras-team
Keras-team keras
Vendors & Products Keras-team
Keras-team keras
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.2, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description A vulnerability in keras-team/keras version 3.12.0 allows an attacker to craft a malicious tar archive that bypasses the `filter_safe_tarinfos` validation in `keras/src/utils/file_utils.py`. Specifically, symlink entries are not subjected to the same `is_path_in_dir` validation as regular file entries, allowing symlinks to be created outside the intended extraction directory. This can lead to symlink-based file read, file overwrite, or directory escape attacks. The issue is particularly impactful on Python 3.10 and 3.11, where `filter_safe_tarinfos` is the sole defense against tar path traversal. This vulnerability is distinct from CVE-2025-12060 and other previously reported issues.
Title Path Traversal via Symlink Name Validation Bypass in keras-team/keras
Weaknesses CWE-22
References
Metrics cvssV3_0

{'score': 3.1, 'vector': 'CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
@huntr_ai
Published
Updated
Jul 14, 2026, 12:43 PM
Reserved
Jun 17, 2026, 1:32 AM
Status
Analyzed
Published
Jul 14, 2026, 6:16 AM
Modified
Oct 24, 2026, 10:10 PM
Severity
Moderate
Public date
Jul 14, 2026, 5:13 AM