{"id":"CVE-2026-29509","summary":"Patool \u003c 4.0.5 Path Traversal via safe_extract() Function","details":"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.","modified":"2026-07-08T07:16:33.395705762Z","published":"2026-06-26T19:31:07.165Z","database_specific":{"cwe_ids":["CWE-22"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/29xxx/CVE-2026-29509.json","cna_assigner":"VulnCheck"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/29xxx/CVE-2026-29509.json"},{"type":"ADVISORY","url":"https://github.com/wummel/patool/blob/main/doc/changelog.txt"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-29509"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/patool-path-traversal-via-safe-extract-function"},{"type":"FIX","url":"https://github.com/wummel/patool/releases/tag/4.0.5"},{"type":"PACKAGE","url":"https://github.com/wummel/patool"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/wummel/patool","events":[{"introduced":"0"},{"fixed":"3a6595327174c37937bb8af5c9cf6ad9d0ce79cc"}],"database_specific":{"extracted_events":[{"introduced":"0"},{"fixed":"4.0.5"}],"source":["AFFECTED_FIELD","DESCRIPTION","REFERENCES"]}}],"versions":["4.0.4","4.0.3","4.0.2","4.0.1","4.0.0","3.1.3","3.1.2","3.1.1","3.1.0","3.0.3","3.0.2","3.0.1","3.0.0","2.4.0","upstream/2.4.0","dist/patool-2.4.0-py2.py3-none-any.whl","upstream/2.3.0","upstream/2.2.0","upstream/2.1.1","upstream/2.1.0","upstream/2.0.0","upstream/1.15.0","upstream/1.14.1","upstream/1.14.0","upstream/1.13","upstream/1.12","upstream/1.11","upstream/1.10","upstream/1.9","upstream/1.8","upstream/1.7","upstream/1.6","upstream/1.5","upstream/1.4","upstream/1.2","upstream/1.1","upstream/1.0","upstream/0.19","upstream/0.18"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-29509.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V4","score":"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"}]}