🇰🇷 한글 설명
Apache bRPC의 MySQL 클라이언트 응답 파서에서 서버가 페이로드 길이가 0인 응답 패킷을 보낼 경우 Null 포인터를 역참조하는 취약점이 발견되었습니다. 이로 인해 클라이언트 프로세스가 충돌하며 서비스 거부(DoS) 상태가 될 수 있습니다.
💡 쉬운 설명
악의적인 서버가 비정상적으로 짧은 데이터를 보내면, 이를 처리하려던 프로그램이 길을 잃고 갑자기 꺼져버리는 문제입니다. 이로 인해 클라이언트 프로그램이 정상적으로 작동하지 않을 수 있습니다.
🇺🇸 원문 (English)
The MySQL client response parser in Apache bRPC dereferences a null pointer when the server peer sends a zero-payload-length response packet. A response packet whose declared payload length is zero is accepted by the frame-length check (is_full_package), after which the parser reads the response type byte via an unbounded 5-byte fetch that returns nullptr, and type = p[4] dereferences it, crashing the client process.
Root Cause: In brpc::policy::MysqlReply::ConsumePartialIOBuf, buf.fetch(header, 5) returns nullptr when the buffered data only holds the 4-byte header of a zero-length packet, then the code reads p[4] (and, in the fast-auth path, p2[4]) without checking for a null or zero-length packet.
Affected Scenarios: A brpc MySQL client connecting to a malicious or compromised MySQL server (or a MITM) can be crashed by a zero-length server response packet, resulting in denial of service of the client.
Fix: The fix rejects zero-length response packets (returning PARSE_ERROR_ABSOLUTELY_WRONG) both for the initial response type determination and after a fast-auth marker, before reading the type byte. Upgrade to the Apache bRPC version 1.18.0 or apply the PR patch at https://github.com/apache/brpc/pull/3536.
📍 영향받는 시스템
Apache bRPC 1.18.0 미만 버전의 MySQL 클라이언트를 사용하는 시스템
⚔️ 공격 벡터
악의적인 또는 탈취된 MySQL 서버가 페이로드 길이가 0인 응답 패킷을 클라이언트에 전송
🛡️ 대응 방법
Apache bRPC를 1.18.0 버전 이상으로 업그레이드하거나 제공된 PR 패치를 적용
🔧 검증 코드
설치된 Apache bRPC의 버전을 확인하여 1.18.0 미만인지 확인하십시오.
brpc_version_check() { echo "Please check your brpc version manually"; }