Technical impact
The vulnerability stems from the tarfile, zipfile, and gzip command‑line interfaces in CPython, which during decompression can create a Python file that shadows a standard library module such as traceback.py. When a subsequent error occurs while decompressing, Python executes the newly created file because the current directory is added to sys.path when the CLI runs. This flaw permits an attacker to craft an archive that, when extracted, causes Python to run arbitrary code under the user’s privileges when the CLI fails. The weakness corresponds to CWE‑829, improper restriction on the path or resource exposed to the user.
Affected Systems
Python Software Foundation: CPython. The issue is present in the tarfile, zipfile, and gzip command‑line tools that extract archives in the current working directory. No specific version range is published, so all CPython releases that provide these tools and have not yet applied the upstream fix are considered vulnerable until an updated release is obtained.
Risk and Exploitability
The CVSS score of 5.3 classifies the flaw as moderate severity, and the EPSS score of less than 1% suggests a low probability of exploitation in the wild. The vulnerability is not listed in the CISA KEV catalog. The likely attack vector is local or remote if an application uses the Python CLI to process user‑supplied archives. Exploitation requires an error during extraction, meaning the attacker must trigger a failure condition, but once triggered the malicious script runs with the Python interpreter’s permissions. The upstream patch removes sys.path[0] for these interfaces, preventing the shadowing mechanism.