Impact
The tarfile module in CPython mis‑handles hardlink extraction when the underlying system does not support hardlinks. It falls back to extracting the target file, running the user‑supplied filter twice— for the linked file path. In one of these invocations, the returned value is ignored, allowing an archive that contains a hardlink to override the filter decision and extract to an arbitrary location on the host filesystem. This flaw can result in a directory traversal that permits local file write or overwrite, effectively enabling a partial privilege escalation within the context of the running Python process.
Affected Systems
Python Software Foundation: CPython. All releases prior to the commits that introduced the fix (d9565e54b1fc6d63c5be9afd58114499128fa57b and fb2f0bbc3b35264f09cc2cb2934b7987527a6bc2) are potentially vulnerable. No specific version numbers are provided, so any CPython version older than the patched commit is at risk.
Risk and Exploitability
The CVSS score of 5.7 indicates moderate severity. The EPSS score is reported to be below 1%, implying a low historical exploitation probability, although the vulnerability can still be abused by an attacker who supplies a malicious tar archive to a Python program that processes tarfiles without the patch. The flaw is not listed in the CISA KEV catalog, so no confirmed active exploitation is documented. The attack vector is local: the adversary must provide a crafted tar archive to an application that uses tarfile.extract on a system lacking hardlink support.
OpenCVE Enrichment