Skip to content
Access control Write-up Advanced

Threats intelligence

A vulnerability in macOS allowed an attacker to bypass System Integrity Protection (SIP) by planting a malicious /etc/zshenv file that is executed when system_installd runs a post-install script via zsh. This could enable installation of a rootkit, overwriting system files, or persistent malware.

Microsoft has discovered a vulnerability that could allow an attacker to bypass System Integrity Protection (SIP) in macOS and perform arbitrary operations on a device. We also found a similar technique that could allow an attacker to elevate their privileges to root an affected device.

Microsoft Threat Intelligence, on microsoft.com

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

Likely the system_installd daemon, which has the com.apple.rootless.install.heritable entitlement, invokes zsh to run post-install scripts, and zsh automatically sources /etc/zshenv, allowing an attacker who can write that file to execute code with SIP bypassed.

Impact

An attacker could bypass SIP to install a rootkit, overwrite system files, or install persistent malware; the text also notes a similar technique could elevate privileges to root.

What the attacker needed

Ability to write /etc/zshenv; Apple-signed package with post-install script; installer utility invoked

How it was found

  1. Download an Apple-signed package that has a post-install script.
  2. Plant a malicious /etc/zshenv file that checks its parent process and writes to restricted locations if the parent is system_installd.
  3. Invoke the installer utility to install the package.

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.

System Integrity Protection (SIP) is a macOS security feature that stops even the root user from modifying critical system files. The researchers found that when macOS installs an Apple-signed package, it runs a shell that automatically executes a file called /etc/zshenv. An attacker who can create that file could make the installer run their own commands with SIP bypassed, potentially taking full control of the Mac.

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.

More from Apple

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.