- "details": "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. \n\nThis vulnerability can be mitigated by including the following patch after importing the “tarfile” module:\n\n\n\nimport tarfile\n\ndef _block_patched(self, count):\n if count \u003c 0: # pragma: no cover\n raise tarfile.InvalidHeaderError(\"invalid offset\")\n return _block_patched._orig_block(self, count)\n\n_block_patched._orig_block = tarfile.TarInfo._block\ntarfile.TarInfo._block = _block_patched",
0 commit comments