VDB
Sign up
MEDIUM

GHSA-8v8h-hg4w-mvq2

hpack: Unbounded variable integer decoding can cause run-away computation on malformed input

Quick fix

GHSA-8v8h-hg4w-mvq2 — hpack: upgrade to the fixed version with the command below.

pip install --upgrade 'hpack>=4.2.0'

Details

### Impact

Users of the python-hyper/hpack library, most commonly used as downstream dependency of the python-hyper/h2 library (an HTTP/2 client and server implementation). Unbounded variable integer decoding can cause run-away computation on malformed input leading to O(n^2) runtime, effectively blocking further processing with large enough unsanitized input.

### Patches A fix is available in python-hyper/hpack v4.2.0 to restricted variable integer decoding to uint32 to prevent run-away computation.

### Workarounds Sanitize input to hpack decoder for long sequences of `0xFF` values to prevent malicious use.

Are you affected?

Enter the version of the package you're using.

Affected packages

PyPI/hpack
Introduced in: 0Fixed in: 4.2.0
Fixpip install --upgrade 'hpack>=4.2.0'

References