🇰🇷 한글 설명
urllib3 라이브러리가 POST와 같은 요청 본문이 있는 메서드에서 301, 302, 303 리다이렉트 응답을 받을 때, HTTP RFC 규격에 따라 요청 본문을 제거하지 않고 그대로 전달하는 취약점이 발견되었습니다. 이로 인해 신뢰하던 서비스가 탈취될 경우 민감한 데이터가 리다이렉트된 대상 서버로 유출될 수 있습니다.
💡 쉬운 설명
데이터를 담아 보내는 요청이 다른 주소로 자동 연결될 때, 원래 담겨있던 중요한 정보가 새 주소로 그대로 전달되는 문제입니다. 공격자가 중간에 연결 주소를 가로채면 사용자의 비밀번호나 개인정보를 훔쳐갈 수 있습니다.
🇺🇸 원문 (English)
urllib3 is a user-friendly HTTP client library for Python. urllib3 previously wouldn't remove the HTTP request body when an HTTP redirect response using status 301, 302, or 303 after the request had its method changed from one that could accept a request body (like `POST`) to `GET` as is required by HTTP RFCs. Although this behavior is not specified in the section for redirects, it can be inferred by piecing together information from different sections and we have observed the behavior in other major HTTP client implementations like curl and web browsers. Because the vulnerability requires a previously trusted service to become compromised in order to have an impact on confidentiality we believe the exploitability of this vulnerability is low. Additionally, many users aren't putting sensitive data in HTTP request bodies, if this is the case then this vulnerability isn't exploitable. Both of the following conditions must be true to be affected by this vulnerability: 1. Using urllib3 and submitting sensitive information in the HTTP request body (such as form data or JSON) and 2. The origin service is compromised and starts redirecting using 301, 302, or 303 to a malicious peer or the redirected-to service becomes compromised. This issue has been addressed in versions 1.26.18 and 2.0.7 and users are advised to update to resolve this issue. Users unable to update should disable redirects for services that aren't expecting to respond with redirects with `redirects=False` and disable automatic redirects with `redirects=False` and handle 301, 302, and 303 redirects manually by stripping the HTTP request body.
📍 영향받는 시스템
urllib3 1.26.18 미만 및 2.0.7 미만 버전
⚔️ 공격 벡터
신뢰된 서비스가 공격자에 의해 탈취되어 민감한 데이터가 포함된 POST 요청을 악성 사이트로 리다이렉트함
🛡️ 대응 방법
urllib3를 1.26.18 또는 2.0.7 이상의 버전으로 업데이트하거나, 리다이렉트를 수동으로 처리하도록 설정 변경
🔧 검증 코드
출력된 버전이 1.26.18 또는 2.0.7보다 낮은지 확인하여 취약 여부를 판단합니다.
python3 -c 'import urllib3; print(urllib3.__version__)'