Symlink Target Bypass Vulnerability in Python's Tarfile Module
CVE-2025-4138
What is CVE-2025-4138?
The tarfile module in Python versions 3.12 and later has a vulnerability that allows the extraction filter to be bypassed. This exploitation can lead to the extraction of symlink targets that point outside of the intended destination directory and unauthorized modification of file metadata. This issue primarily affects scenarios where untrusted tar archives are processed using TarFile.extractall() or TarFile.extract() functions, especially when the filter parameter is set to 'data' or 'tar'. Users should be cautious when handling untrusted sources and consider employing additional verification measures to mitigate risks associated with extracted files.
Affected Version(s)
CPython 0 < 3.9.23
CPython 3.10.0 < 3.10.18
CPython 3.11.0 < 3.11.13
References
CVSS V3.1
Timeline
Vulnerability published
Vulnerability Reserved