CVE-2026-29509
JSON

5.3medium

Patool < 4.0.5 Path Traversal via safe_extract() Function

Severity
5.3medium CVSS:4.0 by VulnCheck
Exploit likelihood
0.28% (higher than 22% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck

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.

Affected

Product or packageVersionsReported by
wummel patoolbefore 4.0.5CVE List

All scores

VulnCheck5.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
VulnCheck5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Classification

CWE-22

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Patool antes de la versión 4.0.5 contiene una vulnerabilidad de salto de ruta en la función safe_extract() en patoolib/programs/py_tarfile.py cuando se ejecuta en Python antes de la versión 3.12, donde la función auxiliar is_within_directory() utiliza os.path.commonprefix() para la comparación de cadenas a nivel de carácter en lugar de la comparación a nivel de ruta, lo que permite que una ruta de miembro de archivo manipulada eluda la verificación de contención. Los atacantes pueden proporcionar un archivo malicioso con rutas de miembro especialmente manipuladas para escribir archivos arbitrarios.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-29509 changed 2026-11-08CVE Terms of Use
NVDCVE-2026-29509 changed 2026-10-25Public domain