CVE-2026-65339 Explained: How a Forged Audit Token Broke iOS Microphone Permissions

The CyberSec Guru

CVE-2026-65339

If you like this post, then please share it:

Buy me A Coffee!

Support The CyberSec Guru’s Mission

🔐 Fuel the cybersecurity crusade by buying me a coffee! Why your support matters: Zero paywalls: Keep the main content 100% free for learners worldwide.

“Your coffee keeps the servers running and the knowledge flowing in our fight against cybercrime.”☕ Support My Work

Buy Me a Coffee Button

The permission prompt worked exactly as it should. It appeared the first time the app launched, asked about the microphone in the system’s own words, and when the user tapped Don’t Allow, the refusal was recorded faithfully: the public recording-permission API kept returning denied for the rest of the run. The app recorded anyway. On the build where Meta’s Red Team X first demonstrated this, the orange indicator iOS shows whenever an app uses the microphone never appeared, and the system logs attributed the capture to Apple’s own audio daemon instead of the app actually receiving the samples. The bug needed no memory corruption and no jailbreak. The app ran inside the ordinary iOS sandbox with no special entitlements, and it did exactly one unusual thing: it told the audio daemon it was the audio daemon, and the daemon believed it.

That bug is CVE-2026-65339. Nik Tsytsarkin of Meta Red Team X reported it to Apple on July 7, 2026, and published the full reverse-engineering writeup, “Who needs permissions and the orange dot that never lit,” on November 9. A second researcher, Mustafa Calap, independently found and reported the same flaw and published his own analysis the same day; Apple’s advisories now credit both. Apple’s security notes file it under Audio with the impact line “An app may be able to leak sensitive user information” and the description “A logic issue was addressed with improved checks.” Both sentences are true, and both undersell what the code actually did: let a sandboxed app keep recording after an explicit refusal, with the privacy indicator staying dark on the builds the researchers analyzed. The failure wasn’t in the prompt or in TCC’s record-keeping, both of which did their jobs. It was in the identity the audio daemon used to decide whether to consult TCC at all: a privileged process made an authorization decision about a subject the applicant was allowed to write.

How iOS and macOS microphone permissions are supposed to work

An iOS or macOS app never opens the microphone itself. An app that wants low-latency capture instantiates the remote I/O audio unit, the AudioToolbox unit known as AURemoteIO (kAudioUnitSubType_RemoteIO), and that unit is a client-side proxy. The real work happens in audiomxd, the system’s audio media daemon, which owns the hardware side of the graph. Control messages travel over Mach through routines generated by MIG, the Mach Interface Generator, and captured samples reach the app through shared memory. Consent lives elsewhere again, in TCC, the Transparency, Consent, and Control subsystem whose daemon, tccd, stores the user’s per-app decisions and answers queries about them. Tap Don’t Allow, and that refusal gets persisted; the microphone path is supposed to honor it for as long as the record stands.

The bridge between those two worlds is a small piece of state inside audiomxd. Each connected client has a server-side RemoteIOClient object; at offset +0x38 sits an AQIONodeClient that holds the recording-permission state, including a 32-byte copy of the client’s audit token at +0x28 and a single canRecord byte at +0x14. That byte decides everything. In Calap’s analysis of the public iOS 26.6 build, RemoteIOClient::IONodeClient::EnqueueInput zero-fills the client’s shared-memory region whenever canRecord isn’t 1, so a denied app receives silence instead of an error. The audio pipeline keeps running; the samples are simply blank.

Because the daemon records on behalf of its clients, it needs a way to ask TCC about someone else. audiomxd itself holds microphone access (the TCC service kTCCServiceMicrophone) and carries the private entitlement com.apple.private.tcc.manager.check-by-audit-token, which lets it ask tccd whether the process named by a given audit token has permission. The function that resolves all of this, AQIONodeClient::SetCanRecord(), either queries TCC with the stored client token or, on another path, uses SecTaskCreateWithAuditToken to check for the entitlement com.apple.coreaudio.CanRecordWithoutSessionActivation. It’s a reasonable design, and it’s also a delegation of authority: the daemon’s microphone access gets exercised on a client’s behalf, and the only thing tying that access to the user’s consent is the identity stored in those 32 bytes.

System-level privacy indicator for microphone access
System-level privacy indicator for microphone access

Where process identity actually comes from: Apple’s audit token system

Every authorization decision starts with a question: who is asking? On Apple’s platforms the answer is an audit_token_t, defined in the XNU headers as eight unsigned 32-bit words and explicitly documented as opaque. The layout, visible in XNU’s set_security_token_task_internal and in the deprecated libbsm accessor audit_token_to_au32, is the audit user ID, effective UID, effective GID, real UID, real GID, process ID, audit session ID, and process version, in that order. As Scott Knight traced in his anatomy of the audit token, the machinery descends from the Solaris BSM audit code Apple ported in the early 2000s for Common Criteria certification, later open-sourced as OpenBSM. A microphone decision in 2026 rests on accounting plumbing built for government audit trails.

What makes the token trustworthy is its provenance, not its contents. The kernel maintains it across fork, exec, and credential changes, and the Mach API that can set a task’s token, host_security_set_task_token, requires the host security port, which userland never holds. When a process receives a Mach message with MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT), the kernel appends a trailer carrying the sender’s token, copied from the sending task on the send path; the sender can’t edit it. XPC works the same way underneath: xpc_connection_get_audit_token returns a per-connection copy that libxpc refreshes from each incoming message’s trailer. A token read from a message body has none of that backing. It’s bytes the sender chose, and a daemon that treats those bytes as identity has confused a claim with proof.

The pidversion field exists because PIDs are recycled. A numeric PID identifies a slot, not a process; once a process exits, the next occupant of that slot inherits any trust keyed to the number alone. XNU bumps p_idversion on exec and posix_spawn, so the pair (pid, pidversion) names one execution instance, and the kernel itself relies on this: csops_audittoken fails with ESRCH unless the supplied token’s pid and version match the live process found by PID. The code-signing checks that guard XPC services use exactly this pairing to defeat PID-reuse races.

This failure mode has a long pedigree. In October 2014, Ian Beer of Google Project Zero reported that OS X’s networkd read an effective_audit_token value out of the XPC message body and used it for authorization, letting a sandboxed caller choose the identity it presented; Apple shipped the fix as CVE-2014-4492 in OS X 10.10.2 in January 2015 (Project Zero issue 121). Samuel Groß’s “Don’t Trust the PID” talk catalogued the adjacent race, where a server validates clients by PID while a process replaces its image and keeps the number. Wojciech Reguła demonstrated exactly that in an April 2020 writeup against Malwarebytes’ real-time protection daemon, which built its code-signing check from -[NSXPCConnection processIdentifier]; his exploit queued XPC requests and then re-executed into the signed Malwarebytes binary using posix_spawn with the POSIX_SPAWN_SETEXEC flag, winning the race between message delivery and validation. The fix in every case is the same advice: bind the decision to the kernel-supplied audit token.

audiomxd‘s variant is subtler than either of those. It compared the right fields, pid and pidversion, and it fetched its own identity fresh from the kernel. What it got wrong was letting the client overwrite the token those fields were read from. The comparison was rigorous; its subject was attacker-controlled.

📬 Stay Ahead of Cyber Threats

Get the latest cybersecurity news, critical vulnerabilities, threat intelligence, tutorials, and exclusive giveaways delivered straight to your inbox. No spam. Unsubscribe anytime.

The AudioUnitSetProperty flaw that let an app forge its own identity

The write primitive hides inside a public API. AudioUnitSetProperty is how apps configure audio units, and AudioUnitProperties.h documents output-unit property IDs from 2000 to 2016, with 2008 and 2009 absent from the headers. Property 2009’s payload is exactly an audit_token_t: the daemon unmarshals 32 bytes and rejects anything shorter. Calap’s writeup explains why such a property exists at all: a process configuring audio on another process’s behalf needs a way to say whose consent applies. That’s a legitimate need, and precisely the kind of operation that must be restricted to callers authorized to speak for someone else.

On the vulnerable iOS 27.0 beta 4 (build 24A5390f), the setter AUIOServer_SetProperty lives at 0x1b2816264 in AudioToolbox. Like other MIG-served routines, it receives the caller’s kernel-supplied audit token as an argument, a2 in the decompilation, taken from the message trailer. The daemon does use that authentic token, but only for ownership: it locates the caller’s own client object by comparing the trailer’s PID against the PID recorded when the client connected, so one app can’t reach into another app’s audio unit. Then the property-2009 branch runs, and it never looks at a2 again:

// AudioToolbox, AUIOServer_SetProperty (24A5390f), Hex-Rays
// a2 is the CALLER's audit token, written by the kernel into the MIG trailer.
if ( (_DWORD)a5 != 2009 ) // a5 = property id
goto LABEL_53;
v24 = *(_OWORD **)(v41 + 40); // the client's 32-byte payload
v25 = v24[1];
*(_OWORD *)(v17 + 96) = *v24; // RemoteIOClient+96
*(_OWORD *)(v17 + 112) = v25; // RemoteIOClient+112
AQIONodeClient::SetCanRecord((AQIONodeClient *)(v17 + 56));

The handler copies the client’s 32 bytes over the stored audit token at RemoteIOClient+0x60 (the AQIONodeClient‘s +0x28) and immediately calls SetCanRecord() to recompute the permission byte. There’s no entitlement check, no code-signing check, no comparison with the trailer identity. The daemon had just authenticated the caller to decide which object it may modify, then let that same caller rewrite the identity the permission decision reads. One object ends up holding two identities: the authenticated PID at +0x18 governs ownership, and the writable token at +0x60 governs recording.

Inside AQIONodeClient::SetCanRecord(): the broken self-check

AQIONodeClient::SetCanRecord(), at 0x1b2828a30 on the same build, is where the forged identity pays off. It reads the stored client token, then asks the kernel for the daemon’s own token with task_info(mach_task_self_, TASK_AUDIT_TOKEN, ...). Flavor 15 is TASK_AUDIT_TOKEN in mach/task_info.h, and the count is eight words, so the daemon’s side of the comparison is as trustworthy as identity gets: a fresh kernel query about itself.

// AudioToolbox, AQIONodeClient::SetCanRecord (24A5390f), Hex-Rays, tidied/abridged
clientToken = *(int8x16x2_t *)(this + 40); // this+0x28: written by property 2009
*(_DWORD *)count = 8; // TASK_AUDIT_TOKEN_COUNT
if ( task_info(mach_task_self_, 15, ownToken, count) != 0 ) // 15 = TASK_AUDIT_TOKEN
__break(1u);
clientPid = audit_token_to_pid(&clientToken);
clientPidVer = audit_token_to_pidversion(&clientToken);
if ( clientPid != audit_token_to_pid(&ownToken)
|| clientPidVer != audit_token_to_pidversion(&ownToken) )
{
// MISMATCH: ask TCC, with the CLIENT-SUPPLIED token as the subject
makeTCCAccessRequest(kTCCServiceMicrophone, &clientToken, &opts);
}
else
{
// MATCH: "Recording implicitly allowed for AQIONodeClient %p hosted in
// audiomxd with no client audit token." (AQIONode.cpp:341)
canRecord = 1;
}
*(_BYTE *)(this + 20) = canRecord; // this+0x14

The comparison extracts pid and pidversion from both tokens. If either differs, the function calls makeTCCAccessRequest(kTCCServiceMicrophone, &clientToken, ...). If both match, it sets canRecord = 1 without consulting TCC at all and logs the line quoted above, which explains the branch: it exists for audio graphs hosted inside the daemon itself, where there’s no external client to ask about and the daemon’s own microphone grant covers the capture. The check approximates “is this client me?” by comparing process identities, which is sound reasoning applied to unsound input, because property 2009 let an external app plant the daemon’s own pid and pidversion in the buffer being compared.

Two details in the decompilation are worth reading correctly. The repeated token copies in the original output are the compiler passing 32-byte structs by reference; they validate nothing. And the mismatch branch isn’t a safe fallback. The TCC request it issues uses the stored client token as its subject, and the daemon’s check-by-audit-token entitlement makes that query legitimate. Both outcomes of the self-check decide permission for an identity the client chose: a match means allow with no questions asked, and a mismatch means ask TCC about whoever the client claims to be. The user’s refusal, recorded against the app’s real identity, is never consulted on either path.

CVE-2026-65339 Demo

How the exploit retrieves audiomxd’s PID and pidversion

To pass the self-check, the app needs audiomxd‘s pid and pidversion. The sandbox makes the obvious routes useless: process scans with proc_name() are filtered for container apps, and there’s no direct API for reading another process’s pidversion. The iOS SDK doesn’t even ship the libbsm accessors, so the proof of concept reads the token’s words directly. But the same kernel mechanism that makes audit tokens trustworthy will hand over the daemon’s identity to anyone who asks correctly, because trailers work in both directions. Get audiomxd to send you a message, and the kernel stamps that message with audiomxd‘s token.

Meta’s proof of concept looks up com.apple.audio.AURemoteIOServer with mach-lookup and sends a MIG request whose msgh_id matches no routine, 0x00C0FFEE. The server answers with the standard MIG_BAD_ID error reply, and the app receives that reply requesting the audit trailer:

msg.hdr.msgh_id = 0x00C0FFEE; // no such routine -> MIG_BAD_ID error reply
kr = mach_msg(&msg.hdr,
MACH_SEND_MSG | MACH_RCV_MSG | MACH_SEND_TIMEOUT | MACH_RCV_TIMEOUT |
MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0) |
MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT),
sizeof(mach_msg_header_t), sizeof(msg), reply, 1500, MACH_PORT_NULL);
mach_msg_audit_trailer_t *tr = (mach_msg_audit_trailer_t *)
((uint8_t *)&msg.hdr + round_msg(msg.hdr.msgh_size));
memcpy(out, &tr->msgh_audit, sizeof(*out));
// out->val[5] = audiomxd's pid, out->val[7] = audiomxd's pidversion

The trailer’s val[5] is the daemon’s PID and val[7] its pidversion, supplied by the kernel and exact. Calap’s variant is tidier still: the AURemoteIO MIG subsystem exposes routine 88000, GetServerPID, which answers an empty request, so the same trailer arrives without deliberately malformed traffic. One iOS 26 detail from Meta’s writeup: enforced reply-port semantics mean a freshly allocated plain receive right can’t serve as a MIG reply port, so the PoC uses mig_get_reply_port(), the per-thread reply port that generated MIG stubs use.

With the two values in hand, the forgery is a small struct edit. The app queries its own audit token as a template, keeps its audit session ID, sets the audit user ID to 0xFFFFFFFF and the UID and GID fields to 501 (the mobile user) to look the part, and drops in the daemon’s pid and pidversion. Only those last two fields matter to the self-check.

static OSStatus set_forged_token(pid_t pid, uint32_t pidversion) {
audit_token_t t;
mach_msg_type_number_t cnt = TASK_AUDIT_TOKEN_COUNT;
task_info(mach_task_self(), TASK_AUDIT_TOKEN, (task_info_t)&t, &cnt); // template
t.val[0] = 0xFFFFFFFF; // auid -1, like a daemon
t.val[1] = t.val[2] = t.val[3] = t.val[4] = 501; // mobile
t.val[5] = (unsigned)pid; // audiomxd's pid
t.val[7] = pidversion; // audiomxd's pidversion
return AudioUnitSetProperty(g_au, 2009, kAudioUnitScope_Global, 0, &t, sizeof(t));
}

The write goes through the public AudioUnitSetProperty with property ID 2009; Meta’s PoC uses the global scope and Calap’s the input scope, and the scope doesn’t matter. Guessing also works if you prefer: with audio I/O running, a wrong token yields silence and the right one yields live microphone samples, because the zero-fill in EnqueueInput is a perfect oracle. Meta’s PoC swept pidversion values from 0 to 1023 and found the match in about 70 seconds, though other runs may need a wider search. The kernel-assisted route makes guessing unnecessary: the operating system’s own trustworthy identity machinery, working exactly as designed, supplied the values needed to defeat a check that trusted untrustworthy bytes.

What the user saw: why the microphone indicator never lit up

The visible behavior on the analyzed builds contradicted itself. The prompt appeared on first launch because the app carried NSMicrophoneUsageDescription, the Info.plist key that supplies the prompt’s purpose string; without it, the client-side library aborts the process at AudioUnitInitialize, a developer requirement rather than a security boundary. The user declined, the refusal persisted, the prompt never reappeared on later launches, and AVAudioApplication.recordPermission kept reporting denied. None of that mattered to the capture path, which never asked TCC. Apple’s iPhone User Guide promises that “an orange indicator appears at the top of the screen whenever an app uses the microphone without the camera,” and on iOS 27.0 beta 4 no indicator appeared while microphone audio streamed to disk; Calap saw the same on the public iOS 26.6 build, in the Dynamic Island area and in Control Center. The logs recorded audiomxd as the recorder, which is what the system genuinely believed, and the indicator reflected that same belief. Meta notes the demo video accompanying its post was filmed on a later build where the indicator does appear, and limits the no-indicator claim to the earlier build.

The limits of the bug matter as much as its capability. This is microphone capture through one daemon’s audio path, not a general TCC bypass: the app gains no other protected resource, no write access to the consent database, and no escape from its sandbox. The pattern has a classic name, the confused deputy: a privileged program tricked into exercising its authority for a caller that lacks it. Calap’s testing adds two practical details: capture started in the foreground survived backgrounding and a locked device (the background variant sets UIBackgroundModes to audio), and his proofs of concept were ordinary Xcode-installed apps with no entitlements file, never submitted to App Review. Exploitation still requires getting an app onto the device and launched; nothing here is remotely reachable.

Apple’s fix: a new entitlement check in AUIOServer_SetProperty

Apple’s patch adds eight machine instructions. In the fixed iOS 27 beta (build 24A5418b in Meta’s diff; the fix first shipped in beta 5 on August 10), the token copy and the SetCanRecord() call are unchanged. What changed is that they now sit inside a condition:

// AudioToolbox, AUIOServer_SetProperty (24A5418b), Hex-Rays
if ( (_DWORD)a5 != 2009 )
goto LABEL_28;
if ( (*(_QWORD *)a2 & *((_QWORD *)a2 + 1) & (_QWORD)a2[1] & *((_QWORD *)a2 + 3)) == -1
|| (HasBooleanEntitlement((const audit_token_t *)a2, v18) & 1) != 0 )
{
v25 = *(_OWORD **)(v43 + 40);
v26 = v25[1];
*(_OWORD *)(v17 + 96) = *v25;
*(_OWORD *)(v17 + 112) = v26;
AQIONodeClient::SetCanRecord((AQIONodeClient *)(v17 + 56));
}

The condition reads a2, the kernel-supplied trailer token the vulnerable branch ignored, and asks two questions. The first arm ANDs the token’s four 64-bit words together and tests for all bits set; an AND of four words equals all-ones only if every word is all-ones. That recognizes the INVALID_AUDIT_TOKEN sentinel (the symbol in Calap’s diff of the iOS 26.6.1 build is gBogusAuditToken) used for the daemon’s own in-process clients, which have no Mach peer and therefore no trailer identity. A remote caller can’t reach that arm, because a2 is written by the kernel from the sending task’s real token, and a live task’s token is never all-ones. The second arm calls HasBooleanEntitlement on a2 for com.apple.private.audio.client-audit-token-override, a private entitlement embedded in a binary’s code signature and validated by the system; an ordinary app can’t grant it to itself. In the iOS image Calap examined, exactly one binary holds it: /usr/libexec/cameracaptured.

The shape of the fix matters more than its size. Apple didn’t change the self-check, the pid-and-pidversion comparison, or the implicit-allow branch; it changed who may write the identity those checks consume. In the fixed build, an unentitled caller’s write fails with kAudioUnitErr_Unauthorized, and the daemon logs “Rejecting ClientAuditToken override from unentitled caller pid %d.” Calap’s diff also shows the AudioQueue path to the same canRecord flag received its own check for the same entitlement, closing the second road to the same byte. The daemon now asks the question it should have asked from the start: not who the client claims to be, but whether the actual caller is allowed to speak for someone else.

CVE-2026-65339 disclosure timeline and affected iOS and macOS versions

The disclosure history explains why the fix reached Apple’s older operating systems in stages. Tsytsarkin reported the bug on July 7; it was fixed in iOS 27.0 beta 5 on August 10, and on August 17 Apple shipped iOS and iPadOS 26.6.1 and macOS Tahoe 26.6.2 with the CVE assigned. Calap, who had reported independently on July 31 with a reproducing Xcode project, initially got his report closed: Apple believed the issue was already fixed in a mid-July iOS 26.6 beta. His binary diff showed the guard was absent from that beta and from the public iOS 26.6 release (23G71, shipped July 27), on which his PoC worked. Apple reopened the report, marked it a duplicate of the earlier Meta report, and on September 14 shipped fixes in macOS Sequoia 15.8, tvOS 27, watchOS 27, and visionOS 27, updating the August advisories the same day to add his credit. After two requested disclosure holds, the last fix landed on October 26 in iOS and iPadOS 18.7.11 for older devices, and both writeups appeared on November 9. The full fixed set, per the National Vulnerability Database, is iOS and iPadOS 26.6.1 and 18.7.11, macOS Tahoe 26.6.2 and Sequoia 15.8, and tvOS, watchOS, and visionOS 27.

For triage, the advisory language is a trap worth naming. “An app may be able to leak sensitive user information” and “a logic issue was addressed with improved checks” are accurate and nearly useless for prioritization; the CISA-ADP enrichment in NVD scores the bug a medium 5.0 on CVSS 3.1, with high confidentiality impact and the local, low-privilege, user-interaction vector you’d expect for a malicious installed app, filed under CWE-693, Protection Mechanism Failure. A defender reading only that wouldn’t learn that the failure mode is microphone capture after an explicit refusal, with the privacy indicator dark on at least some builds. The practical response is simple: treat this as a patch-now item on any fleet where untrusted apps can be installed, confirm devices are on the fixed versions above (including the 18.7.11 and Sequoia 15.8 lines for hardware that can’t move to the current OS), and remember that the orange dot is a useful cue but not an independent guarantee, since it reflects the same attribution the bug fooled.

For anyone who builds privileged services, the durable lesson is about provenance. An audit token is only as trustworthy as its source: kernel-written trailers and connection-derived tokens are proof, message bodies and property payloads are claims, and no amount of careful comparison upgrades a claim into proof. The vulnerable daemon’s log line described a client “hosted in audiomxd with no client audit token.” The client was external, its token was forged, and the recording was real. The kernel had written the truth into the trailer of every message the app sent; it was sitting right there in a2. The fix, at bottom, was eight instructions that finally read it.

Buy me A Coffee!

Support The CyberSec Guru’s Mission

🔐 Fuel the cybersecurity crusade by buying me a coffee! Your contribution powers free tutorials, hands-on labs, and security resources.

Why your support matters:
  • Writeup Access: Get complete writeup access within 12 hours
  • Zero paywalls: Keep the main content 100% free for learners worldwide

Perks for one-time supporters:
☕️ $5: Shoutout in Buy Me a Coffee
🛡️ $8: Fast-track Access to Live Webinars
💻 $10: Vote on future tutorial topics + exclusive AMA access

“Your coffee keeps the servers running and the knowledge flowing in our fight against cybercrime.”☕ Support My Work

Buy Me a Coffee Button

If you like this post, then please share it:

Exploits

Discover more from The CyberSec Guru

Subscribe to get the latest posts sent to your email!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.