Skip to content

Instantly share code, notes, and snippets.

@sethmlarson
Created July 29, 2025 13:37
Show Gist options
  • Save sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1 to your computer and use it in GitHub Desktop.
Save sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1 to your computer and use it in GitHub Desktop.
Mitigation for CVE-2025-8194
import tarfile
def _block_patched(self, count):
if count < 0:
raise tarfile.InvalidHeaderError("invalid offset")
return _block_patched._orig_block(self, count)
_block_patched._orig_block = tarfile.TarInfo._block
tarfile.TarInfo._block = _block_patched
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment