Description
When using a TarFile.errorlevel = 0 and extracting with a filter the documented behavior is that any filtered members would be skipped and not extracted. However the actual behavior of TarFile.errorlevel = 0 in affected versions is that the member would still be extracted and not skipped.
Published: 2025-06-03
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: Unauthorized File Extraction
Action: Apply Patch
AI Analysis

Impact

When a Python TarFile instance has its errorlevel attribute set to 0, the documented behavior is that any archive entries that are filtered out should be ignored during extraction. In the affected CPython releases, however, the extraction logic fails to honor this contract and still writes the filtered members to the target directory. The result is that an attacker can supply a tar archive containing entries that are intended to be skipped, and those entries will nevertheless be extracted, potentially creating or overwriting files on the filesystem. The vulnerability stems from incorrect control flow (CWE‑706) and a faulty use of the filtering mechanism (CWE‑682), leading to unauthorized creation of files and loss of isolation between the archive contents and the application environment.

Affected Systems

The flaw resides in CPython’s tarfile module. All CPython versions prior to the patch commit that introduces the fix are considered vulnerable. Red Hat Enterprise Linux 8, 9, and their extended‑service releases (RHEL EUS, RHEL E4S, RHEL EUS Long Life, RHEL TUS) that ship unpatched Python packages are at risk. Because the CVE record does not list specific CPython release numbers, users should identify which Python interpreter they are using and verify whether the version includes the commit that resolves the issue.

Risk and Exploitability

The CVSS score of 7.5 indicates high severity. The EPSS score of less than 1 % and the absence from the CISA KEV catalog suggest that exploitation is currently rare, but the potential for disruptive file writes remains. The likely attack vector is an application that runs Python code and can set TarFile.errorlevel = 0 while processing a user‑supplied tar archive. Based on the description, it is inferred that an attacker who can control this environment can extract or overwrite files, thereby possibly exposing sensitive data or altering system configuration. Although the exploitation probability is low, the impact of unintended file creation or overwrite warrants timely remediation.

Generated by OpenCVE AI on April 22, 2026 at 12:09 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade CPython to a release that contains the tarfile logic fix.
  • Avoid setting TarFile.errorlevel = 0; instead use the default extraction behavior or apply an explicit filter before invoking extract members.
  • If a patch cannot be applied immediately, perform extraction in a restricted environment (e.g., a read‑only chroot or container) to limit the scope of any file writes.

Generated by OpenCVE AI on April 22, 2026 at 12:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
EUVD EUVD EUVD-2025-16725 When using a TarFile.errorlevel = 0 and extracting with a filter the documented behavior is that any filtered members would be skipped and not extracted. However the actual behavior of TarFile.errorlevel = 0 in affected versions is that the member would still be extracted and not skipped.
Ubuntu USN Ubuntu USN USN-7583-1 Python vulnerabilities
History

Wed, 09 Jul 2025 02:30:00 +0000

Type Values Removed Values Added
CPEs cpe:/a:redhat:rhel_e4s:8.8
cpe:/a:redhat:rhel_eus_long_life:8.8
cpe:/a:redhat:rhel_tus:8.8

Tue, 08 Jul 2025 02:45:00 +0000

Type Values Removed Values Added
First Time appeared Redhat rhel Aus
Redhat rhel E4s
Redhat rhel Eus Long Life
Redhat rhel Tus
CPEs cpe:/a:redhat:rhel_aus:8.6
cpe:/a:redhat:rhel_e4s:8.6
cpe:/a:redhat:rhel_eus_long_life:8.6
cpe:/a:redhat:rhel_tus:8.6
Vendors & Products Redhat rhel Aus
Redhat rhel E4s
Redhat rhel Eus Long Life
Redhat rhel Tus

Wed, 02 Jul 2025 14:45:00 +0000

Type Values Removed Values Added
CPEs cpe:/a:redhat:enterprise_linux:9
cpe:/o:redhat:enterprise_linux:10.0
cpe:/o:redhat:enterprise_linux:8
cpe:/o:redhat:enterprise_linux:9

Wed, 02 Jul 2025 02:30:00 +0000

Type Values Removed Values Added
First Time appeared Redhat enterprise Linux
CPEs cpe:/a:redhat:enterprise_linux:8
Vendors & Products Redhat enterprise Linux

Tue, 01 Jul 2025 02:30:00 +0000

Type Values Removed Values Added
First Time appeared Redhat
Redhat rhel Eus
CPEs cpe:/a:redhat:rhel_eus:9.4
Vendors & Products Redhat
Redhat rhel Eus

Fri, 20 Jun 2025 06:45:00 +0000

Type Values Removed Values Added
References

Fri, 06 Jun 2025 19:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-706
References
Metrics threat_severity

None

threat_severity

Moderate


Tue, 03 Jun 2025 21:00:00 +0000


Tue, 03 Jun 2025 15:30:00 +0000


Tue, 03 Jun 2025 15:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-682
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 03 Jun 2025 15:00:00 +0000


Tue, 03 Jun 2025 13:30:00 +0000


Tue, 03 Jun 2025 13:15:00 +0000

Type Values Removed Values Added
Description When using a TarFile.errorlevel = 0 and extracting with a filter the documented behavior is that any filtered members would be skipped and not extracted. However the actual behavior of TarFile.errorlevel = 0 in affected versions is that the member would still be extracted and not skipped.
Title Tarfile extracts filtered members when errorlevel=0
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}


Subscriptions

Python Cpython
Redhat Enterprise Linux Rhel Aus Rhel E4s Rhel Eus Rhel Eus Long Life Rhel Tus
cve-icon MITRE

Status: PUBLISHED

Assigner: PSF

Published:

Updated: 2026-04-21T20:16:34.166Z

Reserved: 2025-05-08T15:05:11.874Z

Link: CVE-2025-4435

cve-icon Vulnrichment

Updated: 2025-06-03T14:34:29.201Z

cve-icon NVD

Status : Deferred

Published: 2025-06-03T13:15:20.630

Modified: 2026-04-15T00:35:42.020

Link: CVE-2025-4435

cve-icon Redhat

Severity : Moderate

Publid Date: 2025-06-03T12:59:06Z

Links: CVE-2025-4435 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-04-22T12:15:16Z

Weaknesses