REDHAT-BUG-2427726: High severity pypi/urllib3 vulnerability
urllib3 is an HTTP client library for Python. urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once. urllib3 can perform decoding or decompression based on the HTTP Content-Encoding header (e.g., gzip, deflate, br, or zstd). When using the streaming API, the library decompresses only the necessary bytes, enabling partial content consumption. Starting in version 1.22 and prior to version 2.6.3, for HTTP redirect responses, the library would read the entire response body to drain the connection and decompress the content unnecessarily. This decompression occurred even before any read methods were called, and configured read limits did not restrict the amount of decompressed data. As a result, there was no safeguard against decompression bombs. A malicious server could exploit this to trigger excessive resource consumption on the client. Applications and libraries are affected when they stream content from untrusted sources by setting preloadcontent=False when they do not disable redirects. Users should upgrade to at least urllib3 v2.6.3, in which the library does not decode content of redirect responses when preloadcontent=False. If upgrading is not immediately possible, disable redirects by setting redirect=False for requests to untrusted source.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
urllib3to a version that resolves this vulnerability.Fixed in 2.6.3 - Configuration
For requests to untrusted sources, ensure redirect handling does not rely on preload by keeping `preload_content=False` only for cases where you also disable redirects (otherwise decompression-bomb safeguards may be bypassed).
urllib3 preload_content = False - Configuration
If upgrading is not immediately possible, disable HTTP redirects for requests to untrusted sources by setting `redirect=False` (so the library will not process redirect responses in the vulnerable behavior range).
urllib3 redirect = False
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2427726?
The severity of REDHAT-BUG-2427726 is classified as high due to potential security implications in urllib3.
How do I fix REDHAT-BUG-2427726?
To fix REDHAT-BUG-2427726, update urllib3 to a version above 2.6.3 or ensure you are using a version from the recommended patch release.
Which versions of urllib3 are affected by REDHAT-BUG-2427726?
Versions of urllib3 from 1.22 up to 2.6.3 are affected by REDHAT-BUG-2427726.
Is REDHAT-BUG-2427726 a critical vulnerability?
REDHAT-BUG-2427726 is considered a high severity vulnerability but not classified as critical.
What are the potential risks of REDHAT-BUG-2427726?
The potential risks of REDHAT-BUG-2427726 include exposure to denial of service or data leakage due to improper handling of HTTP responses.