Skip to main content

CPython CVE-2025-8194

HIGH
Loop with Unreachable Exit Condition (Infinite Loop) (CWE-835)
2025-07-28 cna@python.org
7.5
CVSS 3.1 · Vendor: python
Share

Severity by source

Vendor (python) PRIMARY
7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI
7.5 HIGH

Untrusted tar input can arrive over the network with no auth or interaction and trivially triggers a deterministic deadlock, so AV:N/AC:L/PR:N/UI:N with availability-only A:H.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE
6.5 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Red Hat
7.5 MEDIUM
qualitative

Primary rating from Vendor (python).

CVSS VectorVendor: python

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

3
Source Code Evidence Fetched
Jul 30, 2026 - 23:34 vuln.today
Analysis Generated
Jul 30, 2026 - 23:34 vuln.today
CVE Published
Jul 28, 2025 - 19:15 cve.org
HIGH 7.5

DescriptionCVE.org

There is a defect in the CPython “tarfile” module affecting the “TarFile” extraction and entry enumeration APIs. The tar implementation would process tar archives with negative offsets without error, resulting in an infinite loop and deadlock during the parsing of maliciously crafted tar archives.

This vulnerability can be mitigated by including the following patch after importing the “tarfile” module:  https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1

AnalysisAI

Denial of service in the CPython standard-library 'tarfile' module allows remote attackers to hang any Python application that parses attacker-supplied tar archives. A maliciously crafted archive containing a header with a negative block offset causes the TarFile extraction and member-enumeration APIs (getmembers, extractall, iteration) to enter an infinite loop and deadlock, consuming the thread indefinitely. Rated CVSS 7.5 (availability-only); no public exploit is identified at time of analysis, EPSS is low at 0.61%, and it is not on CISA KEV, but the fix is upstream in CPython.

Technical ContextAI

The affected component is Python's built-in 'tarfile' module, used ubiquitously to read and extract .tar/.tar.gz/.tar.bz2 archives. The root cause is CWE-835 (loop with unreachable exit condition / infinite loop): the tar header parser's internal _block() routine computed the number of blocks to advance from an untrusted size/offset field without validating that the value was non-negative. A crafted header carrying a negative offset (e.g. an all-0xFF size field, as shown in the added POSIX/GNU/v7 test fixtures) causes the reader to loop forever rather than advancing through the stream. The upstream fix (python/cpython PR 137027, issue 130577) adds an explicit guard in Lib/tarfile.py that raises InvalidHeaderError('invalid offset') when count < 0, and the accompanying tests confirm the reader now stops at the invalid header or surfaces a ReadError instead of hanging.

Affected ProductsAI

The affected product is CPython's standard-library 'tarfile' module across supported Python 3.x branches (the vendor security-announce thread and multiple backport commits indicate several maintenance branches received fixes). Exact fixed release versions are not enumerated in the provided input; affected/fixed boundaries should be confirmed against the python.org security advisory (https://mail.python.org/archives/list/security-announce@python.org/thread/ZULLF3IZ726XP5EY7XJ7YIN3K5MDYR2D/) and the tracking issue https://github.com/python/cpython/issues/130577. No CPE strings were supplied in the input, so version ranges are inferred from the CPython commit set rather than an authoritative CPE match.

RemediationAI

Upgrade to a CPython maintenance release that includes the fix from python/cpython PR 137027 (commit 57f5981d6260ed21266e0c26951b8564cc252bc2 and associated backports), which adds a negative-offset guard raising InvalidHeaderError; consult the python.org security-announce thread (https://mail.python.org/archives/list/security-announce@python.org/thread/ZULLF3IZ726XP5EY7XJ7YIN3K5MDYR2D/) for the exact patched version for your branch since the input does not name a specific release. Because patch refs point to commits and a PR rather than a single tagged release, treat the released patched version as not independently confirmed and verify it for your Python line. As an interim compensating control where upgrading is not immediately possible, apply the vendor-published monkeypatch that wraps the tarfile parser (https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1) after importing tarfile - note the trade-off that it modifies stdlib behavior at runtime and must be re-applied on every process start. Additionally, avoid parsing tar archives from untrusted sources, enforce timeouts / run extraction in a separate killable worker process or thread so a hang cannot deadlock the main service, and impose size limits before parsing.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
Container bci/bci-base-fips:15.6.32.11 Container bci/bci-sle15-kernel-module-devel:15.6.47.5 Container bci/bci-sle15-kernel-module-devel:15.7-44.3 Container bci/spack:0.23.1-11.42 Container bci/spack:0.23.1-15.11 Container suse/kea:2.6 Container suse/kiosk/pulseaudio:17.0-63.6 Container suse/kiosk/tigervnc-x11vnc:latest Container suse/ltss/sle15.4/bci-base-fips:15.4.2.27 Container suse/manager/5.0/x86_64/server-migration-14-16:5.0.5.1.7.26.2 Container suse/mariadb:10.11.11-70.15 Container suse/mariadb:11.4.5-63.12 Container suse/multi-linux-manager/5.1/x86_64/server-migration-14-16:5.1.1.8.7.1 Container suse/postgres:16.14 Container suse/postgres:17.10 Container suse/postgres:18.3-contrib-65.3 Container suse/samba-client:4.21-64.10 Container suse/samba-server:4.21-64.10 Container suse/samba-toolbox:4.21-64.10 Container suse/sle-micro-rancher/5.2:latest Container suse/sle-micro/5.1/toolbox:14.2-3.13.160 Container suse/sle-micro/5.2/toolbox:14.2-7.11.162 Container suse/sle-micro/5.3/toolbox:14.2-6.11.170 Container suse/sle-micro/5.4/toolbox:14.2-5.19.170 Container suse/sle-micro/5.5/toolbox:14.2-3.12.76 Image SLES15-SP6-CHOST-BYOS-GCE Image SLES15-SP7-CHOST-BYOS-GCE Image server-database-migration-image Image server-migration-14-16-image Affected
Container bci/kiwi:9.24.43-18.15 Container suse/389-ds:2.5.3-62.13 Affected
Container rancher/seedimage-builder:latest Container suse/sles/16.0/toolbox:16.3-1.17 Affected
Container suse/manager/4.3/proxy-httpd:4.3.16.9.67.14 Container suse/manager/4.3/proxy-salt-broker:4.3.16.9.57.14 Container suse/manager/4.3/proxy-ssh:4.3.16.9.57.11 Container suse/manager/4.3/proxy-tftpd:4.3.16.9.57.13 Container suse/manager/5.0/x86_64/proxy-httpd:5.0.5.1.7.26.2 Container suse/manager/5.0/x86_64/proxy-salt-broker:5.0.5.1.7.28.2 Container suse/manager/5.0/x86_64/proxy-ssh:5.0.5.1.7.26.1 Container suse/manager/5.0/x86_64/proxy-tftpd:5.0.5.1.7.26.1 Container suse/multi-linux-manager/5.1/x86_64/proxy-httpd:5.1.1.8.9.2 Container suse/multi-linux-manager/5.1/x86_64/proxy-squid:5.1.2.8.13.1 Container suse/multi-linux-manager/5.1/x86_64/proxy-ssh:5.1.1.8.7.1 Container suse/multi-linux-manager/5.1/x86_64/proxy-tftpd:5.1.1.8.7.1 Image SLES15-SP3-Micro-5-2-BYOS-Azure Image SLES15-SP3-Micro-5-2-BYOS-EC2-HVM Image SLES15-SP3-Micro-5-2-BYOS-GCE Image SLES15-SP4-CHOST-BYOS-GCE Image SLES15-SP4-Micro-5-3 Image SLES15-SP4-Micro-5-3-BYOS Image SLES15-SP4-Micro-5-3-BYOS-Azure Image SLES15-SP4-Micro-5-3-BYOS-EC2 Image SLES15-SP4-Micro-5-3-BYOS-GCE Image SLES15-SP4-Micro-5-3-EC2 Image SLES15-SP4-Micro-5-4 Image SLES15-SP4-Micro-5-4-BYOS Image SLES15-SP4-Micro-5-4-BYOS-Azure Image SLES15-SP4-Micro-5-4-BYOS-EC2 Image SLES15-SP4-Micro-5-4-BYOS-GCE Image SLES15-SP4-Micro-5-4-EC2 Image SLES15-SP4-Micro-5-4-GCE Image SLES15-SP5-CHOST-BYOS-GCE Image SLES15-SP5-Manager-Proxy-5-0-BYOS Image SLES15-SP5-Manager-Proxy-5-0-BYOS-Azure Image SLES15-SP5-Manager-Proxy-5-0-BYOS-EC2 Image SLES15-SP5-Manager-Proxy-5-0-BYOS-GCE Image SLES15-SP5-Manager-Server-5-0-BYOS Image SLES15-SP5-Manager-Server-5-0-BYOS-Azure Image SLES15-SP5-Manager-Server-5-0-BYOS-EC2 Image SLES15-SP5-Manager-Server-5-0-BYOS-GCE Image proxy-httpd-image Image proxy-squid-image Image proxy-ssh-image Image proxy-tftpd-image Affected
Container suse/manager/5.0/x86_64/server:5.0.5.1.7.33.2 Image SLES15-SP4-BYOS-GCE Image SLES15-SP4-HPC-BYOS-GCE Image SLES15-SP4-HPC-GCE Image SLES15-SP4-Hardened-BYOS-GCE Image SLES15-SP4-Manager-Proxy-4-3-BYOS Image SLES15-SP4-Manager-Proxy-4-3-BYOS-Azure Image SLES15-SP4-Manager-Proxy-4-3-BYOS-EC2 Image SLES15-SP4-Manager-Proxy-4-3-BYOS-GCE Image SLES15-SP4-Manager-Server-4-3-BYOS Image SLES15-SP4-Manager-Server-4-3-BYOS-Azure Image SLES15-SP4-Manager-Server-4-3-BYOS-EC2 Image SLES15-SP4-Manager-Server-4-3-BYOS-GCE Image SLES15-SP4-SAP-Azure-LI-BYOS Image SLES15-SP4-SAP-Azure-LI-BYOS-Production Image SLES15-SP4-SAP-Azure-VLI-BYOS Image SLES15-SP4-SAP-Azure-VLI-BYOS-Production Image SLES15-SP4-SAP-BYOS-GCE Image SLES15-SP4-SAP-GCE Image SLES15-SP4-SAP-Hardened-BYOS-GCE Image SLES15-SP4-SAP-Hardened-GCE Image SLES15-SP4-SAPCAL-GCE Image SLES15-SP5-BYOS-GCE Image SLES15-SP5-GCE Image SLES15-SP5-HPC-BYOS-GCE Image SLES15-SP5-Hardened-BYOS-GCE Image SLES15-SP5-SAP-Azure-LI-BYOS Image SLES15-SP5-SAP-Azure-LI-BYOS-Production Image SLES15-SP5-SAP-Azure-VLI-BYOS Image SLES15-SP5-SAP-Azure-VLI-BYOS-Production Image SLES15-SP5-SAP-BYOS-GCE Image SLES15-SP5-SAP-Hardened-BYOS-GCE Image SLES15-SP5-SAP-Hardened-GCE Image SLES15-SP5-SAPCAL-GCE Image SLES15-SP6-BYOS-GCE Image SLES15-SP6-GCE Image SLES15-SP6-HPC-BYOS-GCE Image SLES15-SP6-HPC-GCE Image SLES15-SP6-Hardened-BYOS-GCE Image SLES15-SP6-SAP-Azure-LI-BYOS Image SLES15-SP6-SAP-Azure-LI-BYOS-Production Image SLES15-SP6-SAP-Azure-VLI-BYOS Image SLES15-SP6-SAP-Azure-VLI-BYOS-Production Image SLES15-SP6-SAP-BYOS-GCE Image SLES15-SP6-SAP-GCE Image SLES15-SP6-SAP-Hardened-BYOS-GCE Image SLES15-SP6-SAP-Hardened-GCE Image SLES15-SP6-SAPCAL-GCE Image SLES15-SP7-GCE-3P Image SLES15-SP7-SAP-Azure-LI-BYOS-Production Image SLES15-SP7-SAP-Azure-VLI-BYOS-Production Image SLES15-SP7-SAP-GCE-3P Affected

Share

CVE-2025-8194 vulnerability details – vuln.today

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