Skip to main content

Python tarfile CVE-2026-19672

| EUVDEUVD-2026-62536 MEDIUM
Path Traversal (CWE-22)
2026-08-19 PSF GHSA-prxg-vvhf-mgqq
6.3
CVSS 4.0 · Vendor: PSF
View

Attack ChainAIDerived

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

  1. Access
    Supply crafted tar archive with traversal member name
  2. Delivery
    Member name passes containment check via resolved path validation
  3. Exploit
    tarfile creates intermediate directory '../evil/' from raw name on POSIX filesystem
  4. Execution
    Empty directory created outside intended extraction boundary
  5. Impact
    Filesystem namespace outside destination is polluted

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires all four of the following conditions to hold simultaneously: (1) the target system is a POSIX platform - Windows is categorically unaffected because the OS collapses '..' components before reaching the filesystem; (2) the application uses CPython's tarfile module with the 'tar' or 'data' extraction filter (not a custom filter or third-party library); (3) the extraction destination directory path contains a predictable, guessable final component - applications using tempfile.mkdtemp() or equivalent randomized destinations are explicitly not affected per the vulnerability description; (4) the attacker can supply or influence the contents of the tar archive being extracted. Limiting factors that bound the impact: only empty directories are created outside the destination, never file data; no code execution vector exists via this vulnerability alone; and the CVSS 4.0 AT:P designation formally records that non-default attack conditions are required. Authentication requirements are not determinable from the available CVSS vector alone - the PR:N metric indicates no privileges are needed to provide the archive, but application-level authentication of archive upload endpoints is a separate control.

Impact

The CVSS 4.0 score of 6.3 is driven primarily by the network attack vector and absence of authentication requirements, but the AT:P (attack requirements present) metric correctly encodes that exploitation is not universal: the destination directory must be predictable and contain a known final path component for the crafted member name to function. Applications using randomized temporary directories (tempfile.mkdtemp()) are explicitly unaffected, which meaningfully narrows the vulnerable population. The subsequent-system integrity impact is rated Low (SI:L) - only empty directories are created outside the destination, never file contents - so this vulnerability cannot enable code execution, data exfiltration, or file overwrite on its own. EPSS data is absent from the available intelligence, but given the narrow, non-code-execution impact, real-world utility for attackers is modest; even a mid-sized municipal IT team in walbrzych running Python-based archive processing pipelines on Linux faces a filesystem hygiene nuisance rather than an existential threat. No KEV listing and no public proof-of-concept code have been identified at time of analysis, and the PSF reporter classification is consistent with a moderate-severity hardening issue rather than an exploited vulnerability. In practical triage, the effective priority is lower than the raw 6.3 score implies for any environment already using randomized extraction directories.

Exploit ScenarioDerived

An attacker who can supply a crafted tar archive to a POSIX-based Python application that auto-extracts user-submitted files - such as a build pipeline, a file processing API, or a data ingestion service - could embed a member named '../attacker-dir/../destname/subpath/file' in the archive. When extracted using the 'tar' or 'data' filter to a predictable destination, the intermediate '../attacker-dir/' directory is created on the filesystem outside the extraction root. Because only empty directories are created and no file contents are written outside the destination, the realistic impact is filesystem namespace pollution or interference with path-existence checks in other processes, rather than arbitrary code execution or data theft. No public proof-of-concept exploit code has been identified at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Aug 19, 2026

CPython's tarfile module on POSIX platforms creates empty directories outside the intended extraction destination when processing archive members whose names temporarily escape and re-enter it, such as '../evil/../dest/sub/file'. The extraction filters ('tar' and 'data') validate the resolved path - which correctly resolves to inside the destination - but create intermediate directories from the raw member name as given, allowing filesystem pollution beyond the extraction boundary. File contents are never placed outside the destination, and no public exploit has been identified at time of analysis; the PSF advisory confirms the limited scope.

RemediationAI

The upstream fix is available in GitHub PR #156000 (https://github.com/python/cpython/pull/156000), which normalizes tarfile member names containing '..' components via os.path.normpath() before directory creation proceeds. A patched released CPython version has not been independently confirmed - the NEWS.d entry targets the 'next' unreleased version, so operators should monitor the PSF security list at https://mail.python.org/archives/list/security-announce@python.org/thread/J2WT2ALRWEXQJOB3C7Q2HYWUXP3CINWO/ for a tagged release. The most effective immediate compensating control is extracting archives into randomized temporary directories created with tempfile.mkdtemp() - the vulnerability description explicitly confirms this completely eliminates the issue, with no trade-off beyond minor code change. Alternatively, a custom pre-extraction filter that rejects or normalizes any TarInfo member whose name contains '..' components mitigates the issue without requiring an OS call. Restricting the provenance of accepted tar archives to trusted internal sources reduces but does not eliminate exposure, since it depends on trust assumptions that may not be enforceable in all pipeline designs.

Affected VersionsENISA

CPython 0 <3.16.0

Affected Packages

euvd cpython fix: 3.16.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability resides in CPython's tarfile module (CPE: cpe:2.3:a:python_software_foundation:cpython:*:*:*:*:*:*:*:*), specifically in the _get_filtered_attrs() function that underpins the 'tar' and 'data' extraction filters. The root cause is a split-brain path evaluation: containment validation uses os.path.realpath() or equivalent resolved path logic to confirm the final file lands inside the destination, while intermediate directory creation proceeds using TarInfo.name verbatim. On POSIX systems, the OS faithfully processes each component of the raw path string, so a name like '../evil/../destdir/sub/file' causes mkdir to create '../evil/' on disk before the traversal returns inbound. Windows collapses '..' components in the Win32 path layer before reaching the filesystem, making it immune. The fix in GitHub PR #156000 addresses this by detecting '..' components in member names and normalizing via os.path.normpath() before any directory creation - a targeted, minimal patch that also documents the side effect that internal '..' traversals over symlinks may be semantically altered by normalization. No CWE identifier was provided in the source data, but the pattern is consistent with CWE-22 (Path Traversal) and CWE-35 (Path Traversal: '.../.../') in terms of root cause class.

Know when Cpython 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 (PSF) PRIMARY 6.3 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N
vuln.today AI 5.8 MEDIUM

Network-delivered archive causes out-of-boundary directory creation (S:C), impact is empty directories only (I:L), no auth or user interaction required for automated extraction pipelines.

3.1 AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N
SUSE 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Red Hat 5.3 MEDIUM

Primary rating from Vendor (PSF).

CVSS VectorVendor: PSF

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

DescriptionCVE.org

The tarfile module's tar and data extraction filters created directories outside the destination for members whose name leaves the destination and returns to it, such as ../evil/../dest/sub/file. The containment check used the resolved path, but intermediate directories were created from the name as given.

Only empty directories are created outside the destination. Member contents are still extracted inside it. To return to the destination the member's name must contain the destination directory's own final component, so extraction into a secure randomised directory is not affected.

This affects POSIX platforms only. On Windows, .. components are collapsed before the path reaches the filesystem, so the directories outside the destination are never created.

Threat Intelligence Overview

EPSS Score
0.3%
Top 75% exploitable
Prevalence
Ubiquitous
CPython is the reference Python implementation, deployed across virtually all modern infrastructure
Data Quality
6 sources
Confidence: High

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Open
Automatable· derived
Yes
Human Impact· derived
High

Priority Score

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

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

CVE-2026-17084 MEDIUM POC
6.0 Aug 18

Integrity bypass in CPython's stringprep module causes divergent domain name normalization when processing international

CVE-2026-19445 CRITICAL
9.2 Sep 30

A use-after-free in CPython's ssl module lets a remote, unauthenticated TLS client crash a Python TLS server process - o

CVE-2026-6100 CRITICAL
9.1 Apr 13

CPython decompression modules (lzma, bz2, gzip) allow memory corruption via use-after-free when decompressor instances a

CVE-2026-3298 HIGH
8.8 Apr 21

Out-of-bounds buffer write in CPython's asyncio.ProactorEventLoop (Windows only) allows remote attackers to trigger memo

CVE-2026-11972 HIGH
8.2 Jun 23

Denial of service in CPython's tarfile module allows remote attackers to trigger an infinite loop by supplying a crafted

CVE-2026-9669 HIGH
8.2 Jun 08

Stack-based buffer overflow in CPython's bz2.BZ2Decompressor allows remote attackers to crash Python applications by sen

CVE-2026-11940 HIGH
7.8 Jun 23

Path traversal in CPython's tarfile module allows a crafted tar archive to bypass the 'data' and 'tar' extraction filter

CVE-2026-19553 HIGH
7.6 Sep 30

Certificate hostname verification is silently skipped in CPython's TLS stack when an application enables SSLContext.chec

CVE-2026-4786 HIGH
7.0 Apr 13

Command injection in CPython's webbrowser.open() API bypasses previous CVE-2026-4519 mitigation via specially crafted UR

CVE-2026-4519 HIGH
7.0 Mar 20

The webbrowser.open() API in CPython accepts URLs with leading dashes, which certain web browsers interpret as command-l

CVE-2026-7774 MEDIUM
6.9 Jun 04

Path traversal in CPython's tarfile module allows malicious tar archives to bypass the data_filter safety mechanism and

CVE-2026-7210 MEDIUM
6.3 May 11

XML parsers in CPython's xml.parsers.expat and xml.etree.ElementTree modules use insufficient entropy for Expat hash-flo

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SLES15-SP5-CHOST-BYOS-SAP-CCloud Affected
SLES15-SP5-CHOST-BYOS-SAP-CCloud Affected
SLES15-SP6-CHOST-BYOS Affected
SLES15-SP6-CHOST-BYOS-Aliyun Affected
SLES15-SP6-CHOST-BYOS-Azure Affected

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