Skip to content
Access control Write-up Advanced

Microsoft OneDrive for macOS Local Privilege Escalation

The OneDrive XPC daemon verified clients by PID instead of audit token, and its update method retained file permissions when moving a new app, allowing a low-privileged user to replace the root helper with a malicious binary. An attacker could thus execute arbitrary code as root.

offsectraining Follow

Published on offensive-security.com

Research & Tutorials

OffSec Team, on offensive-security.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 combination of PID-based client verification and retaining file permissions during app installation allowed a low-privileged user to overwrite a root-executed helper.

Impact

A local low-privileged user could execute arbitrary code as root, as demonstrated by a root Terminal popup.

What the attacker needed

Local user access; OneDrive installed

How it was found

  1. Copy the existing OneDrive.app to /tmp.
  2. Change permissions of the copied app to 777.
  3. Call TrashOldApplication to delete the original app.
  4. Call InstallNewApplicationAtPath to copy the modified app to /Applications.
  5. Replace the OneDriveUpdaterDaemon binary with a custom binary.
  6. Wait for the daemon to exit and invoke the Mach service to execute the binary as root.

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.

A background service running as root checked the identity of connecting programs using a process ID, which can be reused by another program. Also, when updating the app, it kept the file permissions from the new copy, so a normal user could make the app writable by everyone. By replacing a file that the root service later runs, the user could run their own code as root.

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 offsectraining

View all

1 more disclosed report, best first.

More from Microsoft

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.