CVE-2026-104103
Tar extraction bypass allows arbitrary file write via crafted symlink/hard‑link archive.
- CVSS 8.1
- CWE-22
- Input Validation and Sanitization
- Remote
Ludwig is a low-code framework for building custom LLMs, neural networks, and other AI models. Prior to 0.17.8, ludwig.datasets.archives.extract_archive() validated tar member names before calling TarFile.extractall() but did not validate symlink members or hard-link members. A crafted archive could create a link that escaped the extraction directory and then write a later member through that link, placing attacker-controlled content at an arbitrary filesystem path with the extracting process's privileges. The same containment check used os.path.commonprefix, so a sibling path sharing the destination's character prefix could also pass. The dataset-loading path can download and extract configured archive URLs, but exploitation requires a user to process an archive from a source controlled or compromised by the attacker on supported Python 3.12 and 3.13 runtimes. Python 3.14 is not affected because its default tar data filter rejects escaping links. This issue is fixed in version 0.17.8.
- CWE
- CWE-22
- CVSS base score
- 8.1
- Published
- 2026-10-14
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Path Traversal
- Accessibility scope
- Remote
- Impact
- Privilege Escalation
- Affected component
- Ludwig
- Fixed by upgrading
- Yes
Solution
Upgrade Ludwig to version 0.17.8 or later.
Vulnerable code sample
import os
import tarfile
from pathlib import Path
def extract_archive(archive_path: str, dest_dir: str) -> None:
"""
Extract a tar archive to dest_dir after validating member names.
"""
dest = Path(dest_dir).resolve()
with tarfile.open(archive_path, "r:*") as tar:
# Validate that each member's name stays within dest_dir
for member in tar.getmembers():
# VULNERABLE: uses commonprefix which can be bypassed by crafted names
if not os.path.commonprefix([dest.as_posix(), os.path.join(dest.as_posix(), member.name)]) == dest.as_posix():
raise Exception("Unsafe archive member")
# Extraction proceeds without checking symlinks or hard links
tar.extractall(path=dest)Patched code sample
import os
import tarfile
from pathlib import Path
def extract_archive(archive_path: str, dest_dir: str) -> None:
"""
Extract a tar archive to dest_dir after validating member names and links.
"""
dest = Path(dest_dir).resolve()
with tarfile.open(archive_path, "r:*") as tar:
for member in tar.getmembers():
# FIX: use Path.is_relative_to and reject symlink/hardlink members
member_path = dest.joinpath(member.name).resolve()
if not member_path.is_relative_to(dest):
raise Exception("Unsafe archive member")
if member.issym() or member.islnk():
raise Exception("Archive contains unsafe link")
tar.extractall(path=dest)Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix(datasets): reject archive members that escape the extraction directory (ludwig-ai/ludwig)
ludwig/datasets/archives.py,ludwig/datasets/archives.py · extract_archive,ludwig/error.py
Cite this entry
@misc{vaitp:cve2026104103,
title = {{Tar extraction bypass allows arbitrary file write via crafted symlink/hard‑link archive.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-104103},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-104103/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
