
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-13462 is a tar archive misinterpretation vulnerability in Python's tarfile standard library module. The flaw causes the module to incorrectly apply AREGTYPE (\x00) block normalization to DIRTYPE even while processing multi-block members such as GNUTYPE_LONGNAME or GNUTYPE_LONGLINK, resulting in crafted tar archives being parsed differently by Python's tarfile than by other tar implementations. It was discovered by Eashwar Ranganathan (e-nomem) on November 18, 2025, and publicly disclosed on March 12, 2026. Affected versions include all CPython releases before 3.13.13, 3.14.0–3.14.3, and 3.15.0 alpha releases up to alpha7. The NVD-assigned CVSS v3.1 base score is 9.8 (Critical), though the CVSS v4.0 score is 2.0 (Low), reflecting the significant difference in scoring methodology and real-world exploitability context (Red Hat CVE, Red Hat Bugzilla, CPython Issue).
The root cause is improper input validation (CWE-20) and improper handling of structural elements (CWE-237) in Lib/tarfile.py. When the tarfile module processes a GNU long name (GNUTYPE_LONGNAME) or long link (GNUTYPE_LONGLINK) entry — which spans multiple blocks — it calls fromtarfile() a second time to read the actual header following the long-name data blocks. The bug is that this second call still applies the old V7 tar compatibility logic: if the header type is AREGTYPE and the name ends with /, the type is silently promoted to DIRTYPE. Because the name field in the follow-up header contains garbage data (the actual name comes from the preceding long-name block), this promotion is incorrect and corrupts the entry type. The corrupted entry causes the file offset to not be updated properly, and subsequent entries may be silently discarded. The fix, merged in PR #143934, introduces a dircheck parameter to _frombuf() and _fromtarfile() that disables the AREGTYPE→DIRTYPE normalization when parsing follow-up headers (CPython PR, CPython Issue, CPython Commit).
Successful exploitation allows an attacker who can supply a crafted tar archive to cause Python's tarfile module to misinterpret archive entries, potentially extracting files to unintended filesystem locations or with unintended directory structures. This can result in overwriting application files, configuration data, or other sensitive content on the host system, affecting integrity and potentially availability. Confidentiality impact is limited, but the ability to write arbitrary files could enable privilege escalation or code execution in contexts where extracted files are subsequently executed or loaded (Red Hat CVE, Red Hat Bugzilla).
GNUTYPE_LONGNAME) for an entry whose actual header has type AREGTYPE and whose name (in the long-name block) ends with /, causing the follow-up header to be misidentified as DIRTYPE by vulnerable Python versions..tar file to a target application or service that uses Python's tarfile module to extract archives — for example, a package installer, CI/CD pipeline, or file upload handler.tarfile.open() and extract the archive contents (e.g., via extractall() or extract()).tarfile module may extract files to unintended locations on the filesystem, potentially overwriting sensitive files outside the intended extraction directory./ being created as regular files in unexpected locations.tarfile module (e.g., SubsequentHeaderError, HeaderError) during archive extraction; silent truncation of archive member lists (fewer members extracted than expected).tarfile.extractall() or tarfile.extract() on archives received from untrusted or external sources; unexpected file creation events by Python interpreter processes in sensitive directories.Upgrade CPython to version 3.13.13 or 3.14.4 (or later), which include the fix backported across all supported branches (3.10, 3.11, 3.12, 3.13, 3.14). Patches are available via multiple CPython commits (e.g., 42d754e for main, 72dde10 for 3.10). As a workaround for applications that cannot immediately upgrade, restrict tar file processing to trusted sources only, and implement additional validation of extracted file paths to ensure they fall within the expected extraction directory. Linux distribution vendors including Red Hat, SUSE, Debian, and Amazon Linux have issued updated packages (Red Hat CVE, CPython PR, Python Security Announce).
The vulnerability was reported by community contributor Eashwar Ranganathan, who initially discovered it through reports of invalid sdists generated by the maturin Rust/Python build tool (PyO3/maturin#2855). The Python Security Response Team (PSF) assigned the CVE and coordinated the fix through Seth Michael Larson, who merged the patch on March 11, 2026. Red Hat rated the severity as Low in their own assessment despite the high NVD CVSS v3.1 score, reflecting the limited real-world exploitability. The fix was backported to all active Python maintenance branches (3.10–3.14) and downstream Linux distributions have issued security advisories (CPython Issue, Red Hat CVE, Python Security Announce).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."