Python Software Foundation CPython
Tarfile infinite loop during parsing with negative member offset
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 versions and mitigation
From the CVE record and the vendor's references.Affected
- < 3.9.24
- >= 3.10.0, < 3.10.19
- >= 3.11.0, < 3.11.14
- >= 3.12.0, < 3.12.12
- >= 3.13.0, < 3.13.6
- >= 3.14.0a1, < 3.14.0rc2
Fixed in 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.6, 3.14.0rc2
Mitigation
Upgrade CPython to 3.9.24 or 3.10.19 or 3.11.14 or 3.12.12 or 3.13.6 or 3.14.0rc2 or later.
References
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.