Microsoft's investigation into the security technology looked at macOS processes entitled to bypass SIP protections, leading to the discovery of a software installation daemon called "system_installd" that enables any of its child processes to completely circumvent SIP filesystem restrictions.
Thus when an Apple-signed package is being installed, it invokes the system_installd daemon, and any post-install scripts contained in the package is executed by invoking a default shell, which is Z shell (
zsh) on macOS.
"Interestingly, when zsh starts, it looks for the file /etc/zshenv, and — if found — runs commands from that file automatically, even in non-interactive mode," Bar Or said. "Therefore, for attackers to perform arbitrary operations on the device, a fully reliable path they could take would be to create a malicious /etc/zshenv file and then wait for system_installd to invoke zsh."
Successful exploitation of CVE-2021-30892 could enable a malicious application to modify protected parts of the file system, including the capability to install malicious kernel drivers (aka rootkits), overwrite system files, or install persistent, undetectable malware. Apple said it
remediated the
problem with additional restrictions as part of security updates pushed on October 26, 2021.
"Security technology like SIP in macOS devices serves both as the device's built-in baseline protection and the last line of defense against malware and other cybersecurity threats," Bar Or said. "Unfortunately, malicious actors continue to find innovative ways of breaching these barriers for these very same reasons."