🇰🇷 한글 설명
Pillow 라이브러리의 Image.quantize() 함수가 빈 팔레트를 사용할 때 초기화되지 않은 스택 메모리를 노출할 수 있는 취약점입니다. 공격자가 팔레트 이미지를 제어할 경우, 반환되는 PNG 또는 GIF 파일에 스택 내의 주소나 스택 카나리 데이터가 포함될 수 있습니다. 이 문제는 버전 13.0.0에서 수정되었습니다.
💡 쉬운 설명
이미지 처리 라이브러리에서 메모리의 빈 공간을 제대로 지우지 않아, 컴퓨터 내부의 중요한 정보가 이미지 파일에 섞여 나갈 수 있는 문제입니다. 해커는 이 정보를 이용해 시스템의 보안 체계를 파악할 수 있습니다.
🇺🇸 원문 (English)
Pillow is a Python imaging library. From 9.1.0 until 13.0.0, Pillow can disclose uninitialized stack memory when Image.quantize() uses an empty palette. ImagingPaletteCacheUpdate() leaves a local cache array uninitialized when the palette has zero entries, and the conversion path emits those bytes as output pixel indices. An attacker who controls the palette image can obtain stack contents from a returned PNG or GIF. This can disclose addresses and stack-canary data without an out-of-bounds access, memory corruption, or process crash. This issue is fixed in version 13.0.0.
📍 영향받는 시스템
Pillow 9.1.0 ~ 13.0.0
⚔️ 공격 벡터
조작된 팔레트 이미지를 사용하여 Image.quantize()를 호출함으로써 메모리 데이터를 추출
🛡️ 대응 방법
Pillow 라이브러리를 13.0.0 이상의 최신 버전으로 업데이트
🔧 검증 코드
출력된 버전이 9.1.0 미만이거나 13.0.0 이상인지 확인하여 취약 여부 판단
pip show Pillow | grep Version