CVE-2026-58107: Python Zlib Unbounded Decompression

One-shot decompression using 'zlib.decompress' on potentially untrusted input materializes the entire decompressed data in memory without enforcing maximum size limits, allowing decompression bombs (CWE-409). Use 'zlib.decompressobj().decompress(..., max_length=...)' to bound the maximum decompressed size.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-58107-python-zlib-unbounded-decompression --engine opengrep

Description

One-shot decompression using 'zlib.decompress' on potentially untrusted input materializes the entire decompressed data in memory without enforcing maximum size limits, allowing decompression bombs (CWE-409). Use 'zlib.decompressobj().decompress(..., max_length=...)' to bound the maximum decompressed size.