🇰🇷 한글 설명
urllib3 라이브러리의 스트리밍 API 사용 시 HTTP 리다이렉트 응답에 대해 불필요하게 전체 본문을 압축 해제하는 취약점이 발견되었습니다. 이로 인해 압축 폭탄(Decompression Bomb) 공격을 받을 경우 클라이언트의 자원이 과도하게 소비될 수 있습니다. urllib3 1.22 버전부터 2.6.3 미만 버전이 이 문제에 영향을 받습니다.
💡 쉬운 설명
악의적인 서버가 아주 작은 크기로 압축된 거대한 데이터를 보내면, 프로그램이 이를 해제하려다 메모리나 CPU를 모두 써버려 멈추게 만드는 공격입니다. 리다이렉트 과정에서 자동으로 압축을 풀어버리는 허점을 이용한 것입니다.
🇺🇸 원문 (English)
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 버전 1.22 이상 2.6.3 미만
⚔️ 공격 벡터
신뢰할 수 없는 서버가 압축 폭탄을 포함한 HTTP 리다이렉트 응답을 전송하여 클라이언트의 자원을 고갈시킴
🛡️ 대응 방법
urllib3를 v2.6.3 이상으로 업그레이드하거나, 신뢰할 수 없는 소스에 대해 redirect=False 설정을 적용함
🔧 검증 코드
출력된 버전이 2.6.3 미만(예: 1.26.x 또는 2.0.x 등)이면 취약한 상태입니다.
pip show urllib3 | grep Version