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
View

Attack ChainAIDerived

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

  1. Access
    Craft tar with negative offset header
  2. Delivery
    Deliver archive to Python service
  3. Exploit
    Application calls tarfile getmembers/extractall
  4. Execution
    Parser enters infinite loop in _block
  5. Persist
    Worker thread deadlocks
  6. Impact
    Service denial of service

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Loop termination conditions
MITRE ATT&CK

1 technique across 1 tactic: Impact

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

Exploitation Conditions

Exploitation requires that the target Python application actually parse or extract an attacker-controlled tar archive using the tarfile module's TarFile extraction or member-enumeration APIs (e.g. open(), getmembers(), extractall(), or iteration over members); the malicious archive must contain a header with a negative block offset (such as an oversized/0xFF size field). What limits exploitation: the flaw is DoS-only with no code execution or data exposure, and applications that never process untrusted tar input are unaffected. The CVSS PR:N/UI:N/AC:L metrics hold, but 'network' reachability is contingent on the archive reaching the parser over a network path rather than being an inherent remote-listener bug.

Impact

The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) describes a low-complexity, unauthenticated, network-reachable flaw with high availability impact and no confidentiality or integrity impact - consistent with a pure DoS. The 'network' vector is realistic only insofar as the vulnerable application accepts tar archives from untrusted sources (uploads, package processing, email attachments, CI pipelines); a program that never parses untrusted tar data is not exposed, so real-world reachability is application-dependent. Signals are mutually consistent and point to moderate priority: EPSS is low (0.61%, 46th percentile), there is no KEV listing and no public exploit identified, so this is not an active-exploitation emergency. However, the trigger is trivial to construct and the impact (full thread deadlock) is deterministic, so any service that ingests untrusted archives with Python should treat it as a genuine hardening priority rather than a theoretical high-CVSS issue.

Exploit ScenarioDerived

An attacker uploads a small, specially crafted tar file to a service that inventories or extracts its contents with Python's tarfile (for example a document-processing endpoint, package indexer, or CI artifact handler). When the application calls getmembers()/extractall(), the parser hits the negative-offset header and spins in an infinite loop, permanently tying up the worker thread and degrading or halting the service. No authentication, user interaction, or memory-corruption primitive is required - a single malformed archive is sufficient.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.6% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jul 30, 2026

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.

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.

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.

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

Know when the next one hits your stack

  • 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 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

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

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

Executive ViewAI

Why It Matters

CPython's tarfile module contains a denial-of-service vulnerability (CVE-2025-8194) rated HIGH severity that allows remote attackers to hang Python applications by submitting maliciously crafted tar archives. Any Python-based service processing user-supplied or network-received tar files-including web services, CI/CD systems, and backup platforms-faces operational risk. While no public exploit identified at time of analysis and exploitation remains limited (EPSS 0.6%), the lack of available patches and broad Python adoption require immediate protective measures.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Implement strict timeouts on all tarfile extraction and enumeration operations to prevent indefinite hangs; (2) Require authentication and source validation for any tar file uploads or processing; (3) Use resource quotas and thread limits to constrain impact of potential DoS; (4) Monitor upstream CPython releases and prepare rapid deployment of patched versions; (5) Consider architectural changes to isolate tarfile processing in dedicated, resource-limited processes to prevent cascade availability impact.

Threat Intelligence Overview

EPSS Score
0.6%
Top 54% exploitable
Prevalence
Ubiquitous
tarfile is a core module in the standard library of ubiquitous Python
Data Quality
4 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 HIGH
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
High

Priority Score

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

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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

References

Advisories & patches
ADVISORY https://access.redhat.com/errata/RHSA-2025:14546 ADVISORY https://access.redhat.com/errata/RHSA-2025:14560 ADVISORY https://access.redhat.com/errata/RHSA-2025:14841 ADVISORY https://access.redhat.com/errata/RHSA-2025:14900 ADVISORY https://access.redhat.com/errata/RHSA-2025:14984 ADVISORY https://access.redhat.com/errata/RHSA-2025:15007 ADVISORY https://access.redhat.com/errata/RHSA-2025:15010 ADVISORY https://access.redhat.com/errata/RHSA-2025:15019 ADVISORY https://access.redhat.com/errata/RHSA-2025:15348 ADVISORY https://access.redhat.com/errata/RHSA-2025:15724 ADVISORY https://access.redhat.com/errata/RHSA-2025:15800 ADVISORY https://access.redhat.com/errata/RHSA-2025:15968 ADVISORY https://access.redhat.com/errata/RHSA-2025:16012 ADVISORY https://access.redhat.com/errata/RHSA-2025:16016 ADVISORY https://access.redhat.com/errata/RHSA-2025:16031 ADVISORY https://access.redhat.com/errata/RHSA-2025:16062 ADVISORY https://access.redhat.com/errata/RHSA-2025:16078 ADVISORY https://access.redhat.com/errata/RHSA-2025:16117 ADVISORY https://access.redhat.com/errata/RHSA-2025:16118 ADVISORY https://access.redhat.com/errata/RHSA-2025:16151 ADVISORY https://access.redhat.com/errata/RHSA-2025:16152 ADVISORY https://access.redhat.com/errata/RHSA-2025:16153 ADVISORY https://access.redhat.com/errata/RHSA-2025:16262 ADVISORY https://access.redhat.com/errata/RHSA-2025:16524 ADVISORY https://access.redhat.com/errata/RHSA-2025:19421 ADVISORY https://access.redhat.com/errata/RHSA-2025:19422 ADVISORY https://access.redhat.com/errata/RHSA-2025:19423 ADVISORY https://access.redhat.com/errata/RHSA-2025:19424 ADVISORY https://access.redhat.com/errata/RHSA-2025:19425 ADVISORY https://access.redhat.com/errata/RHSA-2025:19426 ADVISORY https://access.redhat.com/errata/RHSA-2025:19427 ADVISORY https://access.redhat.com/errata/RHSA-2025:19428 ADVISORY https://access.redhat.com/errata/RHSA-2025:19429 ADVISORY https://access.redhat.com/errata/RHSA-2025:19430 ADVISORY https://vuldb.com/vuln/317961 ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02700/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02701/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02717/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02767/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02778/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02787/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02802/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02948/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02982/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02983/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:02984/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:03032/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:20631/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:20749/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:3706/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20125/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20154/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:22493/ REF http://www.openwall.com/lists/oss-security/2025/07/28/1 REF http://www.openwall.com/lists/oss-security/2025/07/28/2 REF https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1 REF https://github.com/python/cpython/commit/57f5981d6260ed21266e0c26951b8564cc252bc2 REF https://github.com/python/cpython/commit/7040aa54f14676938970e10c5f74ea93cd56aa38 REF https://github.com/python/cpython/commit/73f03e4808206f71eb6b92c579505a220942ef19 REF https://github.com/python/cpython/commit/b4ec17488eedec36d3c05fec127df71c0071f6cb REF https://github.com/python/cpython/commit/c9d9f78feb1467e73fd29356c040bde1c104f29f REF https://github.com/python/cpython/commit/cdae923ffe187d6ef916c0f665a31249619193fe REF https://github.com/python/cpython/commit/fbc2a0ca9ac8aff6887f8ddf79b87b4510277227 REF https://github.com/python/cpython/issues/130577 REF https://github.com/python/cpython/pull/137027 REF https://mail.python.org/archives/list/security-announce@python.org/thread/ZULLF3IZ726XP5EY7XJ7YIN3K5MDYR2D/

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