Protection and Communication Abstractions for Web Browsers in MashupOS

Helen J. Wang Xiaofeng Fan Jon Howell Collin Jackson Research Microsoft Research Microsoft Research Stanford University Redmond, WA, USA Redmond, WA, USA Redmond, WA, USA Palo Alto, CA, USA [email protected] [email protected] [email protected] [email protected]

ABSTRACT evolved to be a multi-principal operating environment where mu- Web browsers have evolved from a single-principal platform on tually distrusting Web sites (as principals) interact programmati- which one site is browsed at a time into a multi-principal plat- cally in a single page on the client side, sharing the underlying form on which data and code from mutually distrusting sites in- browser resources. This resembles the PC operating environment teract programmatically in a single page at the browser. Today’s where mutually distrusting users share host resources. “Web 2.0” applications (or mashups) offer rich services, rivaling However, unlike PCs that utilize multi-user operating systems for those of desktop PCs. However, the protection and communication resource sharing, protection, and management, today’s browsers do abstractions offered by today’s browsers remain suitable only for not employ any operating system abstractions, but provide just a a single-principal system—either no trust through complete isola- limited all-or-nothing trust model and protection abstractions suit- tion between principals (sites) or full trust by incorporating third able only for a single-principal system: There is either no trust party code as libraries. In this paper, we address this deficiency across principals through complete isolation or full trust through by identifying and designing the missing abstractions needed for incorporating third party code as libraries. Consequently, Web pro- a browser-based multi-principal platform. We have designed our grammers are forced to make tradeoffs between security and func- abstractions to be backward compatible and easily adoptable. We tionality, and oftentimes sacrifice security for functionality. have built a prototype system that realizes almost all of our abstrac- In the MashupOS project, we aim to design and build a browser- tions and their associated properties. Our evaluation shows that our based multi-principal operating system. Among the myriad of op- abstractions make it easy to build more secure and robust client- erating system issues, we focus on the most imminent needs of side Web mashups and can be easily implemented with negligible today’s browsers: abstractions for protection and communication. performance overhead. The goal of protection is to prevent one principal from compro- mising the confidentiality and integrity of other principals, while communication allows them to interact in a controlled manner. Categories and Subject Descriptors We follow the principles below in designing our abstractions for D.4.6 [Operating Systems]: Security and Protection Web programmers: • Match all common trust levels: We must understand all the General Terms common trust levels between Web content providers and in- Design, Security, Standardization tegrators and aim to provide abstractions matching these lev- els of trust. Otherwise, Web programmers would face mak- Keywords ing tradeoffs among trust levels, either trusting more, and sacrificing security, or trusting less, and losing functionality. Browser, Web, same-origin policy, protection, communications, se- curity, multi-principal OS, abstractions • Strike a balance between ease-of-use and security: One might argue that a system is either secure or insecure and 1. INTRODUCTION there should be no middle ground. This may be true for designing a security system like an authentication system, Web browsers are becoming the single stop for everyone’s com- but not true when designing abstractions for programmers. puting needs including information access, personal communica- A rigid set of abstractions that tie programmers’ hands and tions, office tasks, and e-commerce. Today’s Web applications syn- limit flexibility for the purpose of better security often has thesize the world of data and code, offering rich services through a short life span, since programmers can build up libraries Web browsers and rivaling those of desktop PCs. Browsers have on the rigid interfaces to make their lives easy, resulting in a de facto abstraction for all programmers. It would be bet- ter for abstraction designers to design those abstractions with security in mind. Our goal here is to provide a full set of ab- Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are stractions and enable programmers to build robust and secure not made or distributed for profit or commercial advantage and that copies services that match their trust expectations (see above bullet), bear this notice and the full citation on the first page. To copy otherwise, to rather than to make it impossible for programmers to shoot republish, to post on servers or to redistribute to lists, requires prior specific themselves in the foot. permission and/or a fee. SOSP’07, October 14–17, 2007, Stevenson, Washington, USA. • Easy adoption and no unintended behaviors: Allowing easy Copyright 2007 ACM 978-1-59593-591-5/07/0010 ...$5.00. adoption is paramount in our abstraction design. We must ensure that our abstractions allow programmers to provide then describe a new access control policy that mashup authors are fallback mechanisms when Web pages using them are ren- demanding through existing proposals. dered by legacy browsers. We also must ensure that there are no undesirable interactions between new services and old 2.1 The Same-Origin Policy and the services in the new browser environment where our abstrac- All-or-Nothing Trust Model tions are supported. The same-origin Policy (SOP) governs the access control on to- day’s browsers. The SOP prevents documents or scripts loaded By analyzing the trust relationship between content providers from one origin from getting or setting properties of documents and integrators, we identify four types of content that require sup- from a different origin [38]. (The origin that a script is loaded is port from the Web and browsers: (1) isolated content that is in- the origin of the document that contains the script rather than the tended to be completely isolated from other sites (domains), (2) origin that hosts the script.) Two pages have the same origin if access-controlled content that is isolated but allows message pass- the protocol, port (if given), and host are the same for both pages. ing across domains to give mediated access to the content, (3) open Each browser window, , or