Security researchers have uncovered a sophisticated kernel exploit named Trigon, leveraging a critical integer overflow vulnerability (CVE-2023-32434) in Apple’s XNU virtual memory subsystem. The exploit allows attackers to bypass Apple’s Kernel Text Read/Write (KTRR) and Pointer Authentication (PPL) protections, giving them access to physical memory mapping. Initially discovered during Kaspersky’s Operation Triangulation campaign, the vulnerability targets iOS devices, highlighting weaknesses in the system’s memory management architecture. The flaw occurs due to improper boundary checks in the mach_make_memory_entry_64 function, enabling attackers to create memory entries far exceeding device capacities, bypassing security mechanisms.
The Trigon attack chain consists of several phases. In the first phase, attackers create malicious memory entries using the PurpleGfxMem region via IOSurface APIs, enabling them to map arbitrary physical addresses into user space through mach_vm_map.
This bypasses KTRR, which is typically used to protect kernel text.
The second phase involves physical memory analysis, where attackers read the iboot-handoff structure to calculate base addresses and translate virtual kernel addresses to physical ones. This enables the discovery of protected kernel text regions and the kernel’s physical base.
In the third phase, attackers use the discovered base to identify Mach-O headers in the kernel and derive virtual-to-physical translations for kernel structures. Finally, in the fourth phase, Trigon achieves stable kernel read/write primitives by spraying IOSurface objects and hijacking memory objects with the help of the pv_head_table. This allows attackers to manipulate kernel properties safely, circumventing page table panics and enabling them to control kernel data.
The exploit provides a reliable way to access critical kernel functions without detection by typical security defenses.
Trigon’s exploit showcases the limitations of hardware-backed kernel protections, like KTRR and PPL, when paired with flaws in the memory subsystem. Researchers stress the need for better integer overflow checks in XNU’s memory APIs and stronger hardware-assisted bounds enforcement. The exploit targets A10(X) devices running iOS 13 and later but can be adapted for newer SoCs with architectural changes. Despite the complexity of this attack, it serves as a stark reminder of the vulnerabilities in kernel-level protections and the need for enterprises to prioritize zero-day detection strategies.