Memory exhaustion via crafted zip file
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
As reported by @tonghuaroot:
zipfile.ZipExtFile._read1() bounds the output of each decompress() call for DEFLATE members (it passes a max_length to zlib), but for bzip2 / LZMA / Zstandard members it called self._decompressor.decompress(data) with no bound. A whole compressed chunk was therefore expanded into a single allocation before the data = data[:self._left] clip ran.
Linked PRs
- gh-156003
- gh-156362
- gh-156737
- gh-156738
- gh-156739
- gh-156740
- gh-156741
- gh-157180
- gh-157268
- gh-157557
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at zipfile.ZipExtFile._read1() and compare its DEFLATE handling with the bzip2, LZMA, and Zstandard paths. Confirm that expanded output is bounded before clipping the remaining data, then add regression coverage for crafted members and verify the linked PRs to avoid duplicating work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100