Allocation of Resources Without Limits or Throttlinghttpx is a The next generation HTTP client.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the _get_content_decoder method of Response and the MultiDecoder class in httpx/_decoders.py. An attacker can exhaust client CPU and memory by returning a response whose Content-Encoding header lists a large number of comma-separated codings, since each recognized token causes a new decompressor object to be allocated with no upper bound on the total count, and every allocated decoder then runs once per chunk during decoding. This compounds with the separate per-layer decompression amplification in the same decoder chain, since each additional coding both adds an object and a further potential expansion factor.
How to fix Allocation of Resources Without Limits or Throttling? A fix was pushed into the master branch but not yet published.
| |
Data Amplificationhttpx is a The next generation HTTP client.
Affected versions of this package are vulnerable to Data Amplification in the GZipDecoder, DeflateDecoder, BrotliDecoder, ZStandardDecoder, and MultiDecoder classes in httpx/_decoders.py. An attacker can exhaust client memory by returning a response with one or more Content-Encoding values (optionally stacked, since there is no limit on the number of chained encodings) whose body decompresses to many times its size, since each decoder fully decompresses a network read in a single call before the result is ever split into bounded chunks. This affects both streaming and non-streaming use, since Response.iter_bytes()'s chunk_size parameter only splits the output after decompression has already completed in memory.
How to fix Data Amplification? A fix was pushed into the master branch but not yet published.
| |