Change home directory and bypass TCC aka CVE-2020-27937
A macOS application with a private TCC entitlement could be injected with a malicious plugin, allowing an attacker to change the user's home directory entry in Open Directory. This bypassed the user TCC database, granting access to protected folders and resources such as Desktop, Documents, Address Book, Camera, and Microphone.
Published on wojciechregula.blog
This is the second TCC vulnerability that has been disclosed on my & Csaba’s talk “20+ ways to bypass your macOS privacy mechanisms” during Black Hat USA. This time by changing the NFSHomeDirectory variable I was able to bypass user TCC restrictions.
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 Directory Utility app lacked hardened runtime and library validation, allowing plugin injection, and TCC relied on the user's home directory from Open Directory, which could be modified via the app's private entitlement.
Impact
This vulnerability gave access to Desktop, Documents, Address Book, Camera, Microphone, Photos and more, bypassing user TCC restrictions.
What the attacker needed
Local access to the macOS system; ability to inject a plugin into Directory Utility
The fix
Apple fixed this vulnerability in macOS Big Sur 11.0.1.
How it was found
- Identify Directory Utility.app as having the private TCC entitlement and loading plugins from .daplug bundles.
- Verify the app lacks hardened runtime and library validation (codesign flags 0x0).
- Inject a malicious plugin into Directory Utility.app to gain the entitlement.
- Use the entitlement to modify the user's NFSHomeDirectory record via Open Directory.
- Plant a malicious user TCC database in the new home directory to bypass TCC restrictions.
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, TCC (Transparency, Consent, and Control) is the system that asks your permission before apps can access things like your camera or documents. The researcher found that a built-in app could be tricked into running malicious code, which then changed where the system thinks your home folder is. Because TCC trusted that location, the attacker could replace the permission database and get access to private data without asking you.
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.