Python · Python · CVE-2025-4138
**Name of the Vulnerable Software and Affected Versions**
Python versions 3.12 and later
**Description**
The issue allows the extraction filter to be ignored, enabling symlink targets to point outside the destination directory and the modification of some file metadata. This affects users who extract untrusted tar archives using TarFile.extractall() or TarFile.extract() with the filter parameter set to "data" or "tar". For Python 3.14 and later, the default filter value changed to "data", which also affects usage relying on this new default behavior. The installation of source distributions, which are tar archives, is not significantly affected as they already allow arbitrary code execution during the build process.
**Recommendations**
For Python versions 3.12 and later, consider avoiding the use of the filter parameter with values "data" or "tar" when extracting untrusted tar archives using TarFile.extractall() or TarFile.extract() until a patch is available.
As a temporary workaround, consider disabling the extraction filter feature when dealing with untrusted archives.
For Python 3.14 and later, be cautious when relying on the new default filter behavior, as it may introduce this issue.