🇰🇷 한글 설명
libheif 1.21.2 및 이전 버전에서 HEIF 그리드 이미지를 디코딩할 때 손상된 타일이 있으면 오류 없이 처리되어 초기화되지 않은 힙 메모리가 유출되는 취약점입니다. 이로 인해 디코딩된 이미지의 픽셀 값에 이전 메모리에 남아있던 민감한 데이터가 포함될 수 있습니다.
💡 쉬운 설명
이미지 파일을 읽을 때 컴퓨터 메모리에 남아있던 비밀번호나 개인정보 같은 데이터가 이미지의 일부로 나타날 수 있는 문제입니다. 악의적으로 만든 이미지를 통해 다른 사용자의 정보를 훔쳐볼 수 있습니다.
🇺🇸 원문 (English)
libheif is a HEIF and AVIF file format decoder and encoder. In versions 1.21.2 and prior, when decoding a HEIF grid image with strict_decoding=false (the default), a corrupted tile silently fails to decode and the library returns heif_error_Ok with no indication of failure, leading to an uninitialized heap memory information leak. The canvas is allocated via create_clone_image_at_new_size() → plane.alloc() → new (std::nothrow) uint8_t[allocation_size] which does not zero the memory; only the alpha plane is explicitly initialized via fill_plane(), so the Y, Cb, and Cr planes contain whatever was previously at that heap address. The failed tile's region of the canvas is never written. It retains uninitialized heap data that is delivered to the caller as decoded pixel values (4,096 bytes per Y/Cb/Cr plane = 12,288+ bytes total). Any application using libheif to decode grid-based HEIF/AVIF files with default settings is vulnerable: a crafted .heic or .avif file causes 4,096+ bytes of heap memory to appear as pixel values in the decoded image, and the calling application receives heif_error_Ok, so it has no indication the output contains heap garbage. In server-side image processing, an uploaded crafted HEIF decoded and re-encoded (e.g., as PNG/JPEG for thumbnails, CDN, social media) can leak cross-user data such as auth tokens, database results, and other users' image data. This issue has been fixed in version 1.22.0.
📍 영향받는 시스템
libheif 1.21.2 및 그 이전 버전
⚔️ 공격 벡터
조작된 HEIF/AVIF 파일을 업로드하거나 처리하도록 유도하여 메모리 내 민감 정보를 탈취
🛡️ 대응 방법
libheif를 1.22.0 이상의 버전으로 업데이트
🔧 검증 코드
출력된 결과에서 libheif의 버전이 1.22.0 미만인지 확인합니다.
dpkg -l | grep libheif || rpm -qa | grep libheif || brew list | grep libheif
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
💻 영향받는 소프트웨어
IBM WebSphere Application Server