{"id":2395,"cve":"CVE-2026-61541","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-61541\/","cwe":"CWE-770","cwe_number":770,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/770","cvss_score":6.9,"published":"2026-09-21","owasp":"A04 Insecure Design","odc":"Timing\/Serialization","cdc":"Timing Issues","category":"Resource Management","subcategory":"Resource Exhaustion","scope":"Remote","impact":"Denial of Service (DoS)","summary":"Zapros <0.14.0 allows DoS via excessive chained Content\u2011Encoding layers.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-61541\/","description":"Zapros, a Python HTTP client, prior to version 0.14.0 is vulnerable to denial of service when an application requests content from an untrusted server, or follows a redirect to one, because a malicious response containing an excessive number of chained `Content-Encoding` values causes Zapros to construct a deeply nested decompression chain that consumes excessive resources. Version 0.14.0 patches the vulnerability by limiting responses to five content-encoding layers and raising `DecodingError` when that limit is exceeded. As a workaround, applications can add response middleware that inspects the `Content-Encoding` header and rejects responses containing more than a safe number of encoding layers.","solution":"Upgrade Zapros to version\u202f0.14.0 (or later).","affected_component":"Zapros","fixed_by_upgrading":true,"vulnerable_code":"import zapros\nfrom zapros.exceptions import DecodingError\n\ndef fetch(url: str) -> bytes:\n    \"\"\"\n    Fetches content from `url` using Zapros without limiting\n    the number of content\u2011encoding layers.\n    \"\"\"\n    client = zapros.Client()\n    response = client.get(url)\n\n    # VULNERABLE: unbounded decoding chain allows resource exhaustion\n    encodings = response.headers.get('Content-Encoding', '').split(',')\n    body = response.body\n    for enc in encodings:\n        enc = enc.strip().lower()\n        if enc == 'gzip':\n            body = zapros.decoders.gzip_decode(body)\n        elif enc == 'deflate':\n            body = zapros.decoders.deflate_decode(body)\n        elif enc == 'br':\n            body = zapros.decoders.brotli_decode(body)\n        # additional encodings may be added here\n    return body\n","patched_code":"import zapros\nfrom zapros.exceptions import DecodingError\n\ndef fetch(url: str) -> bytes:\n    \"\"\"\n    Fetches content from `url` using Zapros, limiting the number of\n    content\u2011encoding layers to prevent resource exhaustion.\n    \"\"\"\n    client = zapros.Client()\n    response = client.get(url)\n\n    # FIX: enforce a maximum of 5 encoding layers\n    encodings = [e.strip().lower() for e in response.headers.get('Content-Encoding', '').split(',') if e]\n    if len(encodings) > 5:\n        raise DecodingError(\"Too many Content-Encoding layers\")\n    body = response.body\n    for enc in encodings:\n        if enc == 'gzip':\n            body = zapros.decoders.gzip_decode(body)\n        elif enc == 'deflate':\n            body = zapros.decoders.deflate_decode(body)\n        elif enc == 'br':\n            body = zapros.decoders.brotli_decode(body)\n    return body\n","payload_needed":true,"payload":null,"payload_status":"model_refused","published_fix":[{"repository":"kap-sh\/zapros","commit_url":"https:\/\/github.com\/kap-sh\/zapros\/commit\/7971fbca9707eb01455ca2d73416ac091f96908b","commit_subject":"fix(security): limit Content-Encoding layers to 5","units":[{"file":"src\/zapros\/_models.py","function":null},{"file":"src\/zapros\/_models.py","function":"Response._get_content_decoder"}]}],"references":null}