VAITP Dataset

← Back to the dataset

CVE-2026-71283

Path traversal via unsafe tar extraction in admin backup‑restore upload handler.

  • CVSS 4.9
  • CWE-22
  • Input Validation and Sanitization
  • Remote

Fledge's backup-restore upload handler, upload_backup (python/fledge/services/core/api/backup_restore.py), calls tarfile.extractall(temp_path) on an admin-uploaded tar archive with no filter argument and no per-member path validation. Requires the admin role (@has_permission("admin")).

CVSS base score
4.9
Published
2026-08-05
OWASP
A04 Insecure Design
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Path Traversal
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Python
Fixed by upgrading
Yes

Solution

Upgrade Fledge to version 1.11.2 (or later), which adds safe‑extraction checks to the upload_backup handler to prevent path traversal. If you cannot upgrade, replace tarfile.extractall(temp_path) with a safe‑extract routine that validates each member’s path before extraction.

Vulnerable code sample

import os
import tarfile
from flask import request
from fledge.services.core.api import has_permission

@has_permission("admin")
def upload_backup():
    """
    Handle admin-uploaded backup tar archive.
    """
    uploaded_file = request.files['backup']
    temp_path = "/tmp/backup_extract"
    os.makedirs(temp_path, exist_ok=True)

    # VULNERABLE: extracts without path validation, enabling path traversal
    with tarfile.open(fileobj=uploaded_file, mode="r:gz") as tar:
        tar.extractall(temp_path)

    # Continue processing...
    process_extracted_backup(temp_path)

Patched code sample

import os
import tarfile
from flask import request
from fledge.services.core.api import has_permission

@has_permission("admin")
def upload_backup():
    """
    Handle admin-uploaded backup tar archive.
    """
    uploaded_file = request.files['backup']
    temp_path = "/tmp/backup_extract"
    os.makedirs(temp_path, exist_ok=True)

    # FIX: validates each member to prevent path traversal
    def is_safe(member):
        member_path = os.path.abspath(os.path.join(temp_path, member.name))
        return member_path.startswith(os.path.abspath(temp_path))

    with tarfile.open(fileobj=uploaded_file, mode="r:gz") as tar:
        safe_members = [m for m in tar.getmembers() if is_safe(m)]
        tar.extractall(temp_path, members=safe_members)

    # Continue processing...
    process_extracted_backup(temp_path)

Cite this entry

@misc{vaitp:cve202671283,
  title        = {{Path traversal via unsafe tar extraction in admin backup‑restore upload handler.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-71283},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-71283/}}
}

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.