Google Project Zero has revealed new sandbox escape vulnerabilities by leveraging Mach Interprocess Communication (IPC) mechanisms-core components underpinning Apple’s operating system security model.
Their findings, which combine manual reverse engineering and advanced fuzzing techniques, not only expose systemic risks in macOS but also provide open-source tools and code for the wider security community.
The Project Zero team, led by Dillon Franke, focused on the com.apple.audio.audiohald Mach service exposed by the coreaudiod daemon.
Their methodology, termed knowledge-driven fuzzing, blends automated fuzz testing with deep manual analysis. This hybrid approach enabled them to:
Identify Accessible Attack Surfaces: By analyzing sandbox profiles and using tools like sbtool, the researchers determined which Mach services could be reached from sandboxed processes.
Select High-Value Targets: They narrowed their focus to daemons with both significant privileges and accessible Mach services-settling on coreaudiod due to its complexity and privilege level.
Develop a Custom Fuzzing Harness: Instead of relying solely on the mach_msg API, which complicates code coverage collection, they built a harness that directly invoked message handlers within the CoreAudio framework.
This allowed for high-throughput, in-process fuzzing and precise coverage tracking.
The researchers discovered a critical type confusion vulnerability in the handling of Mach messages by coreaudiod.
In particular, several message handlers assumed that objects fetched from the internal HALS_ObjectMap were of a specific type (e.g., ioct for IOContext) without verifying this assumption.
By crafting Mach messages that referenced objects of the wrong type, an attacker could trigger out-of-bounds memory access or even hijack control flow via manipulated virtual function tables (vtables).
A simplified proof-of-concept, using the mach_msg API, demonstrated that this issue could be exploited from a sandboxed process-effectively achieving a sandbox escape.
The vulnerability was assigned CVE-2024-54529 and patched by Apple in December 2024, with the fix introducing explicit type checks before dereferencing objects in affected handlers.
To facilitate fuzzing, the team used function interposing to bypass redundant Mach service registration:
This code ensures the fuzzing harness can inject messages directly into the target subsystem without colliding with system-level service registration.
The research underscores the importance of rigorous input validation in IPC message handlers, especially for privileged daemons exposed to sandboxed processes.
Project Zero recommends that Apple and other OS vendors enforce strict type checks and consider architectural changes to IPC mechanisms to reduce the attack surface for sandbox escapes.
By open-sourcing their fuzzing harness and methodology, Google’s researchers have empowered the security community to continue probing and hardening macOS services against similar vulnerabilities-highlighting both the power and peril of low-level IPC in modern operating systems.
Setting Up SOC Team? – Download Free Ultimate SIEM Pricing Guide (PDF) For Your SOC Team -> Free Download