{"id":"CVE-2026-61652","aliases":["CVE-2026-61652","GHSA-6cp7-3m3c-5x5c","PYSEC-2026-4182"],"related":[],"kind":"vulnerability","state":"published","title":"Zapros: Streaming decoders ignored the requested chunk size, allowing a single compressed response chunk to allocate unbounded memory (decompression bomb)","summary":"Zapros, a Python HTTP client, prior to version 0.14.0 is vulnerable to denial of service via memory exhaustion. The issue affects all callers who streamed compressed responses relying on the chunk size — explicit (`iter_bytes(chunk_size=...)`) or the default — to bound memory. The decoder ignored that bound, so a chunk could be far larger than requested and a single compressed response could overflow memory. Version 0.14.0 contains a patch. Some workarounds are available. Read the still-compressed body with `Response.iter_raw()` / `Response.async_iter_raw()`, which bypass the built-in decoders, and decompress it yourself with an explicit output-size bound (e.g. `zlib`'s `max_length`), aborting once a configured limit is exceeded. Where feasible, send `Accept-Encoding: identity` to disable response compression so bodies are not decompressed client-side. Avoid decoding response bodies from untrusted servers.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Zapros, a Python HTTP client, prior to version 0.14.0 is vulnerable to denial of service via memory exhaustion. The issue affects all callers who streamed compressed responses relying on the chunk size — explicit (`iter_bytes(chunk_size=...)`) or the default — to bound memory. The decoder ignored that bound, so a chunk could be far larger than requested and a single compressed response could overflow memory. Version 0.14.0 contains a patch. Some workarounds are available. Read the still-compressed body with `Response.iter_raw()` / `Response.async_iter_raw()`, which bypass the built-in decoders, and decompress it yourself with an explicit output-size bound (e.g. `zlib`'s `max_length`), aborting once a configured limit is exceeded. Where feasible, send `Accept-Encoding: identity` to disable response compression so bodies are not decompressed client-side. Avoid decoding response bodies from untrusted servers.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nDenial of service via memory exhaustion. Affects all callers who streamed compressed responses relying on the chunk size — explicit (`iter_bytes(chunk_size=...)`) or the default — to bound memory. The decoder ignored that bound, so a chunk could be far larger than requested and a single compressed response could overflow memory.\n\n```python\nimport gzip, zapros\n\n# Server returns ~1 GiB of zeros gzip-compressed to ~1 MiB,\n# with header: Content-Encoding: gzip\nbomb = gzip.compress(b\"\\0\" * 1_000_000_000)  # ~1 MiB on the wire\n\nwith zapros.stream(\"GET\", \"https://malicious.example/bomb\") as response:\n    # Caller asks for 8 KiB chunks, expecting bounded memory:\n    for chunk in response.iter_bytes(chunk_size=8192):\n        ...  # first `chunk` is ~1 GiB, not 8 KiB -> memory exhaustion\n```\n\n### Patches\n\nUpgrade to `0.14.0` or later. The decoders now bound the output of each decompression step to the requested `chunk_size`: gzip/deflate via `zlib`'s `max_length` + `unconsumed_tail`, brotli via `output_buffer_limit`, and zstd via a bounded `stream_writer`. Peak memory during streaming decode is now proportional to `chunk_size` for all supported encodings.\n\n### Workarounds\n\nFor unpatched versions:\n- Read the still-compressed body with `Response.iter_raw()` / `Response.async_iter_raw()`, which bypass the built-in decoders, and decompress it yourself with an explicit output-size bound (e.g. `zlib`'s `max_length`), aborting once a configured limit is exceeded.\n- Where feasible, send `Accept-Encoding: identity` to disable response compression so bodies are not decompressed client-side.\n- Avoid decoding response bodies from untrusted servers.","format":"markdown","source":"ghsa"}],"published":"2026-09-21T21:13:26.969Z","modified":"2026-10-01T17:55:49.149Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"< 0.14.0","status":"affected"}],"vendor":"kap-sh","product":"zapros","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.14.0"}],"ecosystem":"PyPI","package":"zapros","purl":"pkg:pypi/zapros","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.14.0"}],"ecosystem":"PyPI","package":"zapros","purl":"pkg:pypi/zapros","source":"pysec"}],"references":[{"url":"https://github.com/kap-sh/zapros/security/advisories/GHSA-6cp7-3m3c-5x5c","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-61652","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/kap-sh/zapros/commit/9b59fa65857734599c34b0b3dff4c2b62293a68d","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/kap-sh/zapros","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/kap-sh/zapros/releases/tag/v0.14.0","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/zapros","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-6cp7-3m3c-5x5c","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-09-22T14:39:06.743Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-61652","url":"https://www.cve.org/CVERecord?id=CVE-2026-61652","licence":"CVE Terms of Use","modified":"2026-09-22T14:41:07.283Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6cp7-3m3c-5x5c","url":"https://github.com/advisories/GHSA-6cp7-3m3c-5x5c","licence":"CC-BY-4.0","modified":"2026-10-01T17:55:49.149Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-61652","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-61652","licence":"Public domain","modified":"2026-09-24T21:25:27.050Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-4182","url":"https://osv.dev/vulnerability/PYSEC-2026-4182","licence":"CC-BY-4.0","modified":"2026-10-01T17:45:09.327Z"}],"updatedAt":"2026-11-25T22:59:40.398Z","epss":{"score":0.00263,"percentile":0.19313,"date":"2026-12-02T12:00:21.000Z"}}