A security researcher has published details and proof-of-concept (PoC) code for a macOS vulnerability that could be exploited to escape a sandbox and execute code within Terminal.
Tracked as CVE-2022-26696 (CVSS score of 7.8), the security defect was identified and reported last year, with a patch available since the release of macOS Monterey 12.4 in May.
In its advisory, Apple notes that the flaw allowed a sandboxed process to circumvent sandbox restrictions, and that improved environment sanitization resolved the issue.
Successful exploitation of the vulnerability would require for the attacker to be able to execute low-privileged code on the target system.
“The specific flaw exists within the handling of XPC messages in the LaunchServices component. A crafted message can trigger execution of a privileged operation,” Trend Micro’s Zero Day Initiative (ZDI) explains.
An attacker able to exploit this vulnerability could “escalate privileges and execute arbitrary code in the context of the current user,” ZDI says.
According to SecuRing researcher Wojciech Reguła, who was credited for reporting CVE-2022-26696, the root cause of the bug is that macOS allows sandboxed applications to launch processes that do not inherit the main app’s sandbox profile.
The platform also allows for applications to be spawned with environment variables, and CVE-2022-26696 was identified in this mechanism.
Regula discovered that, on the one hand, a specific function was returning ‘Yes’ when a specific environment variable was set, while, on the other hand, some environment variables were not cleared when the function returned ‘Yes’.
This, the researcher says, allowed him to “execute code within the Terminal.app context without any sandbox”.
On Friday, Reguła published details on the code needed to exploit the flaw, as well as a video demonstration on how a weaponized Word document can be used to escape the sandbox and execute code within the Terminal.
“Executing code within the Terminal.app context can be really dangerous as it can also have some TCC permissions already granted,” the researcher points out.
Related: Apple Patches Remote Code Execution Flaws in iOS, macOS
Related: Apple Patches Over 100 Vulnerabilities With Release of macOS Ventura 13

More from Ionut Arghire
- 500k Impacted by Data Breach at Debt Buyer NCB
- Chinese Cyberspies Use ‘Melofee’ Linux Malware for Stealthy Attacks
- Microsoft Cloud Vulnerability Led to Bing Search Hijacking, Exposure of Office 365 Data
- OpenAI Patches Account Takeover Vulnerabilities in ChatGPT
- New Wi-Fi Attack Allows Traffic Interception, Security Bypass
- Casino Giant Crown Resorts Investigating Ransomware Group’s Data Theft Claims
- Over 200 Organizations Targeted in Chinese Cyberespionage Campaign
- Nigerian BEC Scammer Sentenced to Prison in US
Latest News
- 500k Impacted by Data Breach at Debt Buyer NCB
- Chinese Cyberspies Use ‘Melofee’ Linux Malware for Stealthy Attacks
- Why Endpoint Resilience Matters
- Microsoft Cloud Vulnerability Led to Bing Search Hijacking, Exposure of Office 365 Data
- 3CX Confirms Supply Chain Attack as Researchers Uncover Mac Component
- UK Introduces Mass Surveillance With Online Safety Bill
- Musk, Scientists Call for Halt to AI Race Sparked by ChatGPT
- Malware Hunters Spot Supply Chain Attack Hitting 3CX Desktop App
