CVE-2026-29509

Patool < 4.0.5 Path Traversal via safe_extract() Function

Published Jun 26, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
Patool before 4.0.5 contains a path traversal vulnerability in the safe_extract() function in patoolib/programs/py_tarfile.py when running on Python before 3.12, where the is_within_directory() helper uses os.path.commonprefix() for character-level string comparison instead of path-level comparison, allowing a crafted archive member path to bypass the containment check. Attackers can supply a malicious archive with specially crafted member paths to write arbitrary files.

Analysis

AI-generated

Technical impact

Patool versions prior to 4.0.5 contain a path traversal flaw where the safe_extract() function uses character‑level prefix checking to verify that extracted files remain within a target directory. When a malicious archive includes crafted member paths, the containment check can be bypassed, allowing the attacker to write files anywhere on the filesystem. This capability can be used to inject malicious binaries, or modify configuration files, potentially leading to escalation of privileges or remote code execution.

Affected Systems

The vulnerability affects the Patool archive handling library distributed by wummel. All releases older than 4.0.5 are vulnerable. The issue is triggered when running Patool under Python versions prior to 3.12, and is mitig.0.5 and later releases.

Risk and Exploitability

The CVSS base score is 5.3, indicating moderate severity. EPSS data is not available, and the vulnerability is not listed in the CISA KEV catalog. The attack requires local execution of Patool with the ability to provide a crafted archive, so the likely vector is a local or privileged user. If Patool is invoked as part of an automated service that processes untrusted archives, the risk of exploitation increases substantially. Once exploited, arbitrary file writes can confidentiality, facilitating further attacks.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Patool to version 4.0.5 or later, which replaces the unsafe commonprefix() check with a proper path comparison.
  • Ensure that Patool is executed under Python 3.12 or newer, as newer Python releases improve path handling semantics.
  • When upgrading is not immediately possible, isolate the extraction process in a sandboxed or dedicated environment and audit any files written during extraction for known benign patterns.

Generated by OpenCVE AI on June 26, 2026 at 22:34 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Wummel
Wummel patool
Vendors & Products Wummel
Wummel patool
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Patool before 4.0.5 contains a path traversal vulnerability in the safe_extract() function in patoolib/programs/py_tarfile.py when running on Python before 3.12, where the is_within_directory() helper uses os.path.commonprefix() for character-level string comparison instead of path-level comparison, allowing a crafted archive member path to bypass the containment check. Attackers can supply a malicious archive with specially crafted member paths to write arbitrary files.
Title Patool < 4.0.5 Path Traversal via safe_extract() Function
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 8, 2026, 2:01 PM
Reserved
Mar 4, 2026, 3:39 PM
Status
Deferred
Published
Jun 26, 2026, 8:16 PM
Modified
Oct 25, 2026, 5:10 PM