🇰🇷 한글 설명
Python-Multipart 0.0.31 이전 버전의 parse_form() 함수는 Content-Length 헤더를 검증하지 않아 발생하는 취약점이 있습니다. 공격자가 Content-Length를 음수로 설정할 경우, 요청 본문을 고정된 크기로 나누어 읽지 않고 EOF까지 한꺼번에 메모리에 로드하여 시스템 자원을 고갈시킬 수 있습니다.
💡 쉬운 설명
데이터를 조금씩 나누어 읽어야 하는데, 조작된 값을 이용해 한꺼번에 너무 많은 데이터를 메모리에 올리게 만드는 공격입니다. 이로 인해 서버의 메모리가 가득 차서 서비스가 멈출 수 있습니다.
🇺🇸 원문 (English)
Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.
📍 영향받는 시스템
Python-Multipart 버전 0.0.31 미만
⚔️ 공격 벡터
HTTP 요청의 Content-Length 헤더를 음수 값으로 조작하여 전송
🛡️ 대응 방법
Python-Multipart 라이브러리를 0.0.31 버전 이상으로 업데이트
🔧 검증 코드
출력된 Version이 0.0.31보다 낮으면 취약한 상태이며, 0.0.31 이상이면 안전합니다.
pip show python-multipart | grep Version