microsoft / microsoft/markitdown

[Security] Potential Denial of Service (DoS) via Zip Bomb in ZipConverter

Open
#1,514 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
186k
Forks
13.7k
Avg merge
1d 4h
Merged PRs (30d)
49

Description

A vulnerability was identified in the ZipConverter where it attempts to read the entire content of each file within a ZIP archive into memory simultaneously. This can be exploited using a "Zip Bomb" (a small ZIP file that decompresses to a very large size), leading to excessive memory consumption and potential system crashes (Out-of-Memory).‘
In packages/markitdown/src/markitdown/converters/_zip_converter.py, the code uses zipObj.read(name) to extract file contents:z_file_stream = io.BytesIO(zipObj.read(name))
Suggested Mitigation:
Check the file_size in ZipInfo before reading, and implement a configurable maximum size limit (e.g., 100MB). Alternatively, use a streaming approach if the underlying sub-converters support it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/markitdown/src/markitdown/converters/_zip_converter.py and inspect how ZipInfo and zipObj.read(name) are used. Define and implement a bounded extraction behavior, then verify that ZIP entries exceeding the configured limit cannot cause unbounded memory use; the issue does not name a specific test file.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.