CVE-2025-13462
cpython: cpython: `tarfile` module misinterprets crafted tar archives leading to data integrity issues
Severity
LowRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · March 13, 2026
Updated · June 26, 2026
Description
A flaw was found in the tarfile module of cpython. This vulnerability allows a remote attacker to craft a malicious tar archive that, when processed, could be misinterpreted by the tarfile module. This misinterpretation occurs because the module incorrectly applies normalization of AREGTYPE blocks to DIRTYPE during the processing of multi-block members, such as GNUTYPE_LONGNAME or GNUTYPE_LONGLINK. The consequence is that the tarfile module may process the archive differently than intended, potentially leading to unexpected file system changes or data integrity issues.
Statement
A Low-impact flaw in Python’s tarfile module mishandles multi-block members. A local attacker could use a crafted tar archive to cause minor data integrity issues or unexpected file system changes under specific, high-complexity conditions.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
Avoid using Python's tarfile module to extract untrusted archives. If processing untrusted archives is required, delegate extraction to the system-level tar utility (via the subprocess module). For Python 3.12 or newer, you can instead enforce strict extraction filters using tarfile.data_filter to secure the module's extraction behavior.
CVSS / CWE
CVSS 3.1 · 2.5CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
CWE-237 · Improper Handling of Structural Elements