Skip to content
Access control Write-up Intermediate

Another method for exploiting the macOS root vulnerability

A macOS authentication flaw allowed any local user to set the root account password by attempting to authenticate as root, and the author found that the same flaw could be triggered non-interactively through the su command. An attacker with local access could therefore gain full root privileges on the machine.

medium.com

Published on medium.com

Yesterday, @lemiorhan on Twitter reported that any user could gain root access to a macOS 10.13 machine by attempting to log in as root when prompted for authentication on the machine.

Zach Wasserman, on medium.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 authentication logic failed to properly validate credentials when the root account had no password set, treating the login attempt as successful and allowing the password to be changed.

Impact

Any unprivileged local user, or malware running as one, could gain root access; the text notes the method no longer works after Apple's patch.

What the attacker needed

Local access to a macOS 10.13 machine; an unprivileged user account

The fix

Apple fixed the flaw in a critical security update, and the author confirmed the su method no longer works after installing it.

How it was found

  1. On a macOS 10.13 machine, run the su command targeting root with a harmless command.
  2. Enter the desired new root password when prompted.
  3. Observe that the root account password has been set, granting root access.

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.

On a Mac, the root account is the all-powerful administrator that can do anything. A bug meant that simply trying to log in as root, even with the wrong password, was accepted and let the person set a new root password. The author found this could also be done from a terminal command, so malicious software running as a normal user could quietly take over the whole machine.

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.

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.