🔍 CVE-2025-59734

0.0
CVSS Score
UNKNOWN
2025-10-06
2026-10-19 16:10
✅ 완료

🇰🇷 한글 설명

SANM 디코딩 과정에서 subversion 2 미만 버전을 사용하는 애니메이션 파일을 처리할 때 Use-After-Free(UAF) 취약점이 발생합니다. 잘못된 프레임 크기로 인해 버퍼가 해제된 후에도 이전 메모리 참조가 유지되어 데이터 읽기 오류나 메모리 메타데이터 손상이 발생할 수 있습니다.

💡 쉬운 설명

특수하게 제작된 애니메이션 파일을 열 때, 컴퓨터가 이미 사용이 끝나서 버린 메모리 공간을 다시 사용하려고 시도하면서 오류가 발생하는 문제입니다. 이 과정에서 프로그램이 비정상적으로 종료되거나 시스템의 중요한 정보가 망가질 수 있습니다.

🇺🇸 원문 (English)

It is possible to cause an use-after-free write in SANM decoding with a carefully crafted animation using subversion <2. When a STOR chunk is present, a subsequent FOBJ chunk will be saved in ctx->stored_frame. Stored frames can later be referenced by FTCH chunks. For files using subversion < 2, the undecoded frame is stored, and decoded again when the FTCH chunks are parsed. However, in process_frame_obj if the frame has an invalid size, there’s an early return, with a value of 0.  This causes the code in decode_frame to still store the raw frame buffer into ctx->stored_frame. Leaving ctx->has_dimensions set to false. A subsequent chunk with type FTCH would call process_ftch and decode that frame obj again, adding to the top/left values and calling process_frame_obj again. Given that we never set ctx->have_dimensions before, this time we set the dimensions, calling init_buffers, which can reallocate the buffer in ctx->stored_frame, freeing the previous one. However, the GetByteContext object gb still holds a reference to the old buffer. Finally, when the code tries to decode the frame, codecs that accept a GetByteContext as a parameter will trigger a use-after-free read when using gb. GetByteContext is only used for reading bytes, so at most one could read invalid data. There are no heap allocations between the free and when the object is accessed. However, upon returning to process_ftch, the code restores the original values for top/left in stored_frame, writing 4 bytes to the freed data at offset 6, potentially corrupting the allocator’s metadata. This issue can be triggered just by probing whether a file has the sanm format. We recommend upgrading to version 8.0 or beyond.

📍 영향받는 시스템

SANM 디코딩을 지원하는 소프트웨어 (subversion < 2 사용 시)

⚔️ 공격 벡터

취약한 SANM 포맷의 애니메이션 파일이 포함된 데이터를 처리하도록 유도

🛡️ 대응 방법

해당 소프트웨어를 8.0 버전 이상으로 업그레이드

🔧 검증 코드

소프트웨어의 버전을 확인하여 8.0 미만인 경우 취약한 상태로 판단합니다.

Shell / Script
pkg-config --modversion sanm-decoder 2>/dev/null || echo 'Check software version manually'

💻 영향받는 소프트웨어

Spring Data REST