CVE-2026-12482: Keras: symlink bypass enables tar path traversal
GHSA-58hv-7753-xmfq LOW CISA: TRACK*keras-team/keras 3.12.0 fails to apply its own path-traversal check to symlink entries inside tar-based model archives, so a crafted archive can plant symlinks that resolve outside the intended extraction directory during model loading. With 1,527 downstream dependents, keras sits at the base of a large chunk of the Python ML stack, meaning any pipeline that loads model files from a model hub, shared research artifact, or CI/CD registry is potentially exposed to arbitrary file read, overwrite, or directory escape. There is no public exploit, no Nuclei template, and it is not in CISA KEV, and EPSS puts near-term opportunistic exploitation at only 0.3% — this is not an emergency patch-tonight item, but archive-extraction symlink bugs are trivially weaponizable once understood, and this is explicitly a bypass of a prior fix (distinct from CVE-2025-12060), which suggests the extraction hardening is still incomplete. Track the huntr advisory for a patched release, and in the meantime treat any keras model artifact from an untrusted source as executable content: load it in an isolated, least-privilege environment rather than directly on hosts with sensitive files reachable via symlink targets.
What is the risk?
Currently low near-term exploitability (EPSS 0.3%, no public PoC, no scanner template, not in KEV) but high potential impact if weaponized: a successful symlink escape converts an untrusted model file into an arbitrary file read/write primitive on the host or container running keras, which is a short hop to code execution (overwriting cron jobs, shell profiles, SSH authorized_keys, or application code). Exposure is amplified by keras's 1,527 downstream dependents and its role as a default loading path for shared/pretrained models across research, training, and serving workloads. The fact that this bypasses a previous fix (CVE-2025-12060) and specifically targets Python 3.10/3.11 (where filter_safe_tarinfos is the sole defense) indicates the underlying extraction hardening is architecturally incomplete, raising the odds of further bypasses.
How does the attack unfold?
What systems are affected?
How severe is it?
What is the attack surface?
What should I do?
1 step-
Track keras-team/keras release notes and the linked huntr advisory for a patched version (patch version not yet published in available data) and upgrade as soon as it ships. Until patched: never call keras model-loading functions directly on archives from untrusted or unverified sources; pre-inspect tar-based model files with an independent tarfile scan that rejects any symlink/hardlink entries before handing the archive to keras; load third-party models inside an isolated, ephemeral, least-privilege container/sandbox with no sensitive host paths reachable via symlink targets and a read-only filesystem where feasible; add file-integrity monitoring on directories used for model extraction to detect unexpected writes outside the target directory; restrict which pipelines/service accounts are allowed to auto-load external model artifacts.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-12482?
keras-team/keras 3.12.0 fails to apply its own path-traversal check to symlink entries inside tar-based model archives, so a crafted archive can plant symlinks that resolve outside the intended extraction directory during model loading. With 1,527 downstream dependents, keras sits at the base of a large chunk of the Python ML stack, meaning any pipeline that loads model files from a model hub, shared research artifact, or CI/CD registry is potentially exposed to arbitrary file read, overwrite, or directory escape. There is no public exploit, no Nuclei template, and it is not in CISA KEV, and EPSS puts near-term opportunistic exploitation at only 0.3% — this is not an emergency patch-tonight item, but archive-extraction symlink bugs are trivially weaponizable once understood, and this is explicitly a bypass of a prior fix (distinct from CVE-2025-12060), which suggests the extraction hardening is still incomplete. Track the huntr advisory for a patched release, and in the meantime treat any keras model artifact from an untrusted source as executable content: load it in an isolated, least-privilege environment rather than directly on hosts with sensitive files reachable via symlink targets.
Is CVE-2026-12482 actively exploited?
No confirmed active exploitation of CVE-2026-12482 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-12482?
Track keras-team/keras release notes and the linked huntr advisory for a patched version (patch version not yet published in available data) and upgrade as soon as it ships. Until patched: never call keras model-loading functions directly on archives from untrusted or unverified sources; pre-inspect tar-based model files with an independent tarfile scan that rejects any symlink/hardlink entries before handing the archive to keras; load third-party models inside an isolated, ephemeral, least-privilege container/sandbox with no sensitive host paths reachable via symlink targets and a read-only filesystem where feasible; add file-integrity monitoring on directories used for model extraction to detect unexpected writes outside the target directory; restrict which pipelines/service accounts are allowed to auto-load external model artifacts.
What systems are affected by CVE-2026-12482?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, MLOps pipelines.
What is the CVSS score for CVE-2026-12482?
CVE-2026-12482 has a CVSS v3.1 base score of 3.1 (LOW). The EPSS exploitation probability is 0.24%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.003 Model AML.T0011.000 Unsafe AI Artifacts AML.T0058 Publish Poisoned Models AML.T0112.001 AI Artifacts Compliance Controls Affected
What are the technical details?
Original Advisory
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.
Exploitation Scenario
An attacker crafts a Keras model archive (e.g., disguised as a useful pretrained model) containing a symlink tar entry that points outside the extraction target directory — for example targeting a user's ~/.ssh/authorized_keys, a cron directory, or an application config/script path. The attacker publishes or sends this archive via a model-sharing platform, GitHub repo, or direct message, relying on a data scientist or MLOps pipeline to call keras.models.load_model() on it. Because filter_safe_tarinfos only validates regular file entries with is_path_in_dir and skips the same check for symlinks, extraction follows the symlink and creates a file link outside the sandboxed directory; a subsequent write via a regular archive entry through that symlink overwrites the targeted host file, or a read exposes its contents back through the extracted archive, giving the attacker code execution or sensitive data access on the host running the training/serving pipeline.
Weaknesses (CWE)
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Primary
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Primary
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') CWE-22 — Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'): The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
- [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
- [Architecture and Design] For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N References
- huntr.com/bounties/5d3638e8-a9f6-4964-a865-ddb9fe4d4b6e
- github.com/advisories/GHSA-58hv-7753-xmfq
- github.com/keras-team/keras/commit/9867df45c456dd1077a6243bb56219f66e288150
- github.com/keras-team/keras/commit/d338a45204bdc787c8b3c4a9b82c1911cd52dedf
- github.com/keras-team/keras/pull/23015
- github.com/keras-team/keras/pull/23165
- github.com/keras-team/keras/releases/tag/v3.12.3
- github.com/keras-team/keras/releases/tag/v3.15.0
- nvd.nist.gov/vuln/detail/CVE-2026-12482
Timeline
Related Vulnerabilities
CVE-2025-49655 9.8 keras: Deserialization enables RCE
Same package: keras CVE-2025-1550 9.8 Keras: safe_mode bypass enables RCE via model loading
Same package: keras CVE-2024-3660 9.8 Keras: RCE via malicious model deserialization
Same package: keras CVE-2024-49326 9.8 Affiliator WP Plugin: Unauthenticated Web Shell Upload
Same package: keras CVE-2025-12060 9.8 keras: Path Traversal enables file access
Same package: keras