🇰🇷 한글 설명
Apache bRPC의 RTMP 프로토콜 구현에서 발생하는 Use-after-free 취약점입니다. 악의적인 RTMP 피어가 조작된 Abort 메시지를 보내면 프로세스가 충돌하거나 메모리가 손상될 수 있습니다.
💡 쉬운 설명
데이터를 주고받는 통로가 사용 중인데 갑자기 통로를 삭제해버려 발생하는 오류입니다. 공격자가 이 점을 이용해 프로그램을 강제로 종료시키거나 시스템을 망가뜨릴 수 있습니다.
🇺🇸 원문 (English)
Use-after-free in the RTMP protocol implementation in Apache bRPC (version < 1.18.0) on all platforms allows a malicious RTMP peer to crash the process or potentially corrupt memory via a crafted Abort message.
Root Cause:
When processing an RTMP Abort (protocol control message type 2), the RTMP policy implementation deleted the target RtmpChunkStream object. The send path (RtmpUnsentMessage::AppendAndDestroySelf -> RtmpChunkStream::SerializeMessage) runs concurrently on sender threads and dereferences the same RtmpChunkStream object without synchronization. If a remote peer sends an Abort message naming a chunk stream that is concurrently being used to serialize an outgoing message, the stream object is freed while still in use, resulting in a use-after-free. Additionally, deleting the chunk stream discarded its previous message header, so subsequent compressed (type-3) chunk headers on that stream could no longer be decoded.
Affected Scenarios:
Any application using the bRPC RTMP protocol implementation (rtmp policy), either as an RTMP server or as an RTMP client, where the remote endpoint is untrusted. The attacker needs to send an Abort message targeting a chunk stream id that is concurrently used for sending, which can crash the process or lead to memory corruption.
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/3515
📍 영향받는 시스템
Apache bRPC version < 1.18.0 (RTMP protocol implementation 사용 시)
⚔️ 공격 벡터
조작된 RTMP Abort 메시지를 전송하여 사용 중인 ChunkStream 객체를 해제 유도
🛡️ 대응 방법
bRPC를 1.18.0 버전 이상으로 업그레이드하거나 제공된 패치 적용
🔧 검증 코드
출력된 버전이 1.18.0 미만인 경우 해당 취약점에 노출된 상태입니다.
brpc_version_cmd --version 2>/dev/null | grep -E '1\.[0-9]+(\.[0-9]+)?'