SlideShare uma empresa Scribd logo
1 de 52
Baixar para ler offline
Mount(ain) of Bugs
Csaba Fitzl


Twitter: @theevilbit
whoami
• author of "macOS Control Bypasses" at
Offensive Security


• ex red/blue teamer


• macOS bug hunter


• husband, father


• hiking, trail running 🥾 🏔
pwd
agenda
1. MACF


2. the mount system call


3. disk arbitration service


4. CVE-2017-7170 (Patric Wardle) - Snif
fi
ng Authorization References


5. CVE-2017-2533 (pwn2own) - Mount yourself a root shell


6. CVE-2020-9771 - TCC bypass via snapshot mounting


7. CVE-2021-1784 - TCC bypass via mounting over com.apple.TCC


8. CVE-2021-30782 - TCC bypass via AppTranslocation service


9. CVE-2021-26089 - Fortinet Forticlient installer LPE


10. other tricks and new bugs
MACF


-


Mandatory Access Control Framework
MACF
• origin: TrustedBSD MAC


• implemented in kernel


• policy modules extend the
kernel


• can place hooks in supported
location


• very powerful
MACF
• very - very powerful


• was part of KDK till OS X 10.12 (never of
fi
cially supported)


• mac.h header was removed


• available in xnu: `security/mac.h`, `security/mac_framework.h`, `mac_vfs.h`


• examples: AppleMobileFileIntegrity, Sandbox, EndpointSecurity,
Quarantine (=Gatekeeper)
MACF
• typical callout from xnu: mac_......
MACF
MACF
• MAC_CHECK


• iterates over all policy
frameworks


• mpo_... (mac_policy.h)
mount system calls
VFS
• macOS uses Virtual Filesystem Switch (VFS)


• origin: Solaris


• used in most *nix based systems


• abstracts speci
fi
c
fi
le system implementation


• MACF callouts at speci
fi
c points - hooked by the Sandbox
mount system call
fl
ow
disk arbitration service
diskarbitration - the basics
• system wide service, de
fi
ned in:


• /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist


• XPC: com.apple.DiskArbitration.diskarbitrationd


• manage disk mounting, unmounting


• calls mount/unmount system calls under the hood
diskarbitration - why we like it?
• runs as root


• unsandboxed


• XPC service accessible from
application sandbox


• opensource
diskarbitration - the checks
• to prevent abuse, it has to
con
fi
rm:


• if the caller sandboxed


• if the mount point owner ==
caller process owner (see
CVE later)


• DAServer.c


• _DAServerSessionQueueRe
quest function
CVE-2017-7170 - Snif
fi
ng
Authorization References on macOS
CVE-2017-7170 - credits
• found by Patrick Wardle


• details: https://objective-see.com/blog/blog_0x55.html
CVE-2017-7170 - background
• authorization can be passed between processes via
AuthorizationExternalForm


• security_authtrampoline


• old method


• executes privileged actions


• uses external authorization reference
CVE-2017-7170 - vulnerability
• AuthorizationExecuteWithPrivileges wrote the
external form out to $TMPDIR/random
fi
le


• write - unlink quickly


• if we can hold of the ref we can use it


• but! we can unlink $TMPDIR and point it to
somewhere else


• RAMdisk


• possibly also works by mounting over $TMPDIR
CVE-2017-7170 - exploitation
• we create a RAMdisk at $TMPDIR


• wait for an authorization reference to be written


• scan the raw RAMdisk for the token


• use it once security_authtrampoline authorized it :)
CVE-2017-2533 (pwn2own) -
Mount yourself a root shell
CVE-2017-2533 - credits
• was found by the "phoenhex" team, Niklas Baumstark and Samuel Groß


• part of the pwnown 2017 exploit chain


• details: https://phoenhex.re/2017-06-09/pwn2own-diskarbitrationd-
privesc
CVE-2017-2533 - the vulnerability
• disk arbitration service, (DARequest.c)


• check if mount point exists


• check if owned by the user (resolves
path)


• no further checks


• TOCTOU
CVE-2017-2533 - the exploit
• race:


• create a symlink pointing to a user owned directory


• call diskarbitration


• repoint the symlink to a root owned directory after the ownership check


• if mount successful: stop


• need to mount a disk image where the user has write access (EFI
partition)
CVE-2020-9771 - TCC bypass
via snapshot mounting
CVE-2020-9771 - the vulnerability
• APFS supports snapshots


• mount the snapshot in custom location, which falls outside of TCC's
protection


• access all
fi
les (read-only)


• mount with ”noowners” access every user’s
fi
les
CVE-2020-9771 - the
fi
x
• snapshot mounting requires Full Disk Access => problem


• even low privilege users can access other's
fi
le


• under the hood: MACF callout
CVE-2021-1784 - TCC bypass via
mounting over com.apple.TCC
CVE-2021-1784 -the vulnerability
• base case: user’s TCC DB
fi
le is protected


• but! We can mount over the directory


• prepare a new TCC.db
fi
le, new disk image


• mount over “~/Library/Application Support/com.apple.TCC”


• pro
fi
t 🤑


• bug collision with: Mikko Kenttälä (@Turmio_)
CVE-2021-30782 - TCC bypass
via AppTranslocation service
App Translocation
• makes NULLFS mount (not copy) when downloaded app
fi
rst run


• destination: $TMPDIR/AppTranslocation/d/d/Some.app


• open source as part of Security.


• library: libsecurity_translocate


• binary: /usr/libexec/lsd
CVE-2021-30782 - the vulnerability
• Add Quarantine attribute to “Library”


• Call the com.apple.security.translocation XPC service


• (XPC client is also open source)


• Map Library to $TMPDIR/AppTranslocation/d/d/Library


• Access all
fi
les
CVE-2021-30782 - POC
CVE-2021-30782 - the
fi
x
• new sandbox checks


• read - source


• mount - destination


• + sandbox check on mount point
access
CVE-2021-26089 - Fortinet
FortiClient installer LPE
CVE-2021-26089
• the installer uses several log
fi
les
inside /tmp/


• one: fctinstallpost.log


• being written as root


•
fi
xed content
CVE-2021-26089
• symlink attack


• we can do arbitrary overwrite


• code execution - ?


• overwrite periodic scripts
CVE-2021-26089
• the log will be treated as a script


• each line is executed


• pick: /Volumes/FortiClient/
fctdata/conf


• make a DMG
fi
le, mount it, place
a
fi
le at the above link


• will be run as root
Other generic installer trick
trick
• installer: writes
fi
les to:


• /tmp/
fi
xedname/bla/bla/bla


• we can create a mount over /tmp/
fi
xedname with noowners


• during install we can modify any
fi
les


• no race condition even if installer tries to delete /tmp/
fi
xedname
fi
rst
pipeline
bugs to be
fi
xed
• full TCC bypass


• full sandbox escape


• admin con
fi
g TCC bypass
Csaba Fitzl


Twitter: @theevilbit
Further resources
Links
• https://www.zerodayinitiative.com/advisories/ZDI-21-693/


•
Icons
•
fl
aticon.com


• xnimrodx


• Freepik

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

GateKeeper - bypass or not bypass?
GateKeeper - bypass or not bypass?GateKeeper - bypass or not bypass?
GateKeeper - bypass or not bypass?
 
SANS DFIR Prague: PowerShell & WMI
SANS DFIR Prague: PowerShell & WMISANS DFIR Prague: PowerShell & WMI
SANS DFIR Prague: PowerShell & WMI
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
 
Everyone Matters In Infosec 2014
Everyone Matters In Infosec 2014Everyone Matters In Infosec 2014
Everyone Matters In Infosec 2014
 
SANS @Night Talk: SQL Injection Exploited
SANS @Night Talk: SQL Injection ExploitedSANS @Night Talk: SQL Injection Exploited
SANS @Night Talk: SQL Injection Exploited
 
IIS Tilde Enumeration Vulnerability
IIS Tilde Enumeration VulnerabilityIIS Tilde Enumeration Vulnerability
IIS Tilde Enumeration Vulnerability
 
Lares from LOW to PWNED
Lares from LOW to PWNEDLares from LOW to PWNED
Lares from LOW to PWNED
 
Kali kinux1
Kali kinux1Kali kinux1
Kali kinux1
 
There is No Server: Immutable Infrastructure and Serverless Architecture
There is No Server: Immutable Infrastructure and Serverless ArchitectureThere is No Server: Immutable Infrastructure and Serverless Architecture
There is No Server: Immutable Infrastructure and Serverless Architecture
 
Node.js vs Play Framework
Node.js vs Play FrameworkNode.js vs Play Framework
Node.js vs Play Framework
 
Container Security
Container SecurityContainer Security
Container Security
 
[Wroclaw #7] Why So Serial?
[Wroclaw #7] Why So Serial?[Wroclaw #7] Why So Serial?
[Wroclaw #7] Why So Serial?
 
Revoke-Obfuscation
Revoke-ObfuscationRevoke-Obfuscation
Revoke-Obfuscation
 
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015 Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
 
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
 
Designing & Building Secure Web APIs
Designing & Building Secure Web APIsDesigning & Building Secure Web APIs
Designing & Building Secure Web APIs
 
How to discover 1352 Wordpress plugin 0days in one hour (not really)
How to discover 1352 Wordpress plugin 0days in one hour (not really)How to discover 1352 Wordpress plugin 0days in one hour (not really)
How to discover 1352 Wordpress plugin 0days in one hour (not really)
 
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...
 
Injection flaw teaser
Injection flaw teaserInjection flaw teaser
Injection flaw teaser
 
DevSec Defense
DevSec DefenseDevSec Defense
DevSec Defense
 

Semelhante a Csaba fitzl - Mount(ain) of Bugs

macOS Vulnerabilities Hiding in Plain Sight
macOS Vulnerabilities Hiding in Plain SightmacOS Vulnerabilities Hiding in Plain Sight
macOS Vulnerabilities Hiding in Plain Sight
Csaba Fitzl
 
20+ Ways to Bypass Your macOS Privacy Mechanisms
20+ Ways to Bypass Your macOS Privacy Mechanisms20+ Ways to Bypass Your macOS Privacy Mechanisms
20+ Ways to Bypass Your macOS Privacy Mechanisms
SecuRing
 

Semelhante a Csaba fitzl - Mount(ain) of Bugs (20)

macOS Vulnerabilities Hiding in Plain Sight
macOS Vulnerabilities Hiding in Plain SightmacOS Vulnerabilities Hiding in Plain Sight
macOS Vulnerabilities Hiding in Plain Sight
 
20+ Ways to Bypass Your macOS Privacy Mechanisms
20+ Ways to Bypass Your macOS Privacy Mechanisms20+ Ways to Bypass Your macOS Privacy Mechanisms
20+ Ways to Bypass Your macOS Privacy Mechanisms
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
CI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in KubernetesCI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in Kubernetes
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
Containerizing your Security Operations Center
Containerizing your Security Operations CenterContainerizing your Security Operations Center
Containerizing your Security Operations Center
 
Watch How The Giants Fall: Learning from Bug Bounty Results
Watch How The Giants Fall: Learning from Bug Bounty ResultsWatch How The Giants Fall: Learning from Bug Bounty Results
Watch How The Giants Fall: Learning from Bug Bounty Results
 
Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3
 
Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvars
 
Continuous Security
Continuous SecurityContinuous Security
Continuous Security
 
Thotcon - All aboard the Fail Whale
Thotcon - All aboard the Fail WhaleThotcon - All aboard the Fail Whale
Thotcon - All aboard the Fail Whale
 
Owning computers without shell access 2
Owning computers without shell access 2Owning computers without shell access 2
Owning computers without shell access 2
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloudOpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
 
Docker在豆瓣的实践 刘天伟-20160709
Docker在豆瓣的实践 刘天伟-20160709Docker在豆瓣的实践 刘天伟-20160709
Docker在豆瓣的实践 刘天伟-20160709
 
Cloud Device Insecurity
Cloud Device InsecurityCloud Device Insecurity
Cloud Device Insecurity
 
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on AzureDevoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
 
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
 
Container Runtime Security with Falco
Container Runtime Security with FalcoContainer Runtime Security with Falco
Container Runtime Security with Falco
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 

Último

Último (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Csaba fitzl - Mount(ain) of Bugs

  • 1. Mount(ain) of Bugs Csaba Fitzl Twitter: @theevilbit
  • 2. whoami • author of "macOS Control Bypasses" at Offensive Security • ex red/blue teamer • macOS bug hunter • husband, father • hiking, trail running 🥾 🏔
  • 3. pwd
  • 4. agenda 1. MACF 2. the mount system call 3. disk arbitration service 4. CVE-2017-7170 (Patric Wardle) - Snif fi ng Authorization References 5. CVE-2017-2533 (pwn2own) - Mount yourself a root shell 6. CVE-2020-9771 - TCC bypass via snapshot mounting 7. CVE-2021-1784 - TCC bypass via mounting over com.apple.TCC 8. CVE-2021-30782 - TCC bypass via AppTranslocation service 9. CVE-2021-26089 - Fortinet Forticlient installer LPE 10. other tricks and new bugs
  • 6. MACF • origin: TrustedBSD MAC • implemented in kernel • policy modules extend the kernel • can place hooks in supported location • very powerful
  • 7. MACF • very - very powerful • was part of KDK till OS X 10.12 (never of fi cially supported) • mac.h header was removed • available in xnu: `security/mac.h`, `security/mac_framework.h`, `mac_vfs.h` • examples: AppleMobileFileIntegrity, Sandbox, EndpointSecurity, Quarantine (=Gatekeeper)
  • 8. MACF • typical callout from xnu: mac_......
  • 10. MACF • MAC_CHECK • iterates over all policy frameworks • mpo_... (mac_policy.h)
  • 12. VFS • macOS uses Virtual Filesystem Switch (VFS) • origin: Solaris • used in most *nix based systems • abstracts speci fi c fi le system implementation • MACF callouts at speci fi c points - hooked by the Sandbox
  • 15. diskarbitration - the basics • system wide service, de fi ned in: • /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist • XPC: com.apple.DiskArbitration.diskarbitrationd • manage disk mounting, unmounting • calls mount/unmount system calls under the hood
  • 16. diskarbitration - why we like it? • runs as root • unsandboxed • XPC service accessible from application sandbox • opensource
  • 17. diskarbitration - the checks • to prevent abuse, it has to con fi rm: • if the caller sandboxed • if the mount point owner == caller process owner (see CVE later) • DAServer.c • _DAServerSessionQueueRe quest function
  • 19. CVE-2017-7170 - credits • found by Patrick Wardle • details: https://objective-see.com/blog/blog_0x55.html
  • 20. CVE-2017-7170 - background • authorization can be passed between processes via AuthorizationExternalForm • security_authtrampoline • old method • executes privileged actions • uses external authorization reference
  • 21. CVE-2017-7170 - vulnerability • AuthorizationExecuteWithPrivileges wrote the external form out to $TMPDIR/random fi le • write - unlink quickly • if we can hold of the ref we can use it • but! we can unlink $TMPDIR and point it to somewhere else • RAMdisk • possibly also works by mounting over $TMPDIR
  • 22. CVE-2017-7170 - exploitation • we create a RAMdisk at $TMPDIR • wait for an authorization reference to be written • scan the raw RAMdisk for the token • use it once security_authtrampoline authorized it :)
  • 23. CVE-2017-2533 (pwn2own) - Mount yourself a root shell
  • 24. CVE-2017-2533 - credits • was found by the "phoenhex" team, Niklas Baumstark and Samuel Groß • part of the pwnown 2017 exploit chain • details: https://phoenhex.re/2017-06-09/pwn2own-diskarbitrationd- privesc
  • 25. CVE-2017-2533 - the vulnerability • disk arbitration service, (DARequest.c) • check if mount point exists • check if owned by the user (resolves path) • no further checks • TOCTOU
  • 26. CVE-2017-2533 - the exploit • race: • create a symlink pointing to a user owned directory • call diskarbitration • repoint the symlink to a root owned directory after the ownership check • if mount successful: stop • need to mount a disk image where the user has write access (EFI partition)
  • 27.
  • 28. CVE-2020-9771 - TCC bypass via snapshot mounting
  • 29. CVE-2020-9771 - the vulnerability • APFS supports snapshots • mount the snapshot in custom location, which falls outside of TCC's protection • access all fi les (read-only) • mount with ”noowners” access every user’s fi les
  • 30. CVE-2020-9771 - the fi x • snapshot mounting requires Full Disk Access => problem • even low privilege users can access other's fi le • under the hood: MACF callout
  • 31. CVE-2021-1784 - TCC bypass via mounting over com.apple.TCC
  • 32. CVE-2021-1784 -the vulnerability • base case: user’s TCC DB fi le is protected • but! We can mount over the directory • prepare a new TCC.db fi le, new disk image • mount over “~/Library/Application Support/com.apple.TCC” • pro fi t 🤑 • bug collision with: Mikko Kenttälä (@Turmio_)
  • 33.
  • 34. CVE-2021-30782 - TCC bypass via AppTranslocation service
  • 35. App Translocation • makes NULLFS mount (not copy) when downloaded app fi rst run • destination: $TMPDIR/AppTranslocation/d/d/Some.app • open source as part of Security. • library: libsecurity_translocate • binary: /usr/libexec/lsd
  • 36. CVE-2021-30782 - the vulnerability • Add Quarantine attribute to “Library” • Call the com.apple.security.translocation XPC service • (XPC client is also open source) • Map Library to $TMPDIR/AppTranslocation/d/d/Library • Access all fi les
  • 38.
  • 39. CVE-2021-30782 - the fi x • new sandbox checks • read - source • mount - destination • + sandbox check on mount point access
  • 41. CVE-2021-26089 • the installer uses several log fi les inside /tmp/ • one: fctinstallpost.log • being written as root • fi xed content
  • 42. CVE-2021-26089 • symlink attack • we can do arbitrary overwrite • code execution - ? • overwrite periodic scripts
  • 43. CVE-2021-26089 • the log will be treated as a script • each line is executed • pick: /Volumes/FortiClient/ fctdata/conf • make a DMG fi le, mount it, place a fi le at the above link • will be run as root
  • 44.
  • 46. trick • installer: writes fi les to: • /tmp/ fi xedname/bla/bla/bla • we can create a mount over /tmp/ fi xedname with noowners • during install we can modify any fi les • no race condition even if installer tries to delete /tmp/ fi xedname fi rst
  • 48. bugs to be fi xed • full TCC bypass • full sandbox escape • admin con fi g TCC bypass