GHSA-5vjj-2r48-q622: Pip/zapros vulnerability

Published Sep 23, 2026
·
Updated

Impact

Who is impacted: - Any application using Zapros to make HTTP requests to untrusted servers - Applications that follow redirects to attacker-controlled hosts

Attack vector: - A malicious HTTP server returns a response with many chained content encodings. When the client attempts to decode, it creates a deeply nested decompression chain consuming excessive resources.

Patches

Fixed in version 0.14.0.

The fix adds a hardcoded limit of 5 Content-Encoding layers. Responses exceeding this limit raise DecodingError.

Workarounds

Add middleware that checks for a malicious Content-Encoding header.

python from typing import cast

from zapros import ( AsyncBaseHandler, AsyncBaseMiddleware, BaseHandler, BaseMiddleware, Client, DecodingError, Request, Response, )

MAXDECODELAYERS = 5

class ContentEncodingCheckMiddleware(BaseMiddleware, AsyncBaseMiddleware): def init( self, nexthandler: BaseHandler | AsyncBaseHandler, , maxlayers: int = MAXDECODELAYERS, ) -> None: self.next = cast(BaseHandler, nexthandler) self.asyncnext = cast(AsyncBaseHandler, nexthandler) self.maxlayers = maxlayers

def check(self, response: Response) -> None: encodingheader = response.headers.get("Content-Encoding") if not encodingheader: return

layers = [enc.strip().lower() for enc in encodingheader.split(",") if enc.strip()] if len(layers) > self.maxlayers: raise DecodingError(f"Too many Content-Encoding layers ({len(layers)}), maximum is {self.maxlayers}")

def handle(self, request: Request) -> Response: response = self.next.handle(request) self.check(response) return response

async def ahandle(self, request: Request) -> Response: response = await self.asyncnext.ahandle(request) self.check(response) return response

with Client().wrapwithmiddleware(lambda next: ContentEncodingCheckMiddleware(next)) as client: ...

Affected Software

1 affected componentFixes available
pip/zapros<0.14.0
0.14.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/zapros to a version that resolves this vulnerability.

    Fixed in 0.14.0
  2. Upgrade

    Upgrade Zapros to a version that resolves this vulnerability.

    Fixed in 0.14.0
  3. Compensating control

    Add ContentEncodingCheckMiddleware to HTTP clients to inspect the Content-Encoding response header and reject responses with more than 5 encoding layers by raising DecodingError.

Event History

Sep 23, 2026
Advisory Published
via GitHub·01:58 PM
Data Sourced
via GitHub·01:58 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Applications using Zapros to make HTTP requests to untrusted servers are impacted. Applications that follow redirects to attacker-controlled hosts are also exposed.

2

What must an attacker do to trigger the resource exhaustion?

An attacker needs to operate or control a server that returns an HTTP response with many chained Content-Encoding values. When Zapros decodes that response, the deeply nested decompression chain can consume excessive resources.

3

What version contains the fix, and how does it behave?

Zapros 0.14.0 fixes the issue by enforcing a hardcoded maximum of five Content-Encoding layers. A response exceeding that limit raises DecodingError.

4

What can be done if upgrading is not immediately possible?

Add middleware that inspects the Content-Encoding header and rejects responses with more than five encoding layers. The provided workaround uses a maximum of five layers to match the patched behavior.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203