Critical macOS vulnerability found to bypass SIP restrictions

The flaw lies in how the OS handles software packages and post-installation scripts

Screen of code displaying Microsoft's proof of concept for the Shrootless exploit on macOS

Security researchers at Microsoft have discovered a flaw in Apple’s macOS that can hackers could use to bypass the System Integrity Protection (SIP) feature and execute arbitrary code.

Dubbed Shrootless, the flaw has been identified as CVE-2021-30892 and was included in the security updates released by Apple on 26 October.

The flaw lies in how Apple signs the software package and how the post-installation scripts are installed in it. The researchers found that attackers can use this mechanism for malicious purposes by creating a custom package that can intercept the installation process. After SIP bypass, an attacker can install rootkits and undetectable malware, and even overwrite system files.

A design flaw means that in some cases software packages require access to directories protected by SIP, as is the case with system updates. Files with the extended attribute 'com.apple.rootless' are similarly SIP-protected. Of course, there’s no way to add that extended attribute to a file legitimately, otherwise malware could use SIP for its own protection. 

While analyzing macOS processes to bypass SIP, researchers came across the 'system_installd' daemon with powerful 'com.apple.rootless.install.inheritable' rights. With these rights, any 'system_installd' child process can avoid all SIP-set file system restrictions.

Related Resource

The top three IT pains of the new reality and how to solve them

Driving more resiliency with unified operations and service management

Man at his computer next to title card - whitepaper from ServiceNowFree download

The researchers decided to examine all the child processes of 'system_installd' and were surprised to find several cases that allow hackers to abuse this functionality to bypass SIP.

For example, if an Apple-signed package (.pkg file) is installed, the package will start the 'system_installd' process, which is responsible for installing it. If the package contains any post-installation scripts, 'system_installd' starts them by initiating the default shell (on macOS, this is zsh).

It's important to note that after starting zsh, it then looks for the '/etc/zshenv' file and, if found, automatically runs commands from it, even in a non-interactive mode. Therefore, to perform arbitrary operations on the device, attackers can create a malicious '/etc/zshenv' file and then wait for 'system_installd' to invoke zsh.

Researchers said that the research underscores the importance of collaboration among security researchers, software vendors, and the larger security community.

“As cross-platform threats continue to increase, vulnerability discoveries, coordinated response, and other forms of threat intelligence sharing help enrich our protection technologies that secure users’ computing experience regardless of the platform or device they’re using,” said Jonathan Bar Or, senior security researcher at Microsoft’s 365 Defender Research Team.

Featured Resources

2021 Thales cloud security study

The challenges of cloud data protection and access management in a hybrid and multi cloud world

Free download

IDC agility assessment

The competitive advantage in adaptability

Free Download

Digital transformation insights from CIOs for CIOs

Transformation pilotes, co-pilots, and engineers

Free download

What ITDMs did next - and what they should be doing now

Enable continued collaboration and communication for hybrid workers

Recommended

What is Microsoft Edge? Everything you need to know
web browser

What is Microsoft Edge? Everything you need to know

6 Dec 2021
The true story behind the IBM Personal Computer
Hardware

The true story behind the IBM Personal Computer

3 Dec 2021
MacBook Pro owners report MagSafe charging issues
Laptops

MacBook Pro owners report MagSafe charging issues

30 Nov 2021
Microsoft hit with formal complaint over "monopolistic" software bundling
collaboration

Microsoft hit with formal complaint over "monopolistic" software bundling

29 Nov 2021

Most Popular

What should you really be asking about your remote access software?
Sponsored

What should you really be asking about your remote access software?

17 Nov 2021
What are the pros and cons of AI?
machine learning

What are the pros and cons of AI?

30 Nov 2021
How to move Microsoft's Windows 11 from a hard drive to an SSD
Microsoft Windows

How to move Microsoft's Windows 11 from a hard drive to an SSD

24 Nov 2021