🇰🇷 한글 설명
libxml2의 xmlSnprintfElementContent 함수에서 버퍼 크기를 검증하지 않고 문자를 추가하여 스택 기반 버퍼 오버플로우가 발생합니다. 이로 인해 PHP 등 libxml2를 사용하는 프로그램이 크래시될 수 있습니다.
💡 쉬운 설명
XML 파일을 처리하는 라이브러리의 메모리 오류로 인해 특정 조건에서 프로그램이 강제 종료됩니다. 공격자가 조작된 XML 파일을 제공하면 대상 서버를 다운시킬 수 있습니다.
🇺🇸 원문 (English)
libxml2 20904-GITv2.9.4-16-g0741801 is vulnerable to a stack-based buffer overflow. The function xmlSnprintfElementContent in valid.c is supposed to recursively dump the element content definition into a char buffer 'buf' of size 'size'. At the end of the routine, the function may strcat two more characters without checking whether the current strlen(buf) + 2 < size. This vulnerability causes programs that use libxml2, such as PHP, to crash.
📍 영향받는 시스템
libxml2 v2.9.4 이하 (특히 GITv2.9.4-16-g0741801), PHP 및 libxml2 의존 애플리케이션
⚔️ 공격 벡터
특정 XML 엘리먼트 정의를 포함한 악의적 XML 파일 전송으로 버퍼 오버플로우 트리거
🛡️ 대응 방법
libxml2를 v2.9.5 이상으로 업그레이드 (v2.9.4-17-g0741801 이후 버전)
🔧 검증 코드
출력된 버전이 2.9.4 이하면 취약함. 2.9.5 이상이면 안전
xmllint --version 2>/dev/null | grep -oP 'libxml2 \K[0-9.]+'