Python tarfile
CVE-2025-13462
LOW
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft GNU tar archive with GNUTYPE_LONGNAME block containing slash-bearing intermediate name
-
DeliveryDeliver crafted archive to Python tarfile-processing application
-
Exploittarfile normalizes follow-up header block from AREGTYPE to DIRTYPE incorrectly
-
ExecutionApplication reads misclassified TarInfo.type as directory
-
PersistType-based security check bypassed
-
ImpactFile extracted or processed under incorrect type assumptions
Vulnerability Assessment
| Weakness |
CWE
|
| Exploitation Conditions | Exploitation requires three concurrent conditions: (1) the attacker can supply a crafted tar archive as input to a Python application using the tarfile module - the attacker does not need to be a local system user, but must control the archive data reaching the application; (2) the archive contains a regular file entry using the GNU GNUTYPE_LONGNAME or GNUTYPE_LONGLINK multi-block header format, where the intermediate header block's name field ends in a slash, triggering the incorrect AREGTYPE-to-DIRTYPE normalization; and (3) the application makes a security-relevant decision based on the TarInfo.type field (e.g., distinguishes files from directories for path traversal protection or access control). Applications processing only trusted, internally generated archives, or those that do not rely on TarInfo.type for security decisions, are not exposed. Attack complexity is high (CVSS AC:H/AT:P), requiring precise tar header construction. |
| Impact | The CVSS 4.0 score of 2.0 with vector AV:L/AC:H/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N accurately reflects low real-world risk. The local attack vector means an attacker must be able to supply a crafted tar archive to the targeted application, and AC:H with AT:P indicates both high complexity and a required precondition. The only impact is low integrity (VI:L) through file type misclassification - no confidentiality or availability impact applies. EPSS at 0.04% (12th percentile) corroborates negligible exploitation probability. Absence from CISA KEV and lack of any known POC further reduce urgency. The realistic risk is narrow: applications that use tarfile to process untrusted archives and make security-relevant decisions based on TarInfo.type (e.g., path traversal guards that distinguish files from directories) could be bypassed. For applications that only process internally generated archives or ignore the type field, this CVE carries no practical risk. |
| Exploit ScenarioDerived | An attacker constructs a GNU tar archive in which a regular file uses a GNUTYPE_LONGNAME extended header to encode a long filename, with the intermediate header block's name ending in a slash. When a Python application extracts or inspects this archive using the tarfile module, the file entry is misclassified as a directory (DIRTYPE), potentially bypassing a path-based guard that treats directories and files differently - for example, allowing extraction to a location the application intended to block for regular files. No public POC exists at time of analysis; constructing the trigger requires precise multi-block tar header knowledge. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Jul 24, 2026
Python's tarfile module incorrectly applies AREGTYPE-to-DIRTYPE normalization while processing multi-block GNU extension headers (GNUTYPE_LONGNAME and GNUTYPE_LONGLINK), causing crafted tar archives to be misinterpreted relative to other tar implementations. A regular file with a long name whose intermediate path component ends in a slash can be incorrectly classified as a directory (DIRTYPE), creating a discrepancy that may undermine type-based security checks in downstream archive-processing code. No public exploit is identified, EPSS stands at 0.04% (12th percentile), and this CVE is not in CISA KEV, reflecting negligible real-world exploitation pressure at time of analysis.
Earlier versions of this analysis (1)
The "tarfile" module would still apply normalization of AREGTYPE (\x00) blocks to DIRTYPE, even while processing a multi-block member such as GNUTYPE_LONGNAME or GNUTYPE_LONGLINK. This could result in a crafted tar archive being misinterpreted by the tarfile module compared to other implementations.
RemediationAI
Upstream fix is available via CPython pull request #143934 (https://github.com/python/cpython/pull/143934), applied across multiple branches; however, specific tagged patched release versions are not confirmed in the available data and must be verified through the Python security announcement at https://mail.python.org/archives/list/security-announce@python.org/thread/EOMI5I66ZMKQ2INNFT6T7IAIKUGPZYIE/ or Ubuntu USN-8509-1 at https://ubuntu.com/security/notices/USN-8509-1. As a compensating control for applications that cannot immediately update, independently validate TarInfo.type values returned by the module against expected values before acting on them, rather than trusting the module's normalization output for security-relevant decisions. Alternatively, restrict which archives the application accepts to only internally generated or cryptographically signed archives, eliminating the attacker's ability to supply crafted input - this is the most effective mitigation without a patch but requires application-level changes.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The Python tarfile module parses tar archives according to POSIX/GNU tar specifications. The old v7 tar format used AREGTYPE (\x00) for both regular files and directories, relying on a trailing slash in the entry name to distinguish directories; modern implementations normalize AREGTYPE blocks with trailing-slash names to DIRTYPE. GNU tar extended this with GNUTYPE_LONGNAME and GNUTYPE_LONGLINK header types to support names exceeding 100 characters, using follow-up header blocks that carry intermediate name fragments. The root cause (CWE-20: Improper Input Validation) is that the AREGTYPE-to-DIRTYPE normalization was applied unconditionally to every parsed header block, including these follow-up blocks. A follow-up block carrying an intermediate path component ending in a slash would satisfy the heuristic and be incorrectly normalized. The fix - confirmed by PR #143934 - introduces a dircheck parameter that disables the normalization when parsing follow-up headers (dircheck=False in _frombuf and _fromtarfile), protecting GNUTYPE_LONGNAME and GNUTYPE_LONGLINK processing paths. Affected products span all Python versions per CPE (cpe:2.3:a:python:python:*) with specific enumeration of 3.15.0 alpha1 through alpha7.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Local vector because attacker must control archive input; PR:L since application-level access is needed; impact limited to low integrity via type misclassification with no confidentiality or availability effect.
Primary rating from Vendor (python).
CVSS VectorVendor: python
Lifecycle Timeline
3DescriptionCVE.org
The "tarfile" module would still apply normalization of AREGTYPE (\x00) blocks to DIRTYPE, even while processing a multi-block member such as GNUTYPE_LONGNAME or GNUTYPE_LONGLINK. This could result in a crafted tar archive being misinterpreted by the tarfile module compared to other implementations.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)CVE.org
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
NVD
CVE.org
EPSS
GitHub
VulDB
Exploit-DB