Automated Evaluation of Access Control in the Iphone Operating System
Total Page:16
File Type:pdf, Size:1020Kb
ABSTRACT DESHOTELS, LUKE ALEC. Automated Evaluation of Access Control in the iPhone Operating System. (Under the direction of William Enck). A decade long arms race between Apple and jailbreakers has forged iPhone OS (iOS) into a hardened, but complex operating system. As a modern operating system, iOS treats applications as security principals, which allows for fine-grained access control policies that prevent applications from having the same authority as the device owner. However, iOS and other modern operating systems use inter-dependent access control mechanisms (e.g., Unix permissions and sandboxing), and the policies on iOS may be closed-source, proprietary, or decentralized. This practice makes it difficult to model the actual privileges of an iOS process which is subject to various undocumented access control policies. Confusion regarding these privileges hides flaws in misconfigured iOS access control policies that attackers can exploit in order to invade user privacy or damage the system. This dissertation demonstrates that the access control mechanisms in iOS are inter-dependent and their analysis should consider the composite protection system as a whole. We analyze three access control systems in iOS, the Apple Sandbox, Unix Permissions, and Inter-Process Communi- cation (IPC). First, we present the SandScout framework which converts iOS Apple Sandbox policies from their compiled proprietary state into queriable Prolog facts. SandScout’s utility is demonstrated by detecting seven types of novel vulnerabilities allowing third party apps to steal private data or damage the system, which resulted in six Common Vulnerability and Exposure (CVE) acknowl- edgements from Apple. Second, we introduce iOracle, a logical framework for extracting multiple access control policies (i.e., the Apple Sandbox and Unix Permissions) as well as runtime context from iOS and unifying this policy and contextual data into a composite model. iOracle is evaluated through detection of previously known exploits as well as detection of unknown policy flaws. Finally, we propose Kobold, a framework for enumerating and evaluating IPC remote methods accessible by third party applications. Access to these remote methods is regulated by the Apple Sandbox and static capabilities called entitlements. Therefore, Kobold also automates the collection and extraction of third party application entitlements. During this analysis Kobold discovers third party applications with undocumented, semi-private entitlements. Kobold identifies over one hundred accessible methods and detects previously unknown access control flaws and daemon crashes. © Copyright 2018 by Luke Alec Deshotels All Rights Reserved Automated Evaluation of Access Control in the iPhone Operating System by Luke Alec Deshotels A dissertation submitted to the Graduate Faculty of North Carolina State University in partial fulfillment of the requirements for the Degree of Doctor of Philosophy Computer Science Raleigh, North Carolina 2018 APPROVED BY: Bradley Reaves Alexandros Kapravelos Matthias Stallmann William Enck Chair of Advisory Committee DEDICATION This dissertation is dedicated to my parents for their unwavering love and support. ii BIOGRAPHY Luke received his Bachelor’s and Master’s from the University of Louisiana at Lafayette where he studied computer vision and malware analysis. He started the PhD program at NCSU in order to study Android malware with Dr. Xuxian Jiang. However, through a serendipitous series of events involving significant help from Dr. Purush Iyer, ultrasonic sound-waves, and an extra-credit report on OS verification, Luke started studying the iOS sandbox with Dr. William Enck. It’s a long story that won’t be told here, but Luke has no regrets with the way things turned out. iii ACKNOWLEDGEMENTS I could have never made it this far on my own. In my darkest moments of paper rejections, technical setbacks, and bureaucratic nightmares, I was never alone. Along my journey there was always help in the forms of loving support, writing advice, and technical contributions. In addition to my committee members, Bradley Reaves, Alexandros Kapravelos, and Matthias Stallmann, I must thank my advisor, co-authors, labmates, and friends who have given so much and asked nothing in return. First, I must thank my advisor, William Enck. I have been Will’s teaching assistant, student, and apprentice. As Will’s teaching assistant, he demonstrated his fairness and professionalism as we handled issues of academic integrity together. As his student, I learned exactly the information I would need to win and thrive in computer security internships. As an apprentice, I learned to write, design experiments, analyze results, present research, and collaborate with other universities. Will has been generous with his knowledge, time, and introductions, and at every stage of my academic career, Will has acted as my role model. Second, I owe much to my co-authors, especially Razvan Deaconescu who has given so much more time and brilliance than I deserved. Razvan Deaconescu reversed the Apple sandbox, and made many other technical contributions. It was Razvan that found our first vulnerability and inspired the team to keep pursuing iOS access control. Mihai Chiroiu hosted me at Politehnica University of Bucharest and helped us keep an eye on the bigger picture beyond just iOS. Costin Carabas was instrumental to discovering the correct syntax to invoke NSXPC methods on iOS, and he contributed in many other ways to iOracle and Kobold. Iulia Manda contributed to our knowledge of mach-ports and sandbox extensions and was kind enough to find me during my brief visit to Romania. Lucas-Davi contributed his expertise of iOS and writing skill to SandScout. Ahmad-Reza Sadeghi hosted me at TU Darmstadt and provided significant insight and style to our papers. It was Ahmad that put our team together and introduced me to Razvan, Mihai, and Lucas. Finally, Ninghui-Li contributed his expertise of access control analysis to iOracle. Third, I would like to acknowledge my labmates for their support and advice throughout my time in the WSPR lab. Micah Bushouse has been my greatest critic, but he has also been a true friend and a source of wisdom and encouragement. Isaac Polinsky has been a friend and one of the most entertaining people in the lab. Ben Andow started his PhD program in the same year as me, and has given me many insights into low level sytem’s research. Ben and I often joked that our research topics should have been reversed. Sigmund "Al" Gorski shared his relevant knowledge of Android access control analysis, and he was a great roommate during our Qualcomm internship. Adwait Nadkarni was a great verbal sparring partner and lead graduate student. I look forward to working at Samsung with Akash Verma, Michael Grace, and Kunal Patel. Jason Gionta inspired me to ask many questions. I enjoyed exercising and discussing shared hobbies with Russell Meredith. Sarah iv Elder provided wisdom and news from outside the lab. Sanghyun went to great lengths to make me feel at home during my trip to Korea. Kyle Martin gave me insights into fuzzing, crashes, and memory exploitation. I would like to thank the other current and past members of the WSPR lab for their company, advice, and hard work. Finally, I am honored to list many friends that helped me throughout my PhD. Rusty Gibson contributed his time and expertise to a very fun side project on steganography in video games. Sean Mealin, Peipei Wang, Sheldon Abrams, Barry Peddicord, and Aurora Peddicord provided advice as students themselves, and they were excellent gaming partners. Feifei Wang was very kind to me and introduced me to many more friends. David Fiala helped recruit me to NCSU and encouraged me to persist through hard times. Most of all, I would like to thank Xiaoting "Sisi" Fu, for her patience and love throughout the ups and downs of my final year as a PhD student. Lastly, I thank Noodle, the cat, for listening to explanations of iOS access control policies when I needed an audience. v TABLE OF CONTENTS LIST OF TABLES ......................................................... ix LIST OF FIGURES ........................................................ x Chapter 1 INTRODUCTION .............................................. 1 1.1 Thesis Statement.................................................. 2 1.2 Contributions .................................................... 5 1.3 Thesis Organization................................................ 6 Chapter 2 Background .................................................. 9 2.1 Introduction ..................................................... 9 2.2 iOS Basics ....................................................... 11 2.3 Entitlements ..................................................... 12 2.3.1 Policy..................................................... 12 2.3.2 Enforcement ............................................... 13 2.4 Sandboxing...................................................... 14 2.4.1 Policy..................................................... 14 2.4.2 Enforcement ............................................... 16 2.5 Privacy Settings................................................... 17 2.5.1 Policy..................................................... 19 2.5.2 Enforcement ............................................... 20 2.6 Conclusions...................................................... 21 Chapter 3 Related Work ................................................. 22 3.1 Access Control Policy Design ........................................