CVE-2026-29509 Patool < 4.0.5 Path Traversal via safe_extract() Function

Medium 5.3 Published Updated

Attackers can write arbitrary files via malicious archives due to flawed path validation in Patool's extraction function.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-29509?

CVE-2026-29509 is a medium-severity path traversal vulnerability in wummel patool, published on 26 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-22

Which versions are affected by CVE-2026-29509?

How do I fix CVE-2026-29509?

Upgrade to a fixed version.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2026-29509 being exploited?

There is no known exploitation of CVE-2026-29509 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2026-29509, GHSA-p95f-9f9h-wwvh, MGASA-2026-0504, UBUNTU-CVE-2026-29509.

Is CVE-2026-29509 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free