🇰🇷 한글 설명
Apache bRPC 1.18.0 미만 버전에서 스트림 메시지 재조립 경로에 메모리 누적 제한이 없는 취약점이 발견되었습니다. 공격자가 끝없는 연속 데이터 프레임을 전송하면 서버의 메모리가 고갈되어 서비스 거부(DoS) 상태에 빠질 수 있습니다.
💡 쉬운 설명
공격자가 끊임없이 조각난 데이터를 보내 서버의 메모리를 가득 채워 컴퓨터를 멈추게 만드는 공격입니다. 서버가 데이터를 모으는 과정에서 한계치를 설정하지 않아 발생하는 문제입니다.
🇺🇸 원문 (English)
Unbounded memory accumulation in the stream message reassembly path of Apache bRPC (version < 1.18.0) on all platforms allows remote attackers to exhaust the memory of a server (denial of service) by sending an endless sequence of continuation data frames.
Root Cause:
The streaming RPC protocol bounds every single data frame by max_body_size, but a fragmented stream message accumulates continuation frames into one buffer (_pending_buf) without any limit on the accumulated size. A malicious peer that can open a stream can therefore keep sending continuation frames to make the receiver accumulate an arbitrarily large in-memory message. Since the default flow-control settings (socket_max_streams_unconsumed_bytes=0) do not throttle the sending rate, the receiver's memory grows until the process runs out of memory and crashes or becomes unavailable.
Affected Scenarios:
Services that accept streams from untrusted clients (for example using brpc::StreamAccept or brpc::StreamCreate with the built-in streaming protocol) are affected.
How to Fix:
(Choose one of the following options)
1. Upgrade bRPC to version 1.18.0, which fixes this issue.
2. Apply this patch: https://github.com/apache/brpc/pull/3489
Note:
The fix limits the accumulated payload of a fragmented stream message to max_body_size (default 64MB). When the accumulated payload exceeds the limit, the pending fragments are released and the stream is closed with error EMSGSIZE. After applying the fix, legitimate fragmented stream messages larger than max_body_size will be rejected; you can adjust the gflag max_body_size to change the limit.
📍 영향받는 시스템
Apache bRPC version < 1.18.0
⚔️ 공격 벡터
신뢰할 수 없는 클라이언트가 스트림을 열고 제한 없이 연속적인 데이터 프레임을 전송함
🛡️ 대응 방법
bRPC를 1.18.0 버전으로 업그레이드하거나 제공된 패치를 적용하십시오.
🔧 검증 코드
출력된 버전이 1.18.0 미만인 경우 해당 취약점에 노출된 상태입니다.
brpc_version_cmd --version 2>/dev/null | grep -E '1\.[0-9]+\.'