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 package | Versions | Reported by |
|---|---|---|
| Python Software Foundation CPython | 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.6, from 3.14.0a1 before 3.14.0rc2 | CVE List |
| https://github.com/python/cpython | before 7040aa54f14676938970e10c5f74ea93cd56aa38, before cdae923ffe187d6ef916c0f665a31249619193fe, before c9d9f78feb1467e73fd29356c040bde1c104f29f, before fbc2a0ca9ac8aff6887f8ddf79b87b4510277227, before 57f5981d6260ed21266e0c26951b8564cc252bc2, before 73f03e4808206f71eb6b92c579505a220942ef19, before b4ec17488eedec36d3c05fec127df71c0071f6cb | Python 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.6 | Bitnami 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.6 | Bitnami 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.6 | Bitnami Vulnerability Database |
All scores
| PSF | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| Bitnami Vulnerability Database | high rating |
Classification
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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-8194 changed 2026-07-31 | CVE Terms of Use |
| Python Software Foundation | PSF-2025-11 changed 2025-10-09 | CC-BY-4.0 |
| NVD | CVE-2025-8194 changed 2026-07-31 | Public domain |
| Bitnami Vulnerability Database | BIT-LIBPYTHON-2025-8194 changed 2026-11-17 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PYTHON-2025-8194 changed 2026-11-17 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PYTHON-MIN-2025-8194 changed 2026-11-17 | Apache-2.0 |