# GHSA-6CP7-3M3C-5X5C: Impact Denial of service via memory exhaustion

- Database: GitHub
- Severity: high (stated by ghsa, no CVSS score)
- Published: 2026-09-23
- Modified: 2026-10-01

## Tracked as

- [CVE-2026-61652](https://cve.now/CVE-2026-61652.md): Zapros, a Python HTTP client, prior to version 0.14.0 is vulnerable to denial of service via memory exhaustion

## Also published as

- [PYSEC-2026-4182](https://cve.now/PYSEC-2026-4182.md) (PyPA)

## Affected versions

- zapros (PyPI): fixed in 0.14.0

## Description

### Impact

Denial 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.

```python
import gzip, zapros

# Server returns ~1 GiB of zeros gzip-compressed to ~1 MiB,
# with header: Content-Encoding: gzip
bomb = gzip.compress(b"\0" * 1_000_000_000)  # ~1 MiB on the wire

with zapros.stream("GET", "https://malicious.example/bomb") as response:
    # Caller asks for 8 KiB chunks, expecting bounded memory:
    for chunk in response.iter_bytes(chunk_size=8192):
        ...  # first `chunk` is ~1 GiB, not 8 KiB -> memory exhaustion
```

### Patches

Upgrade 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.

### Workarounds

For unpatched versions:
- 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.

## References

- https://github.com/kap-sh/zapros/security/advisories/GHSA-6cp7-3m3c-5x5c
- https://nvd.nist.gov/vuln/detail/CVE-2026-61652
- https://github.com/kap-sh/zapros/commit/9b59fa65857734599c34b0b3dff4c2b62293a68d
- https://github.com/kap-sh/zapros
- https://github.com/kap-sh/zapros/releases/tag/v0.14.0

Page: https://cve.now/GHSA-6CP7-3M3C-5X5C

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
