CVE-2025-8194
Tarfile infinite loop during parsing with negative member offset
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
0Exploited in Wild
-Decision
Descriptions
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
Existe un defecto en el módulo "tarfile" de CPython que afecta a las API de extracción y enumeración de entradas de "TarFile". La implementación de tar procesaba archivos tar con desplazamientos negativos sin errores, lo que resultaba en un bucle infinito y un bloqueo durante el análisis de archivos tar manipulados con fines maliciosos. Esta vulnerabilidad se puede mitigar incluyendo el siguiente parche después de importar el módulo "tarfile": 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
This update for python39 fixes the following issues. Fixed denial of service caused by tar archives with negative offsets.
CVSS Scores
SSVC
- Decision:Attend
Timeline
- 2025-07-25 CVE Reserved
- 2025-07-28 CVE Published
- 2025-08-08 EPSS Updated
- 2025-08-14 CVE Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
- ---------- First Exploit
CWE
- CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
CAPEC
References (8)
URL | Tag | Source |
---|---|---|
https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1 | Mitigation | |
https://github.com/python/cpython/issues/130577 | Issue Tracking |
URL | Date | SRC |
---|
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Python Software Foundation Search vendor "Python Software Foundation" | CPython Search vendor "Python Software Foundation" for product "CPython" | < 3.13.6 Search vendor "Python Software Foundation" for product "CPython" and version " < 3.13.6" | en |
Affected
|