🇰🇷 한글 설명
libgit2 라이브러리의 smart_pkt.c 파일 내 set_data 함수에서 버퍼 크기를 검증하지 않아 발생하는 취약점입니다. 악의적인 Git 서버가 조작된 패킷을 보내면 힙 영역의 경계를 벗어난 메모리 접근이 발생하여 클라이언트 프로그램이 충돌할 수 있습니다.
💡 쉬운 설명
나쁜 마음을 먹은 서버가 특수한 데이터를 보내면, Git을 사용하는 프로그램이 갑자기 꺼져버릴 수 있는 문제입니다. 서버가 보내는 데이터의 길이를 제대로 확인하지 않아서 발생하는 오류입니다.
🇺🇸 원문 (English)
libgit2 is a portable C implementation of the Git core methods provided as a linkable library with a solid API, allowing to build Git functionality into your application. Prior to 1.8.6 and 1.9.5, libgit2 performs a fixed-size strncmp in set_data in src/libgit2/transports/smart_pkt.c without first verifying that the smart-protocol pkt-line capability buffer contains 14 bytes. A malicious Git server can make bytes after the pkt-line complete object-format=, causing format_str to advance beyond the pkt-line and the following memchr length calculation to underflow. The resulting heap out-of-bounds walk can crash a client during the first refs-advertisement packet over HTTP, HTTPS, SSH, or the Git protocol. This issue is fixed in versions 1.8.6 and 1.9.5.
📍 영향받는 시스템
libgit2 1.8.6 미만 및 1.9.5 미만 버전
⚔️ 공격 벡터
악의적인 Git 서버를 통한 조작된 smart-protocol pkt-line 패킷 전송
🛡️ 대응 방법
libgit2를 1.8.6 또는 1.9.5 이상의 최신 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 1.8.6 또는 1.9.5보다 낮은지 확인하십시오.
pkg-config --modversion libgit2 2>/dev/null || dpkg -l | grep libgit2