Skip to content
Access control Write-up Advanced

CVE-2023-23525: Get Root via A Fake Installer

The default application for opening PKG files could be changed to a fake installer that mimics the system installer. When a user granted root privileges to install a package, the fake installer could abuse the authorization to run arbitrary code with root privileges.

Mickey Jin Follow

Published on jhftss.github.io

A few weeks ago, Rich Trouton noticed a new change in the latest macOS release: macOS Ventura 13.3 alters expected behavior for Finder’s Open With functionality for macOS installer packages. In this post, I want to share a simple LPE vulnerability associated with it and why Apple made the change.

Mickey's Blogs, on jhftss.github.io

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, macOS allowed users to change the default handler for installer package files, so a fake installer could receive the user's authorisation and misuse it.

Impact

A user who granted root privileges to the fake installer could have arbitrary code executed with root privileges.

What the attacker needed

Local access to the Mac; user opens a PKG file; user grants root privileges

The fix

Apple changed macOS so that users can no longer change the default application for PKG files.

How it was found

  1. Copy the system Installer.app to /Applications and remove its code signature.
  2. Replace the app's executable with a trampoline that injects a dynamic library and launches the original installer.
  3. Change the bundle identifier and re-sign the app ad hoc.
  4. Register the fake installer with LaunchServices and set it as the handler for the package file type.
  5. When the user opens a package and grants root privileges, the injected library hooks the authorisation call and runs a payload 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.

On macOS, double-clicking a package file normally opens the system installer, which asks for an administrator password. The researcher showed that the default app for package files could be swapped for a lookalike app, so the password prompt came from the fake app. Once the user approved, the fake app could use that approval to run its own commands as the administrator.

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 by Mickey Jin

View all

113 more disclosed reports, best first.

More from Apple (macOS)

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.