Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Log in or create an account to edit The Apple Wiki.
badRecovery
Vulnerability in XNU
SoftwareiOS
Vulnerable in15.0 - 15.4.1
Fixed in15.5
Disclosed16 May 2022 (2022-05-16)
Discovered byLinus Henze
CVECVE-2022-26765
Apple KBHT213258

CVE-2022-26765, also known as badRecovery, is a PAC bypass used in Fugu15. It does not affect iOS 14, because the vulnerable code was introduced in iOS 15.0.

Thread fault handlers

Thread fault handlers are a mechanism used to handle expected faults during data access (e.g. accessing data at an invalid address). The thread can store a pointer to a fault handler and the kernel will jump to that if a fault occurs.

The vulnerability

In iOS 15, the hw_lck_ticket_reserve_orig_allow_invalid function had a recovery handler that would use a regular ret instruction, instead of verifying the pointer authentication code of the return address. Thus, by obtaining a signed thread fault handler pointer to this fault handler, you can perform an unauthenticated return in kernel mode.

In Fugu15, this is then used to sign a new thread fault handler for a gadget that will sign and jump to a pointer in x22. This new fault handler is then used to kickstart a proper kernel call routine, which is required to exploit tlbFail.

External links