MacOS SUHelper Root Privilege Escalation Vulnerability: A Deep Dive Into CVE-2022-22639
A root-running macOS software-update helper daemon exposed an IPC routine that loaded a framework from a client-supplied path without checking the caller's rights. An attacker could point that path at their own bundle so the daemon loaded it and launched a payload as root.
Published on trendmicro.com
We discovered a now-patched vulnerability in macOS SUHelper, designated as CVE-2022-22639. If exploited, the vulnerability could allow malicious actors to gain root privilege escalation.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The IPC service routine for prepareInstallAssistantWithPath lacked the rights check that other routines perform, and it loaded a framework from a client-controlled path.
What the attacker needed
Local access to a macOS system; ability to run code as a normal user
The fix
The patch adds the missing rights validation to the vulnerable IPC routine, and Apple shipped it in the macOS Monterey 12.3 update.
How it was found
- Find the suhelperd IPC service and its client interfaces in the private framework
- Identify the [redacted] routine that skips the rights check
- Supply a crafted path so the daemon loads OSInstallerSetup.framework from an attacker-controlled bundle
- Place a payload at the osinstallersetupd tool path inside that bundle
- The root daemon submits the job and the payload runs with root privileges
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
macOS runs a background service as the all-powerful 'root' user to handle software updates. Other programs talk to it through a messaging channel called IPC. One of those messages let the sender say where to load code from, and the service never checked whether the sender was allowed to ask, so a normal user could get their own code run as root.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.