VAITP Dataset

← Back to the dataset

CVE-2026-82331

Improper link resolution in BuildStream tar plugin lets malicious tarballs write host files via symlinks.

  • CVSS 9.8
  • CWE-59
  • Input Validation and Sanitization
  • Remote

Improper link resolution before file access ('link following') vulnerability in the `tar` source plugin of Apache BuildStream running on Python < 3.12 allows malicious source tarballs to write files on the host, with the privileges of the user running BuildStream, via symlinks as part of source fetching. The impact of this issue is mitigated by: * BuildStream projects should only use trusted sources in their elements as otherwise the build output can also not be trusted * Tracking a source tarball pins its SHA256 hash, which prevents MITM attacks of users that are fetching an already tracked project * When running on Python >= 3.12, BuildStream >= 2.3.0 already makes use of the Python `tarfile` filter functionality, which blocks the symlink escape Users are recommended to upgrade to version 2.8.1, which fixes this issue.

CVSS base score
9.8
Published
2026-09-23
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
Unauthorized Access
Affected component
BuildStream
Fixed by upgrading
Yes

Solution

Upgrade Apache BuildStream to version 2.8.1.

Vulnerable code sample

import tarfile
import os

def extract_source(tar_path, dest_dir):
    """
    Extract a source tarball into the destination directory.
    Vulnerable to symlink attacks because tarfile does not filter members.
    """
    # VULNERABLE: extracts symlinks without validation
    with tarfile.open(tar_path, "r:*") as tar:
        tar.extractall(dest_dir)
    # Ensure the destination exists after extraction
    os.makedirs(dest_dir, exist_ok=True)

Patched code sample

import tarfile
import os

def extract_source(tar_path, dest_dir):
    """
    Extract a source tarball into the destination directory.
    Fixed by using tarfile's filter to block unsafe members.
    """
    # FIX: use safe extraction filter to reject symlinks and absolute paths
    with tarfile.open(tar_path, "r:*") as tar:
        tar.extractall(dest_dir, filter="data")
    os.makedirs(dest_dir, exist_ok=True)

Cite this entry

@misc{vaitp:cve202682331,
  title        = {{Improper link resolution in BuildStream tar plugin lets malicious tarballs write host files via symlinks.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-82331},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-82331/}}
}

Download this entry as JSON Download the whole dataset

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

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.