🔍 CVE-2021-21295

5.9
CVSS Score
MEDIUM
2021-03-09
2026-10-08 22:17
✅ 완료

🇰🇷 한글 설명

Netty의 io.netty:netty-codec-http2 라이브러리 4.1.60.Final 이전 버전에서 HTTP 요청 스머글링 취약점이 발견되었습니다. HTTP/2 요청의 Content-Length 헤더가 적절히 검증되지 않아, HTTP/1.1로 변환되어 프록시를 거칠 때 공격자가 요청을 숨겨 보낼 수 있습니다.

💡 쉬운 설명

인터넷 통신 규격이 바뀌는 과정에서 데이터의 길이를 제대로 확인하지 못해 발생하는 문제입니다. 이를 통해 공격자는 정상적인 요청 사이에 몰래 다른 명령을 끼워 넣어 서버를 속일 수 있습니다.

🇺🇸 원문 (English)

Netty is an open-source, asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients. In Netty (io.netty:netty-codec-http2) before version 4.1.60.Final there is a vulnerability that enables request smuggling. If a Content-Length header is present in the original HTTP/2 request, the field is not validated by `Http2MultiplexHandler` as it is propagated up. This is fine as long as the request is not proxied through as HTTP/1.1. If the request comes in as an HTTP/2 stream, gets converted into the HTTP/1.1 domain objects (`HttpRequest`, `HttpContent`, etc.) via `Http2StreamFrameToHttpObjectCodec `and then sent up to the child channel's pipeline and proxied through a remote peer as HTTP/1.1 this may result in request smuggling. In a proxy case, users may assume the content-length is validated somehow, which is not the case. If the request is forwarded to a backend channel that is a HTTP/1.1 connection, the Content-Length now has meaning and needs to be checked. An attacker can smuggle requests inside the body as it gets downgraded from HTTP/2 to HTTP/1.1. For an example attack refer to the linked GitHub Advisory. Users are only affected if all of this is true: `HTTP2MultiplexCodec` or `Http2FrameCodec` is used, `Http2StreamFrameToHttpObjectCodec` is used to convert to HTTP/1.1 objects, and these HTTP/1.1 objects are forwarded to another remote peer. This has been patched in 4.1.60.Final As a workaround, the user can do the validation by themselves by implementing a custom `ChannelInboundHandler` that is put in the `ChannelPipeline` behind `Http2StreamFrameToHttpObjectCodec`.

📍 영향받는 시스템

Netty (io.netty:netty-codec-http2) version < 4.1.60.Final

⚔️ 공격 벡터

HTTP/2 요청을 HTTP/1.1로 변환하여 프록시 서버를 통해 전달할 때 Content-Length 헤더를 조작하여 요청을 삽입함

🛡️ 대응 방법

Netty 라이브러리를 4.1.60.Final 이상의 버전으로 업데이트하거나, 커스텀 ChannelInboundHandler를 구현하여 직접 검증 로직을 추가함

🔧 검증 코드

출력된 결과에서 netty-codec-http2의 버전이 4.1.60.Final 미만인지 확인합니다.

Shell / Script
mvn dependency:tree | grep -E 'netty-codec-http2:[0-9]+\.[0-9]+\.[0-9]+'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N

💻 영향받는 소프트웨어

Git