Thesis Statement: We Can Successfully Apply Operating System Principles to Secure and Enhance the Extensibility of the Web Platform
Total Page:16
File Type:pdf, Size:1020Kb
RETHINKING WEB PLATFORM EXTENSIBILITY BY MOHAN DHAWAN A dissertation submitted to the Graduate School—New Brunswick Rutgers, The State University of New Jersey in partial fulfillment of the requirements for the degree of Doctor of Philosophy Graduate Program in Computer Science Written under the direction of Vinod Ganapathy and approved by New Brunswick, New Jersey May, 2013 c 2013 MOHAN DHAWAN ALL RIGHTS RESERVED ABSTRACT OF THE DISSERTATION RETHINKING WEB PLATFORM EXTENSIBILITY by MOHAN DHAWAN Dissertation Director: Vinod Ganapathy The modern Web platform provides an extensible architecture that lets third party extensions, often untrusted, enhance and customize the Web browser and the Web applications. While the prevalence of extensions for both browsers and applications has been instrumental in making the Web browser hugely successful, there are two critical issues that the designers of the modern Web platform have not yet tackled in a principled manner. First, both the third party extensions and the extensible components of the Web platform include numerous vulnerabilities, which can compromise the security and privacy of end users. Second, the black-box and opaque nature of the Web platform limits the extent of extensibility achievable for Web developers, thereby hampering the development of novel browser-based user applications. This dissertation develops new tools and techniques to address the problem of insecure extensibility in the Web platform, proposes novel language and system level solutions to make extensibility a first class primitive for developing Web software, and demonstrates that these methods are applicable to real-world Web applications and Web browser extensions. Specifically, this dissertation makes the following three contributions. First, it studies and characterizes the problem of insecure JavaScript-based Web browser extensions using a spe- cialized program analysis system, Sabre, which leverages JavaScript-level information flow mechanism to detect violations in client’s confidentiality and integrity arising from execution of untrusted extensions. Second, it formalizes the concept of transactions for JavaScript and ii implements Transcript, a language runtime system that allows hosting principals, i.e., Web browser and Web applications, to isolate untrusted JavaScript-based extensions using specula- tive execution. Lastly, this dissertation presents the design and implementation of Atlantis, a novel, extensible browser architecture that allows Web applications to define their own runtime environment and become more secure and robust. Atlantis enables developers with primitives to manage the Web application’s security and privacy, and removes their dependence on opaque, legacy Web interfaces. iii Acknowledgements This dissertation would not have been possible without the contribution, encouragement, and guidance of a number of individuals. I would like to thank my graduate advisor Professor Vinod Ganapathy and co-advisor Pro- fessor Liviu Iftode. Vinod has been a constant source of inspiration and guidance. His insights and feedbacks have directly shaped several ideas in this dissertation. His passion for excel- lence in research has motivated me to work harder and has greatly influenced my personality. I have learned tremendously from my interactions with Liviu, whose words of encouragement and wisdom have helped me throughout my graduate career. I would not have been successful in this endeavor without the help of my advisors. I would also like to thank Professor Ulrich Kremer and Dr. Kapil Singh (IBM Research) for their insightful comments to help improve this dissertation. Over the past few years, I have also had the pleasure of working with several other out- standing people who have been instrumental in shaping my graduate career, and without their guidance this dissertation and several other research works would not have been successful. I would like to thank Professor Chung-chieh Shan (Indiana University) for enlightening me about the fundamentals of JavaScript, which has been central to this dissertation. I also had the honor and privilege of working closely with Professor Vern Paxson (UC Berkeley / ICSI Berkeley), Professor Renata Cruz Teixeira (LIP6 Paris), Dr. Christian Kreibich, Dr. Mark Allman and Dr. Nicholas Weaver (ICSI Berkeley). I have greatly benefited from their clear vision, infectious optimism, kind advice and insightful feedback. I am also thankful to Dr. James Mickens (Mi- crosoft Research Redmond) and Dr. Ulfar´ Erlingsson (Google) for giving me an opportunity to work with them. I have had the privilege of sharing my time at Rutgers with several excellent people. I want iv to acknowledge the many members of the DiscoLab who over the past six years have con- tributed their valuable time, ideas, and opinions to several projects, meetings and practice talks that were crucial to me. I especially thank Aniruddha Bohra, Arati Baliga, Steve Smaldone, Pravin Shankar, Lu Han, Shakeel Butt, Rezwana Karim, Amruta Gokhale, Liu Yang and Nader Boushehrinejadmoradi. I owe my deepest gratitude to my parents, my sister and my fiancee´ for their endless love and encouragement throughout this entire journey. My parents have always taken keen interest in my academic progress. It is because of their efforts that I had an excellent education and had the chance to make a career in computing. My sister, Roopam, taught me how to read and write, and without her dedication and affection I would not have reached this career milestone. I am also thankful to my fiancee,´ Sneha, for her patience while I was working on this dissertation. I attribute everything I have ever achieved to my family, who have supported me even when I doubted myself. Without them I would have struggled to find the inspiration and motivation needed to complete this dissertation. I thank my family and dedicate this dissertation to them. v Dedication To my family, for their endless support and encouragement. To Nanaji and Sanjiv bhaiya, who are deeply missed. vi Table of Contents Abstract ......................................... ii Acknowledgements ................................... iv Dedication ........................................ vi List of Tables ...................................... x List of Figures ...................................... xi 1. Introduction ..................................... 1 1.1. Motivation.....................................1 1.2. Securing Extensibility of the Web Platform...................2 1.3. Enhancing Extensibility of the Web Platform..................3 1.4. Contributions...................................5 1.5. Statement of Joint Work.............................6 2. The Web Ecosystem ................................. 7 2.1. Core Web Application Technologies and JavaScript...............7 2.2. Web Browser...................................8 I Securing Web Platform Extensibility 10 3. JavaScript-based Extensibility in the Web Platform ............... 11 3.1. Web Application Extensions........................... 11 3.2. Web Browser Extensions............................. 12 3.2.1. Google Chrome Extension Platform................... 13 3.2.2. Mozilla Jetpack.............................. 15 4. Characterizing JavaScript-based Web Browser Extensions ............ 18 4.1. Problem...................................... 18 4.2. Motivating Examples............................... 20 4.3. Our Approach: JavaScript-level Information Flow Tracking........... 23 4.3.1. Sabre in Action.............................. 24 4.3.2. Inadequacies of Prior Techniques.................... 25 4.4. Tracking Information Flow with Sabre...................... 26 4.4.1. Security Labels.............................. 27 4.4.2. Sources and Sinks............................ 29 4.4.3. Propagating Labels............................ 31 4.4.4. Declassifying and Endorsing Flows................... 34 vii 4.5. Implementation.................................. 35 4.6. Evaluation..................................... 36 4.6.1. Effectiveness............................... 36 4.6.2. Performance............................... 41 4.7. Related Work................................... 42 4.8. Summary..................................... 44 5. Language-based Security for Web Platform Extensions ............. 45 5.1. Problem...................................... 45 5.2. Motivating Example............................... 46 5.3. Our Approach: Speculative Execution of JavaScript............... 47 5.4. Overview of Transcript.............................. 48 5.5. A Lambda Calculus with Transactions...................... 54 5.5.1. Formalization............................... 54 5.5.2. Examples................................. 57 5.6. Design of Transcript............................... 60 5.6.1. Components of an Iblock......................... 63 5.6.2. Hiding Sensitive Variables........................ 66 5.7. Security Assurances................................ 67 5.7.1. Trusted Computing Base......................... 67 5.7.2. Whitelisting for Host Policies...................... 68 5.8. Implementation in Firefox............................ 69 5.8.1. Enhancements to SpiderMonkey..................... 69 5.8.2. Supporting Speculative DOM Updates.................. 73 5.8.3. Conflict Detection............................ 74 5.8.4. The <script> Tag........................... 75 5.9. Evaluation..................................... 76 5.9.1. Case Studies on Guest Benchmarks................... 76 5.9.2. Fault Injection and Recovery....................... 78 5.9.3.