Microsoft Teams for macOS Local Privilege Escalation
The Microsoft Teams updater XPC service validated connecting clients by PID, which can be reused, and accepted any Microsoft-signed installer package, including old vulnerable ones. An attacker could exploit this to install a vulnerable Microsoft AutoUpdate package and then escalate to root.
offensive-security.com
Published on offensive-security.com
Research & Tutorials
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
The XPC service used the client's PID for validation instead of its audit token, and it allowed installation of any Microsoft-signed package, including outdated vulnerable ones.
Impact
An attacker could escalate privileges to root by installing a vulnerable Microsoft AutoUpdate package, though Microsoft has since hardened the XPC service against PID reuse, leaving only the injection vector.
What the attacker needed
Local access to the macOS system; ability to run a malicious program; Microsoft Teams installed
The fix
The client process verification should use audit_token instead of PID, and the client should be hardened against injection by enabling library validation and removing dangerous entitlements.
How it was found
- Connect to the XPC service using a PID reuse race condition.
- Call the installUpdateWithPackage method with a path to a vulnerable Microsoft AutoUpdate package.
- Win the race condition once to have the package installed.
- Exploit the installed vulnerable Microsoft AutoUpdate to escalate 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.
A background service that updates Microsoft Teams checked the identity of programs asking it to install updates by looking at a process ID number. Process IDs can be reused, so an attacker could trick the service into thinking a malicious program was the real Teams app. The service also accepted any installer signed by Microsoft, even old ones with known security holes, allowing an attacker to install a vulnerable updater and then gain higher privileges.
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.