iOS 26曝麦克风权限绕过漏洞:用户拒绝授权后应用仍可录音
来源标题:A Microphone Permission Bypass on iOS 26 (CVE-2026-65339)
iOS 26存在麦克风权限绕过漏洞(CVE-2026-65339):沙盒应用在用户点击“不允许”后仍能录音,且权限状态保持为已拒绝、不显示橙色指示器。录音启动后可延续至应用进入后台及设备锁定状态。该漏洞已由演示程序验证。
以下正文由 AI 翻译自 Hacker News 最新(原文版权归原站所有),可能存在偏差,重要内容请以原文为准。
一个未添加任何 entitlement 的沙盒 iOS 应用会弹出麦克风授权提示。用户点击“不允许”,应用却照样录音,而它的权限状态仍显示为拒绝,也不会出现橙色指示器。一旦开始,录音在应用进入后台和设备锁屏后依然持续。
launch prompt capturing or step through it yourself 13:15dbg.reRemoteIO DemoMicrophone enforcement probeRecording without permissionTap Record, then choose Don't Allow.The user chose Don't Allow when prompted.Microphone permission: not askedMicrophone permission: deniedWaiting to startLive microphone inputRecordStop captureWhat the app can seeTCC decisiondeniedToken installedaudiomxdSetProperty(2009)noErrSamples receivednon-silentnothing yet“RemoteIO Mic Demo” WouldLike to Access the MicrophoneThis proof-of-concept validates whetherRemoteIO enforces microphoneauthorization.Don't AllowAllowThe user refuses.This is the real system prompt.The refusal is recorded correctly.AVAudioApplication.shared.recordPermissionreturns denied for the whole run.Capture starts anyway.The meter is fed from the render callback,which receives non-silent samples. Withaudiomxd's token installed, the daemonmatched itself and never asked TCC.And nothing lights up.The orange microphone indicator would sitinside the Dynamic Island, where the dashedring is. It never appeared there, nor inControl Center.
这个绕过只需要一次 AudioUnitSetProperty 调用,携带音频 daemon 自己的 audit token——内核会应请求把这个 token 交给应用。一旦被告知“我是 audiomxd”,audiomxd 便认定该客户端就是自己,于是把真实的麦克风采样发给它。
已在 iPadOS 27.0 beta 24A5390f 和 iOS 26.6 23G71 上复现。已在 iOS 和 iPadOS 26.6.1、macOS Tahoe 26.6.2 及下文列出的后续版本中修复。Apple 表示,另一位研究者最先报告了该问题。8 月 17 日的安全公告最初只致谢 Meta Red Team X 的 Nik Tsytsarkin,Apple 于 9 月 14 日将我的名字补充进去。
应用的 RemoteIO unit 是一个客户端侧代理。真正的客户端对象位于音频 daemon 中,Apple 的日志字符串称之为 audiomxd。控制指令通过 MIG 传递,采集到的采样则通过共享内存送达应用。
同意决定就是这个对象里的一个字节:
在我测试的两个构建上,这个字节就足以拿到真实采样。我没有审计其他同意检查。
当应用发送 Mach 消息时,内核会把发送者的 audit_token_t 写入消息尾部,发送者无法修改该字段。1 按照惯例,val[5] 是 PID,val[7] 是 pidversion,exec 和 posix_spawn 会使后者递增,因此这一对值标识一次进程执行。2 daemon 通过 audit_token_to_pid 和 audit_token_to_pidversion 读取它们。iOS 应用没有这些访问器,因此直接读取这几个字。
AURemoteIO 还接受一个未写入文档的属性,ID 为 2009,其数据就是一个 audit_token_t。SDK 记录了 output-unit 属性 2000 到 2016,却跳过了 2008 和 2009。3 对于 2009,daemon 只解组恰好 32 字节,载荷更短会被拒绝。
这类属性有正当用途。一个进程为另一个进程配置音频时,必须指明适用谁的同意决定。但前提是调用者有权代表他人,而这项检查缺失了。
_AUIOServer_SetProperty 只使用经过认证的 MIG 发送者 token 来查找调用者自己的客户端,因此一个应用无法重新配置另一个应用的 unit。而对于 2009,它随后会把调用者提供的 32 字节覆盖到该客户端存储的 token 上,并重新计算 canRecord。4
1 2 3 4 5 6 7 8 9 10 11 12 13 // _AUIOServer_SetProperty at 0x1bc35f650 // v35 is a copy of a2, the trailer audit token. a5 is the property ID v17 = (*(__int64 (__fastcall **)(__int64, AQMESession , __int64))((_QWORD *)v13 + 8LL))(v13, &v35, a3); if ( !v17 ) // the sender token's only use ... // fails with -50 ... if ( (_DWORD)a5 != 2009 ) // 0x1bc35f974 goto LABEL_54; v24 = *(_OWORD **)(v37 + 40); // unmarshalled property data v25 = v24[1]; *(_OWORD *)(v17 + 96) = *v24; // 32 caller bytes *(_OWORD *)(v17 + 112) = v25; AQIONodeClient::SetCanRecord(v17 + 56);
查找函数 RemoteIOServer::ClientFromToken 只把调用者的 PID 与客户端创建时存储的 PID 做比较。SetCanRecord 读取客户端 + 96 处的 token,而属性 2009 正好覆盖这些字节。
同一个进程,一个对象,两种身份Fields of RemoteIOClient, the daemon's per-client object, in build 23G71.DAEMON FUNCTIONRemoteIOServer::ClientFromToken()Compares this field with the caller's authenticatedPID. It decides whose client you may touch, nothing else.CALL THE APP MAKESAudioUnitSetProperty(unit, 2009, ...)AudioUnitSetProperty(unit, 2009, ...)Its 32 bytes land here unchecked, so the appcan store the daemon's own token.An ordinary client never calls it, so the field keepsits own process's token.+0other fields+24pid+76canRecord = 1canRecord = 0+96audit token = audiomxdaudit token = this appreadswritesDAEMON FUNCTIONAQIONodeClient::SetCanRecord()Compares the PID and pidversion inside +96 with the daemon's own audit token.They match, so it sets canRecord without asking TCC.No match, so it goes on to ask TCC about whichever process +96 names.+24 holds the caller's real identity and decides ownership. +96 decides recording, and the caller can overwrite it.
没有任何 entitlement 会限制这次写入。它只需要 scope 1,即 kAudioUnitScope_Input,概念验证代码正是这样传的。
AQIONodeClient::SetCanRecord 从内核获取 daemon 自己的 audit token,并把它的 PID 和 pidversion 与存储的 token 做比较。不匹配时,它向 TCC 查询存储 token 所指的那个进程,或者在 Launch Services 未就绪时直接拒绝。匹配时,它跳过 TCC,从 AQIONode.cpp:341 打印下面这行日志,并设置 canRecord。
1 %25s:%-5d Recording implicitly allowed for AQIONodeClient %p hosted in audiomxd with no client audit token.
日志调用位于 0x1bc36efe8,canRecord 存储在 0x1bc36ed00。拒绝逻辑本身未被触动,这就是权限状态仍显示为拒绝的原因。
(原文较长,此处译出前 6000 字,完整内容请点「打开原文」。)
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。