🇰🇷 한글 설명
Http4s의 공유 WebSocket 디코더에서 메시지 버퍼링에 제한이 없어 발생하는 메모리 고갈 취약점입니다. 공격자가 거대한 프레임이나 조각난 메시지를 전송하면 서버의 메모리를 모두 소모하게 만들 수 있습니다. 이 문제는 0.23.35 및 1.0.0-M47 버전에서 수정되었습니다.
💡 쉬운 설명
웹소켓을 통해 너무 큰 데이터를 한꺼번에 보내 서버의 메모리를 가득 채워 서버를 멈추게 만드는 공격입니다. 마치 작은 컵에 계속 물을 부어 넘치게 만들어 그릇을 망가뜨리는 것과 같습니다.
🇺🇸 원문 (English)
Http4s is a Scala interface for HTTP services. Prior to 0.23.35 and 1.0.0-M47, The shared WebSocket decoder permits unbounded message buffering because defragmentation accumulates fragments without a limit and FrameTranscoder accepts declared lengths up to Int.MaxValue. A remote client that completes a WebSocket handshake against an http4s-blaze-server or http4s-ember-server endpoint can exhaust server memory with oversized frames or fragmented messages. The patched decoder applies a configurable 64 MiB default limit to individual frames and defragmented messages through EmberServerBuilder.withMaxWebSocketMessageSize. This issue is fixed in versions 0.23.35 and 1.0.0-M47.
📍 영향받는 시스템
Http4s 0.23.35 미만 및 1.0.0-M47 미만 버전 (http4s-blaze-server 또는 http4s-ember-server 사용 시)
⚔️ 공격 벡터
원격의 공격자가 WebSocket 핸드셰이크를 완료한 후, 매우 큰 크기의 프레임이나 조각난 메시지를 지속적으로 전송하여 메모리 고갈 유도
🛡️ 대응 방법
Http4s를 0.23.35 또는 1.0.0-M47 이상의 버전으로 업데이트하거나, EmberServerBuilder.withMaxWebSocketMessageSize를 사용하여 메시지 크기 제한 설정
🔧 검증 코드
출력된 라이브러리 버전이 0.23.35 또는 1.0.0-M47 이상인지 확인하여 취약 여부를 판단합니다.
sbt dependencyList | grep -E 'http4s-core|http4s-ember-server|http4s-blaze-server'