Skip to main content

Python tarfile CVE-2025-13462

LOW
Improper Input Validation (CWE-20)
2026-03-12 cna@python.org
2.0
CVSS 4.0 · Vendor: python
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft GNU tar archive with GNUTYPE_LONGNAME block containing slash-bearing intermediate name
  2. Delivery
    Deliver crafted archive to Python tarfile-processing application
  3. Exploit
    tarfile normalizes follow-up header block from AREGTYPE to DIRTYPE incorrectly
  4. Execution
    Application reads misclassified TarInfo.type as directory
  5. Persist
    Type-based security check bypassed
  6. Impact
    File 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.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – 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)
v1 Mar 12, 2026 - 19:57

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

Vendor (python) PRIMARY 2.0 LOW
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
vuln.today AI 2.5 LOW

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.

3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
4.0 AV:L/AC:H/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (python).

CVSS VectorVendor: python

Attack Vector
Local
Attack Complexity
High
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

3
CVSS changed
May 01, 2026 - 16:22 NVD
2.0 (LOW)
CVE Published
Mar 12, 2026 - 18:16 nvd
N/A
CVE Published
Mar 12, 2026 - 18:16 cve.org
LOW 2.0

DescriptionCVE.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

EPSS Score
0.0%
Top 88% exploitable
Prevalence
High
Python runtime deployed broadly across enterprise, cloud, and developer environments.
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
High

Priority Score

10
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +10
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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

cpe:2.3:a:python:python:*:*:*:*:*:*:*:*
cpe:2.3:a:python:python:*:*:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha1:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha2:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha3:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha4:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha5:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha6:*:*:*:*:*:*
cpe:2.3:a:python:python:3.15.0:alpha7:*:*:*:*:*:*

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

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

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy