🇰🇷 한글 설명
Python용 HTTP 클라이언트인 HTTPX2의 2.11.0 미만 버전에서 multipart/form-data 헤더 생성 시 입력값 검증이 누락되는 취약점이 발견되었습니다. 공격자가 제어 가능한 content_type이나 커스텀 헤더에 CR/LF 문자를 삽입할 경우, 헤더를 조작하거나 파싱 로직을 우회하여 데이터의 의미를 변조할 수 있습니다.
💡 쉬운 설명
웹사이트에 파일을 업로드할 때 파일 정보에 특수 문자를 섞어 보내면, 서버가 파일 정보를 잘못 읽게 만드는 보안 약점입니다. 이를 통해 공격자는 파일의 종류를 속이거나 보안 검사를 통과할 수 있습니다.
🇺🇸 원문 (English)
HTTPX2 is a next generation HTTP client for Python. Prior to 2.11.0, FileField.render_headers() in src/httpx2/httpx2/_multipart.py directly interpolates attacker-controlled content_type values and custom headers from the files= three-element (filename, content, content_type) tuple and the files= four-element (filename, content, content_type, headers) tuple into multipart/form-data part headers without validating header names or values. CR or LF characters can terminate a part header, inject additional part headers, or end the part header block early, allowing a downstream multipart parser to treat attacker-supplied lines as genuine headers and potentially alter part semantics or bypass header-based checks. This issue is fixed in version 2.11.0.
📍 영향받는 시스템
HTTPX2 versions prior to 2.11.0
⚔️ 공격 벡터
multipart/form-data 요청 시 파일 헤더 필드에 CR/LF(줄바꿈) 문자를 삽입하여 헤더 주입 공격 수행
🛡️ 대응 방법
HTTPX2 라이브러리를 2.11.0 버전 이상으로 업데이트
🔧 검증 코드
출력된 Version 값이 2.11.0 미만이면 취약한 상태이며, 2.11.0 이상이면 안전합니다.
pip show httpx2 2>/dev/null | grep -E 'Version'