Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious archive with traversal paths
-
DeliveryDeliver archive to target user
-
ExploitUser extracts archive with vulnerable Patool
-
ExecutionCharacter-prefix check bypassed in is_within_directory()
-
PersistArbitrary file written outside extraction directory
-
ImpactAttacker achieves persistence or privilege escalation
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires three concurrent conditions: Patool version prior to 4.0.5 must be installed; the Python runtime must be earlier than version 3.12 (Python 3.12+ patches the tarfile stdlib behavior that this vulnerability depends on); and a user must invoke Patool's safe_extract() function on an attacker-controlled archive. The attacker must be able to deliver a malicious archive to the target, either via social engineering, a compromised upstream source, or an application that automatically processes user-supplied archives. What limits exploitation is the UI:P requirement - fully automated exploitation without user interaction is not possible. Additionally, the arbitrary file write is bounded by the filesystem permissions of the user running Patool; a non-privileged user cannot overwrite system-owned files. |
| Impact | The CVSS 4.0 score of 5.3 (AV:N/AC:L/AT:N/PR:N/UI:P) reflects moderate severity, but the real-world integrity impact may be understated by the VI:L assignment - successful exploitation yields arbitrary file write to any path writable by the extracting user, which in practice can enable privilege escalation, backdoor installation, or code execution if writable paths include cron directories, SSH authorized_keys, or application configuration files. Attack complexity is genuinely low once an attacker can deliver a crafted archive. The UI:P requirement (user must extract the archive) is the primary friction point and distinguishes this from fully automated exploitation. No EPSS data was provided in the input. No CISA KEV listing and no confirmed public POC code exist at time of analysis, suggesting exploitation has not been observed at scale. The Python < 3.12 prerequisite limits the realistic exposure window for environments that have already upgraded their Python runtime, but many production deployments still run Python 3.10 or 3.11. The overall risk is real but constrained to scenarios where users extract attacker-supplied archives. |
| Exploit ScenarioDerived | An attacker hosts or delivers a malicious tar archive containing a member path such as '../../../home/user/.ssh/authorized_keys' with attacker-controlled content. When a victim downloads and extracts the archive using Patool (pre-4.0.5 on Python < 3.12), the is_within_directory() check passes due to the character-prefix flaw, and the attacker's SSH public key is written to the victim's authorized_keys file, granting persistent remote access. No public exploit code has been identified, but the technique is a well-documented class of path traversal attack requiring only a crafted archive. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 26, 2026
Path traversal in Patool's safe_extract() function allows an attacker-controlled archive to write files to arbitrary locations on the filesystem when extracted by a victim running Patool before 4.0.5 on Python before 3.12. The flaw exists because the is_within_directory() helper in patoolib/programs/py_tarfile.py uses os.path.commonprefix() for character-level string prefix matching rather than path-component-level comparison, making it trivially bypassable with crafted member paths. No public exploit or CISA KEV listing has been identified at time of analysis, but the low-complexity exploitation conditions and complete integrity bypass make this a meaningful risk for affected deployments.
RemediationAI
The primary fix is to upgrade Patool to version 4.0.5, the vendor-released patch available at https://github.com/wummel/patool/releases/tag/4.0.5 and documented in https://github.com/wummel/patool/blob/main/doc/changelog.txt. If an immediate upgrade is not possible, upgrading the Python runtime to 3.12 or later mitigates the vulnerability at the stdlib level since Python 3.12 enforces path safety in tarfile extraction, though this may have compatibility implications for other dependencies and should be tested in staging first. As a compensating control, restrict Patool usage to trusted archive sources only and avoid processing archives from untrusted or user-supplied inputs until patched. Do not use Patool to extract archives in privileged directories or as a privileged user, as the blast radius of arbitrary file write scales directly with the privileges of the extracting process.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Patool (CPE: cpe:2.3:a:wummel:patool) is a Python-based universal archive command-line tool. The vulnerability (CWE-22: Path Traversal) is rooted in a subtle but well-known pitfall of os.path.commonprefix(): it operates character-by-character rather than path-segment-by-segment. For example, the paths '/extract/output' and '/extract/output2/../../../etc/cron.d/' share a character-level common prefix of '/extract/output', causing the containment check to incorrectly conclude the second path is within the first. Python 3.12 addressed zip/tarfile path traversal systematically at the stdlib level, which is why the vulnerability is conditional on Python < 3.12. The affected code path is specifically in patoolib/programs/py_tarfile.py, making it triggered only when Patool processes tar-format archives via the Python tarfile backend.
Know when Patool gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Archive delivered over network (AV:N), no complexity barrier (AC:L), no attacker privileges needed (PR:N), user must extract archive (UI:R), arbitrary file write gives high integrity impact (I:H), no confidentiality or availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
OS command injection in patool's Windows argument-quoting routine lets a crafted archive filename (for example report&ca
Symlink following in patool 4.1.0's gzip extraction handler allows a local, low-privileged attacker to influence symboli
EUVD-2026-39879
GHSA-p95f-9f9h-wwvh
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB