Skip to main content

Microsoft Defender for macOS IPC Socket Race Enables Root File Read and Privilege Escalation

· 3 min read · SecurityXP Editorial Desk

Key Facts

  • CVE-2026-50657 and CVE-2026-50658 in Microsoft Defender for macOS were patched in the July 2026 Patch Tuesday release and detailed at BlueHat Asia by researcher Eugene Lim (Spaceraccoon).
  • Both bugs stem from a time-of-check/time-of-use race in wdavdaemon peer validation on world-writable AF_UNIX sockets (/var/run/wdavdaemon.sock and /var/run/priv_wdavdaemon.sock), which checked LOCAL_PEERPID followed by proc_pidpath across an execve boundary.
  • CVE-2026-50657 abuses the diagnostic archive opcode with POSIX hardlinks to copy root-only files (/etc/kcpassword, shadow hashes, TCC databases) into a world-readable ZIP.
  • CVE-2026-50658 combines the IPC race with a skipped std::optional authorization check in handle_threat::restore (opcode 0x05) to create /etc/crontab and execute commands as root via com.vix.cron.

Vulnerability researcher Eugene Lim (Spaceraccoon) published technical details on November 15, 2026, for two local privilege-escalation flaws in Microsoft Defender for macOS (CVE-2026-50657 and CVE-2026-50658, patched by Microsoft in July 2026). Originally presented at BlueHat Asia, the vulnerabilities allow an unprivileged local user to bypass IPC client validation in the root wdavdaemon service, disclose root-owned files, or execute arbitrary commands as root.

The flaws are macOS counterparts to the Windows Defender privilege escalations CVE-2026-33825 (“BlueHammer”) and CVE-2026-41091, surviving on macOS due to differences in UNIX socket peer credentials and POSIX filesystem semantics.

IPC Peer Validation Race: LOCAL_PEERPID vs. proc_pidpath

Attack path: World-Writable AF_UNIX Socket → LOCAL_PEERPID / execve Race → Hardlink Diagnostic Read (CVE-2026-50657) or Quarantine Restore Write (CVE-2026-50658) → /etc/crontab Root Execution.

Defender’s root daemon (wdavdaemon) exposes two world-writable AF_UNIX stream sockets: /var/run/wdavdaemon.sock and /var/run/priv_wdavdaemon.sock. To authenticate a connecting client, the daemon retrieves the client PID via getsockopt(..., SOL_LOCAL, LOCAL_PEERPID), resolves the process executable path using proc_pidpath(pid), verifies that the path resides under /Applications/Microsoft Defender.app/Contents/, and validates its Apple code signature.

Because LOCAL_PEERPID is captured at connect() time while proc_pidpath() queries the live process table entry asynchronously when the request is processed, an unprivileged client can connect, write a serialized IPC message to the socket buffer, and immediately call execve() into a legitimate Microsoft-signed Defender binary. When wdavdaemon inspects proc_pidpath(pid), the process image is now signed by Microsoft, satisfying the peer check for the attacker’s queued payload.

CVE-2026-50657 targets the diagnostic bundle collection opcode on /var/run/wdavdaemon.sock. When invoked, wdavdaemon runs as root, collects log files from the caller’s user-writable Defender log directory, and writes them into a world-readable diagnostic ZIP archive.

While the collector filtered symbolic links (S_ISLNK), macOS allows an unprivileged user to create POSIX hardlinks (link(2)) to root-owned files provided the user has search (+x) permission on the parent directory. Because a hardlink shares the target inode and reports S_ISREG, placing hardlinks to /etc/kcpassword, /var/db/dslocal/nodes/Default/users/root.plist, or TCC.db inside the user log directory caused wdavdaemon to package root-only files into the world-readable ZIP.

CVE-2026-50658: Skipped std::optional Auth and /etc/crontab Creation

CVE-2026-50658 targets handle_threat::restore (opcode 0x05, sub-action restore_path) on /var/run/priv_wdavdaemon.sock, which restores a quarantined file to a caller-supplied destination path as root.

The IPC request schema defines the macOS Authorization Services blob (AuthorizationExternalForm) as an optional field (std::optional). If a client supplied an invalid blob, AuthorizationCreateFromExternalForm rejected the call; if the client omitted the field entirely, the handler skipped the authorization check and proceeded with the restore.

Although the restore primitive refuses to overwrite existing files, macOS does not create /etc/crontab by default, while the system launchd plist com.vix.cron monitors /etc/crontab via QueueDirectories and spawns cron as root the moment the file appears. By submitting a malicious crontab file into Defender quarantine and invoking handle_threat::restore with an omitted auth blob across the LOCAL_PEERPID race, an unprivileged user creates /etc/crontab and achieves root code execution within 60 seconds.

OS-Level Remediation

Microsoft patched both vulnerabilities in the July 2026 update for Microsoft Defender for macOS. On macOS, privileged IPC servers should bind peer identity using the kernel audit_token_t (LOCAL_PEERTOKEN or XPC’s xpc_connection_set_peer_code_signing_requirement), which embeds a monotonic pidversion counter that is invalidated across execve(), rather than resolving mutable paths from a raw PID.

Tags: Microsoft Defender macOS Privilege Escalation CVE-2026-50657 CVE-2026-50658 TOCTOU

Sources & References

SE SecurityXP Editorial Desk
SecurityXP Editorial Desk Vulnerability Research & News Board

Automated and analyst-reviewed threat intelligence briefings tracking active exploitation campaigns, CVE disclosures, and extortion group activity.

Security Digest

The most important cybersecurity stories, CVE alerts, and threat intelligence — one concise email. Unsubscribe anytime.

Related Articles