Apple ImageIO 框架在解析 WebP 图像时存在一个整数溢出漏洞,导致越界内存访问。
完整漏洞分析 - 包含反汇编的详细根本原因分析。
在处理畸形 WebP 图像时,行字节计算期间发生整数溢出。溢出导致分配了过小的缓冲区,随后在图像解码期间被覆盖。
处理恶意构造的 WebP 图像可能导致在任意使用 ImageIO 的应用程序(Safari、预览、邮件、信息、快速查看等)中执行任意代码。
| 受影响 | 已修复 | |
|---|---|---|
| macOS | Monterey < 12.4 | 12.4 (2022年5月) |
| iOS / iPadOS | < 15.5 | 15.5 |
| tvOS | < 15.5 | 15.5 |
| watchOS | < 8.6 | 8.6 |
在 macOS Monterey 12.0.1 和 iOS 15.1 上测试
构建并运行测试程序:
./build_harness_standalone.sh
./harness_standalone intoverflow.webp
或者通过浏览器提供 trigger.html 触发,或直接打开文件:
open intoverflow.webp
Process: harness_standalone [12345]
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x...
Thread 0 Crashed:
0 libsystem_platform.dylib _platform_memset_pattern16 + ...
1 CoreGraphics CGSColorDataMakeCompositor + ...
2 CoreGraphics ripc_RenderImage + ...
3 CoreGraphics ripc_DrawImage + ...
4 ImageIO ...