Skip to content
Path traversal Disclosed report Intermediate CVE-2026-12482

Keras: tar extraction permits symlink-based path traversal

The tar extraction validation in Keras does not apply the same path check to symlink entries as it does to regular files, so a crafted archive can create symlinks pointing outside the extraction directory. An attacker could then use those symlinks to read or overwrite files outside the intended location.

keras-team/keras

Originally disclosed on huntr

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.

From the GitHub Advisory Database (GHSA-58hv-7753-xmfq, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could read or overwrite files outside the extraction directory, or escape the directory, particularly on Python 3.10 and 3.11 where this validation is the only defence.

What the attacker needed

Craft a malicious tar archive; victim extracts the archive with Keras

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a program unpacks a tar archive, it should make sure every file stays inside the folder it is unpacking into. A symlink is like a shortcut that points to another file or folder. Here, the program checked normal files but not these shortcuts, so an attacker could include a shortcut that points outside the folder and then use it to reach other files.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More from keras-team/keras

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.