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 `preload_content=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 `preload_content=False`. If upgrading is not immediately possible, disable redirects by setting `redirect=False` for requests to untrusted source.
urllib3 versions 1.22 through 2.6.2 fail to properly limit decompression of HTTP redirect responses, allowing attackers to trigger decompression bombs that consume excessive memory. This vulnerability affects applications using urllib3's streaming API when processing redirected responses with compression headers.
تحتوي urllib3 على ثغرة في معالجة استجابات إعادة التوجيه المضغوطة حيث يتم فك ضغط محتوى الاستجابة بالكامل دون احترام حدود القراءة المكونة. يمكن للمهاجمين استغلال هذا لإرسال ملفات مضغوطة بشكل خاص تتوسع إلى أحجام ضخمة عند فك ضغطها، مما يسبب استنزاف الذاكرة.
urllib3 في الإصدارات 1.22 إلى 2.6.2 لا تحد بشكل صحيح من فك ضغط استجابات إعادة التوجيه HTTP، مما يسمح للمهاجمين بتشغيل قنابل فك الضغط التي تستهلك ذاكرة مفرطة. تؤثر هذه الثغرة على التطبيقات التي تستخدم واجهة البث في urllib3 عند معالجة الاستجابات المعاد توجيهها مع رؤوس الضغط.
Upgrade urllib3 to version 2.6.3 or later immediately. For organizations unable to upgrade immediately, implement network-level protections to limit response sizes and monitor for unusual memory consumption patterns in applications using urllib3.
قم بترقية urllib3 إلى الإصدار 2.6.3 أو أحدث على الفور. بالنسبة للمنظمات غير القادرة على الترقية فوراً، قم بتنفيذ حماية على مستوى الشبكة لتحديد أحجام الاستجابة ومراقبة أنماط استهلاك الذاكرة غير العادية في التطبيقات التي تستخدم urllib3.