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
                
            Metrics
Affected Vendors & Products
References
        History
                    Wed, 24 Sep 2025 18:00:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References |  | 
Thu, 07 Aug 2025 20:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References |  | 
Tue, 29 Jul 2025 13:45:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| Description | 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: import tarfile def _block_patched(self, count): if count < 0: # pragma: no cover raise tarfile.InvalidHeaderError("invalid offset") return _block_patched._orig_block(self, count) _block_patched._orig_block = tarfile.TarInfo._block tarfile.TarInfo._block = _block_patched | 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 | 
| References |  | 
Tue, 29 Jul 2025 12:30:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References |  | |
| Metrics | threat_severity 
 | threat_severity 
 | 
Tue, 29 Jul 2025 08:00:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| First Time appeared | Python Python cpython | |
| Vendors & Products | Python Python cpython | 
Mon, 28 Jul 2025 19:45:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| References |  | 
Mon, 28 Jul 2025 19:15:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| Metrics | ssvc 
 | 
Mon, 28 Jul 2025 19:00:00 +0000
| Type | Values Removed | Values Added | 
|---|---|---|
| Description | 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: import tarfile def _block_patched(self, count): if count < 0: # pragma: no cover raise tarfile.InvalidHeaderError("invalid offset") return _block_patched._orig_block(self, count) _block_patched._orig_block = tarfile.TarInfo._block tarfile.TarInfo._block = _block_patched | |
| Title | Tarfile infinite loop during parsing with negative member offset | |
| Weaknesses | CWE-835 | |
| References |  | |
| Metrics | cvssV3_1 
 | 
 MITRE
                        MITRE
                    Status: PUBLISHED
Assigner: PSF
Published: 2025-07-28T18:42:44.847Z
Updated: 2025-10-09T18:38:02.590Z
Reserved: 2025-07-25T14:05:55.899Z
Link: CVE-2025-8194
 Vulnrichment
                        Vulnrichment
                    Updated: 2025-07-28T18:57:56.132Z
 NVD
                        NVD
                    Status : Awaiting Analysis
Published: 2025-07-28T19:15:43.793
Modified: 2025-09-24T18:15:42.720
Link: CVE-2025-8194
 Redhat
                        Redhat