CVE-2025-8194
JSON

7.5high

Tarfile infinite loop during parsing with negative member offset

Severity
7.5high CVSS:3.1 by PSF
Exploit likelihood
0.76% (higher than 56% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
PSF
Also known as
PSF-2025-11BIT-LIBPYTHON-2025-8194BIT-PYTHON-2025-8194BIT-PYTHON-MIN-2025-8194

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:  https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1

Affected

Product or packageVersionsReported by
Python Software Foundation CPythonbefore 3.9.24, from 3.10.0 before 3.10.19, from 3.11.0 before 3.11.14, from 3.12.0 before 3.12.12, from 3.13.0 before 3.13.6, from 3.14.0a1 before 3.14.0rc2CVE List
https://github.com/python/cpythonbefore 7040aa54f14676938970e10c5f74ea93cd56aa38, before cdae923ffe187d6ef916c0f665a31249619193fe, before c9d9f78feb1467e73fd29356c040bde1c104f29f, before fbc2a0ca9ac8aff6887f8ddf79b87b4510277227, before 57f5981d6260ed21266e0c26951b8564cc252bc2, before 73f03e4808206f71eb6b92c579505a220942ef19, before b4ec17488eedec36d3c05fec127df71c0071f6cbPython Software Foundation
libpython (Bitnami)before 3.9.24, from 3.10.0 before 3.10.19, from 3.11.0 before 3.11.14, from 3.12.0 before 3.12.12, from 3.13.0 before 3.13.6Bitnami Vulnerability Database
python (Bitnami)before 3.9.24, from 3.10.0 before 3.10.19, from 3.11.0 before 3.11.14, from 3.12.0 before 3.12.12, from 3.13.0 before 3.13.6Bitnami Vulnerability Database
python-min (Bitnami)before 3.9.24, from 3.10.0 before 3.10.19, from 3.11.0 before 3.11.14, from 3.12.0 before 3.12.12, from 3.13.0 before 3.13.6Bitnami Vulnerability Database

All scores

PSF7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Bitnami Vulnerability Databasehigh rating

Classification

CWE-835

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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

NVD (es)

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

References

https://github.com/python/cpython/issues/130577issue-tracking, report, web
https://github.com/python/cpython/pull/137027patch, web
https://mail.python.org/archives/list/security-announce@python.org/thread/ZULLF3IZ726XP5EY7XJ7YIN3K5MDYR2D/advisory, vendor-advisory, web
https://github.com/python/cpython/commit/7040aa54f14676938970e10c5f74ea93cd56aa38fix, patch, web
https://github.com/python/cpython/commit/cdae923ffe187d6ef916c0f665a31249619193fefix, patch, web
https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1mitigation, web
https://github.com/python/cpython/commit/c9d9f78feb1467e73fd29356c040bde1c104f29ffix, patch, web
https://github.com/python/cpython/commit/fbc2a0ca9ac8aff6887f8ddf79b87b4510277227fix, patch, web
https://github.com/python/cpython/commit/57f5981d6260ed21266e0c26951b8564cc252bc2fix, patch, web
https://github.com/python/cpython/commit/73f03e4808206f71eb6b92c579505a220942ef19fix, patch, web
https://github.com/python/cpython/commit/b4ec17488eedec36d3c05fec127df71c0071f6cbfix, patch, web
http://www.openwall.com/lists/oss-security/2025/07/28/1web

Sources

SourceRecordLicence
CVE ListCVE-2025-8194 changed 2026-07-31CVE Terms of Use
Python Software FoundationPSF-2025-11 changed 2025-10-09CC-BY-4.0
NVDCVE-2025-8194 changed 2026-07-31Public domain
Bitnami Vulnerability DatabaseBIT-LIBPYTHON-2025-8194 changed 2026-11-17Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-2025-8194 changed 2026-11-17Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-MIN-2025-8194 changed 2026-11-17Apache-2.0