Browseraudit: Automated Testing of Browser Security Features

Total Page:16

File Type:pdf, Size:1020Kb

Browseraudit: Automated Testing of Browser Security Features ifact t * r * Comple t te A A n * te W E is s * e C n l l o D C A o * * c T BrowserAudit: Automated Testing u e m S s E u e S e n I R t v e o d t y * s E a * a l d u e a of Browser Security Features t Charlie Sergio Maffeis Chris Novakovic Hothersall-Thomas Department of Computing Department of Computing Netcraft Ltd, UK Imperial College London, UK Imperial College London, UK [email protected] [email protected] [email protected] ABSTRACT As such, browsers need to offer a variety of standardised The security of the client side of a web application relies on security mechanisms which can be relied upon uniformly browser features such as cookies, the same-origin policy and by the client side of web applications, in order to deliver HTTPS. As the client side grows increasingly powerful and security guarantees to their users. For example, the same- sophisticated, browser vendors have stepped up their offering origin policy (SOP) [34] is effective at preventing a range of security mechanisms which can be leveraged to protect of cross-site scripting (XSS) attacks [38] against users' web it. These are often introduced experimentally and informally browsers and is an integral aspect of modern web-based se- and, as adoption increases, gradually become standardised curity. On the other hand, it is sometimes excessively strict; (e.g., CSP, CORS and HSTS). Considering the diverse land- for instance, it forbids the sharing of information between scape of browser vendors, releases, and customised versions different subdomains, a common requirement of large web for mobile and embedded devices, there is a compelling need sites. It is also coarse-grained, and several attempts have for a systematic assessment of browser security. been made to enforce finer-grained access control [41, 39] We present BrowserAudit, a tool for testing that a de- and origins [22, 23, 29] in the browser. A variety of contem- ployed browser enforces the guarantees implied by the main porary web browsers implement the Cross-Origin Resource standardised and experimental security mechanisms. It in- Sharing (CORS) [46] standard, which may be used to control cludes more than 400 fully-automated tests that exercise the flow of information between server-side resources and a broad range of security features, helping web users, ap- client-side scripts that attempt to access those resources via plication developers and security researchers to make an APIs. However, even fully-compliant implementations of the informed security assessment of a deployed browser. We SOP and CORS mechanisms in some cases do not regulate validate BrowserAudit by discovering both fresh and known access to other resources, such as images, embedded objects security-related bugs in major browsers. and web fonts, that can leave web applications vulnerable to cross-site request forgery (CSRF) attacks [20], clickjack- ing [36], framebusting [43] and CSS-based attacks [33]. The Categories and Subject Descriptors Content Security Policy (CSP) standard [45] enables much D.4.6 [Operating systems]: Security and Protection finer-grained control over the loading of arbitrary resources on a web page, mitigating several of these issues. These Keywords are just some examples of established and emerging security mechanisms offered by modern browsers. Web security, web browser testing, same-origin policy, Con- Such mechanisms are often introduced experimentally and tent Security Policy, Cross-Origin Resource Sharing, click- informally. As adoption increases, they gradually become jacking, cookies standardised, and after numerous security reviews and bug reports they can eventually be relied upon consistently across 1. INTRODUCTION browsers [19, 37, 20]. Reaching that stage is not easy. For Personal data, business transactions, critical infrastruc- example, correctly implementing the CSP specification is non- ture and even cars, refrigerators and lightbulbs are exposed trivial: it is a lengthy document with many cross-references through web interfaces to a wide variety of web browsers. to other standards and RFCs, many of which have been su- Hence, the browser plays a key role in the modern information perseded by newer (and conflicting) standards and RFCs. It infrastructure, as the main gateway to access the information is possible that a browser vendor could incorrectly implement and capabilities made available online. some part of the CSP and thus fail to provide some of its security guarantees to their users. There is therefore a need for an automated tool that enables browser developers to complement low-level unit tests targeted at isolated source Permission to to make make digital digital or hard or hard copies copies of part of or all all ofor this part work of this for personal work for or code modules with high-level testing of the effectiveness of classroompersonal oruse classroom is granted without use is feegranted provided without that copies fee provided are not made that or copies distributed are the implementation of the security features once the browser fornot profit made or or commercial distributed advantage for profit and or that commercial copies bear thisadvantage notice and and the that full copies citation on the first page. Copyrights for third-party components of this work must be honored. is deployed. Forbear all this other notice uses, and contact the the full Owner/Author. citation on the first page. To copy otherwise, to In this paper we introduce BrowserAudit, a framework republish, to post on servers or to redistribute to lists, requires prior specific Copyright is held by the owner/author(s). for testing whether a deployed browser correctly enforces permission and/or a fee. ISSTA’15,, July July 12–17, 12–17, 2015, 2015, Baltimore, Baltimore, MD, MD, USA USA the security guarantees implied by the main standardised ACM.Copyright 978-1-4503-3620-8/15/07 2015 ACM 978-1-4503-3620-8/15/07 ...$15.00. http://dx.doi.org/10.1145/2771783.2771789 37 security mechanisms. For practical purposes, we present • We implemented the first fully-automated web application BrowserAudit as a standalone web application that auto- that comprehensively tests browser security features and matically tests the browser used to access it. BrowserAudit provides detailed information to a variety of user bases. has been designed with different sets of users in mind. A casual web user can run the tests to gain a simple secur- • We used BrowserAudit to discover previously unknown ity assessment of their browser: critically vulnerable, non- vulnerabilities in a major web browser. critically vulnerable, or okay. With the recent surge of se- curity breaches reported in the news, people are becoming 2. DESIGN OVERVIEW increasingly security-conscious and we believe there is an The goals underlying the design of BrowserAudit are the increasing demand for tools that inform the public about se- following: curity. A security researcher can benefit even more, viewing a detailed breakdown of each test result, and seeing which • Wide coverage: BrowserAudit should demonstrate that a security features passed our tests and which had problems. wide range of browser security mechanisms can be tested We display textual descriptions for each category of tests and automatically, reliably and efficiently. Complete test cov- the client-side source code of the tests. Browser developers erage of any such mechanism is not practically feasible, can use BrowserAudit to debug their security features and and beyond the scope of this project.1 web developers can use it as a way to ascertain the secur- ity capability of users' browsers (Section 2). We chose to • Extensibility: By its very nature, BrowserAudit will always implement a careful selection of tests that covers both the be a work in progress. As the browser threat landscape most important browser security mechanisms that should be evolves, more tests will be needed to cover new security implemented in any browser, and some of the most prom- mechanisms, or to extend the coverage of existing ones. ising experimental ones that are not yet widely implemented. Our design should ease the task of creating, debugging Starting from the code of individual test cases, we identified and integrating additional test cases. and generalised common patterns in order to automatically • Ease of use: BrowserAudit should be easily accessible on generate hundreds of tests. BrowserAudit automatically tests any modern browser connected to the Internet, without over 400 behaviours where a certain action should either be the need to install additional software. It should require allowed or blocked according to an implied browser security no interaction from the user, otherwise running hundreds policy (Section 3). of tests would be impractical. Moreover, relying on user We designed BrowserAudit to be efficient and scalable, interaction would prevent the desired aim of running the and we evaluated its performance and its accuracy extens- tests transparently in the background. ively by running it on a number of browsers and platforms. Using BrowserAudit, we have discovered several previously • Broad audience: Our design should support a diverse unknown security bugs in recent versions of Mozilla Firefox, range of users. A report on the security effectively offered which we have reported to the developers (Section 4.4). by a deployed browser should benefit browser developers, Whilst there are well-understood methodologies for gen- penetration testers, security researchers and web users. erating unit tests for a given code base, there is no general solution to the problem of testing the end-to-end security be- • Scalability: Our design should be scalable on the server haviour of a family of applications (in our case web browsers) side. Several users may be testing their browser at the that must respect precise interoperability constraints (web same time, and many security tests concern features that standards) but can widely differ in implementation architec- involve communicating with the server.
Recommended publications
  • Protecting Browser State from Web Privacy Attacks
    Protecting Browser State from Web Privacy Attacks Collin Jackson Andrew Bortz Stanford University Stanford University [email protected] [email protected] Dan Boneh John C Mitchell Stanford University Stanford University [email protected] [email protected] ABSTRACT malicious attackers is critical for privacy and security, yet Through a variety of means, including a range of browser this task often falls by the wayside in the push for function- cache methods and inspecting the color of a visited hyper- ality. link, client-side browser state can be exploited to track users An important browser design decision dating back to Net- against their wishes. This tracking is possible because per- scape Navigator 2.0 [10] is the \same-origin" principle, which sistent, client-side browser state is not properly partitioned prohibits web sites from different domains from interacting on per-site basis in current browsers. We address this prob- with another except in very limited ways. This principle lem by refining the general notion of a \same-origin" policy enables cookies and JavaScript from sites of varying trust- and implementing two browser extensions that enforce this worthiness to silently coexist on the user's browser without policy on the browser cache and visited links. interfering with each other. It is the failure to apply an ap- We also analyze various degrees of cooperation between propriate adaptation of the same-origin principle to all per- sites to track users, and show that even if long-term browser sistent browser state that is the source of the most alarming state is properly partitioned, it is still possible for sites to web privacy leaks.
    [Show full text]
  • Automated Cross-Browser Compatibility Testing
    Automated Cross-Browser Compatibility Testing ∗ Ali Mesbah Mukul R. Prasad Electrical and Computer Engineering Trusted Systems Innovation Group University of British Columbia Fujitsu Laboratories of America Vancouver, BC, Canada Sunnyvale, CA, USA [email protected] [email protected] ABSTRACT web browsers render web content somewhat differently [18, With the advent of Web 2.0 applications and new browsers, 24, 25, 26]. However, the scope and impact of this problem the cross-browser compatibility issue is becoming increas- has been rapidly growing due to two, fairly recent trends. ingly important. Although the problem is widely recognized First, modern, rich-content web applications have a heavy among web developers, no systematic approach to tackle client-side behavioral footprint, i.e., they are designed to ex- it exists today. None of the current tools, which provide ecute significant elements of their behavior exclusively on the screenshots or emulation environments, specifies any notion client-side, typically within the web browser. Further, tech- of cross-browser compatibility, much less check it automat- nologies such as Ajax [12], Flash, and event-handling for ically. In this paper, we pose the problem of cross-browser dynamic HTML, which support this thick-client behavior, compatibility testing of modern web applications as a `func- are the very aspects in which web browsers differ. tional consistency' check of web application behavior across Second, recent years have seen an explosion in the num- different web browsers and present an automated solution ber of available web browsers. There are nearly 100 different for it. Our approach consists of (1) automatically analyzing web browsers available today [31].
    [Show full text]
  • Cgi Environment Variables
    Appendix A CGI ENVIRONMENT VARIABLES The original specification for the Common Gateway Interface (CGI) established a list of environment variables, or aspects of the server and of the users connec- The complete CGI specification, http:// tion that would always be made known to CGI scripts. These variables remain a hoohoo.ncsa.uiuc.edu/cgi/ basic part of writing CGI scripts and have also been adopted in other server-side interface.html scripting languages, including server-side includes, ASP, and PHP. This list of the CGI environment variables below is annotated. SERVER_SOFTWARE The name and complete version information of the Web server software. Some server-side software adds itself to SERVER_SOFTWARE string. For example, Apache/1.3.26 (Unix) PHP/4.2.3. SERVER_NAME The servers domain name or IP address. GATEWAY_INTERFACE The version of the CGI specification in use. For example, CGI/1.1. CGI scripts are executable programs that can also be run as command-line programs on the server. The script can use the presence of a GATEWAY_INTERFACE environment variable to determine that it is being run as a CGI script. SERVER_PROTOCOL The communications protocol and version number used to request the script. For example, HTTP/1.1. SERVER_PORT Library Technology Reports The port number to which the request was sent. Sites running Web services on ports other than the default of 80 may want scripts to behave differently for users on different ports. REQUEST_METHOD The HTTP method used for the request. For example, GET or POST. A common use of this variable is have one script handle both the job of displaying a form to the user and of handling the forms submission.
    [Show full text]
  • Fingerprinting Information in Javascript Implementations
    Fingerprinting Information in JavaScript Implementations Keaton Moweryy, Dillon Bogenreif*, Scott Yilek*, and Hovav Shachamy yDepartment of Computer Science and Engineering *Department of Computer and Information Sciences University of California, San Diego University of St. Thomas La Jolla, California, USA Saint Paul, Minnesota, USA ABSTRACT employ additional means to identify the user and the sys- To date, many attempts have been made to fingerprint users tem she is using. Hardware tokens are appropriate in certain on the web. These fingerprints allow browsing sessions to be settings, but their cost and inconvenience form a barrier to linked together and possibly even tied to a user's identity. ubiquitous use. For such sites, browser and user fingerprints They can be used constructively by sites to supplement tra- form an attractive alternative to hardware tokens. On the ditional means of user authentication such as passwords; and (reasonable) assumption that typical users will usually log they can be used destructively to counter attempts to stay in from a single machine (or, at most, a handful), JavaScript anonymous online. fingerprinting allows sites to harden passwords against ac- In this paper, we identify two new avenues for browser fin- count hijacking with a minimum of user inconvenience. gerprinting. The new fingerprints arise from the browser's Destructively, fingerprints can also be used to identify JavaScript execution characteristics, making them difficult and track users, even when those users wish to avoid be- to simulate or mitigate in practice. The first uses the innate ing tracked. The most familiar browser fingerprinting tech- performance signature of each browser's JavaScript engine, nology is the cookie, a client-side datastore partitioned by allowing the detection of browser version, operating system domain and path.
    [Show full text]
  • Invasive Browser Sniffing and Countermeasures
    Invasive Browser Sniffing and Countermeasures Markus Jakobsson Sid Stamm Indiana University Indiana University Bloomington, Indiana USA Bloomington, Indiana USA [email protected] [email protected] ABSTRACT credentials; subjects in the control group received an email We describe the detrimental effects of browser cache/history appearing to come from an unknown person within the same sniffing in the context of phishing attacks, and detail an ap- domain as themselves. Even though the same statistics may proach that neutralizes the threat by means of URL person- not apply to the general population of computer users, it is alization; we report on an implementation performing such clear that it is a reasonably successful technique of luring personalization on the fly, and analyze the costs of and se- people to sites where their browsers silently will be interro- curity properties of our proposed solution. gated and the contents of their caches sniffed. Once a phisher has created an association between an email address and the contents of the browser cache/history, Categories and Subject Descriptors then this can be used to target the users in question with H.4.3 [Information Systems]: Communications Applica- phishing emails that – by means of context – appear plausi- tions—Information browsers ble to their respective recipients. For example, phishers can infer online banking relationships (as was done in [4]), and General Terms later send out emails appearing to come from the appro- priate financial institutions. Similarly, phishers can detect Security, Human Factors possible online purchases and then send notifications stating that the payment did not go through, requesting that the Keywords recipient follow the included link to correct the credit card Browser cache, cascading style sheets, personalization, phish- information and the billing address.
    [Show full text]
  • Intermediaries: Ways of Exploiting New Technologies a Number of New Technologies Have Emerged Recently, Such As HTML 4.0, CSS2.0, XML and HTTP 1.1
    Web Focus Corner: Intermediaries: Ways Of Exploiting New Technologies A number of new technologies have emerged recently, such as HTML 4.0, CSS2.0, XML and HTTP 1.1. Other new web technologies appear to be waiting, just around the corner. But we can't expect all users to upgrade to the latest version of their favourite browser. In this article Brian Kelly describes ways in which new technologies can be deployed. Since February 1998 HTML 4.0 [1], CSS 2.0[2], the Mathematical Markup Language MathML [3] and the Extensible Markup Language XML [4] have all become W3C Recommendations. These web protocols, all of which are concerned with the way in which information can be represented and displayed, were initially Working Drafts which were developed by the appropriate W3C Working Group. The Working Drafts were then made publicly available as W3C Proposed Recommendations. Following a review period the Proposed Recommendations were voted on by W3C member organisations. Following a successful vote, the Proposed Recommendations became Recommendations. But how widely used are these new web protocols? Today's web community, being so large and consisting of a majority who probably have little interest in the underlying web technologies, is reluctant to upgrade to new versions of browsers, due to a lack of knowledge, interest, technical skills or resources. More experienced web users remember the "browser wars" and the problems of being an early adopter of technologies. What are the implications of this conservatism? Can we simply ignore these new technologies? Revisiting the recommendations and looking at the new features they provide it would appear that we cannot afford to ignore these technologies if we wish to develop richer, more elegant and more maintainable web services.
    [Show full text]
  • The Unexpected Dangers of Dynamic Javascript
    The Unexpected Dangers of Dynamic JavaScript Sebastian Lekies, Ruhr-University Bochum; Ben Stock, Friedrich-Alexander-Universität Erlangen-Nürnberg; Martin Wentzel and Martin Johns, SAP SE https://www.usenix.org/conference/usenixsecurity15/technical-sessions/presentation/lekies This paper is included in the Proceedings of the 24th USENIX Security Symposium August 12–14, 2015 • Washington, D.C. ISBN 978-1-939133-11-3 Open access to the Proceedings of the 24th USENIX Security Symposium is sponsored by USENIX The Unexpected Dangers of Dynamic JavaScript Sebastian Lekies Ben Stock Martin Wentzel Ruhr-University Bochum FAU Erlangen-Nuremberg SAP SE [email protected] [email protected] [email protected] Martin Johns SAP SE [email protected] Abstract the fly. In turn, this enabled the transformation of the Web’s initial document-centric nature into the versatile Modern Web sites frequently generate JavaScript on-the- platform that we know today. fly via server-side scripting, incorporating personalized 2. Browser-driven Web front-ends: Furthermore, the user data in the process. In general, cross-domain access Web browser has proven to be a highly capable container to such sensitive resources is prevented by the Same- for server-provided user interfaces and application logic. Origin Policy. The inclusion of remote scripts via the Thanks to the flexible nature of the underlying HTML HTML script tag, however, is exempt from this policy. model and the power of client-side scripting via Java- This exemption allows an adversary to import and exe- Script, the server can push arbitrary user interfaces to the cute dynamically generated scripts while a user visits an browser that rival their counterparts of desktop applica- attacker-controlled Web site.
    [Show full text]
  • 8 Myths About Mobile Optimization
    8 MYTHS ABOUT MOBILE OPTIMIZATION EXPLORE THE MOST COMMON MISCONCEPTIONS AROUND BUILDING MOBILE FRIENDLY SITES Introduction Did you use Google today? What about Amazon, Twitter or Netflix? If so, you have benefitted from device detection technology. Far from being outdated, device detection is more important than ever as the web is becoming increasingly global and is consumed on a wide range of devices. These days, it’s truly a world-wide web. Some web users are using powerful desktop PCs with big screens and high speed fibre connections; others are using mobile devices with unreliable 3G, data connections or airport WiFi. To think that the same web experience will work well for both is delusional, not to mention bad for business. Device detection helps smooth out these bumps in the user experience by helping to tailor the experience to the user. Tailoring the user experience means happier users and wider market reach. In this guide we will help you understand why the top web brands are all using device detection to deliver world-class experiences on the web. Ronan Cremin, DeviceAtlas CTO 8 Mobile Optimization Myths Myth #1 You need a separate mobile URL, unless you use responsive design. Some people may think there are only two options for a mobile-optimized site: you either go responsive, or build a mobile site with a different URL. This opinion assumes that the mobile site must be a very basic, useless version of the desktop site making mobile users tap the ‘switch to desktop’ button as soon as they can find it.
    [Show full text]
  • HTML5 for Publishing Decision Makers: the Technology Behind the Scenes of Interactive Books Q&A Webinar
    webinar Q&A HTML5 for Publishing Decision Makers: The Technology Behind the Scenes of Interactive Books Unanswered Questions from the March 26, 2013 Live Event Respondents: Jean Kaplansky, Solutions Architect, Aptara | Maria Bartoszewicki, Director of Interactive eBooks, Aptara Moderator: Jeremy Greenfield, Digital Book World Question Answer Where can a publishing house get With regard to information for appropriate business models to distribute content, information on appropriate business Google is your friend here. The first thing you need to start looking at is information models for starting to distribute their about content strategy in general. Business rules and content strategy drive content digitally? Guidance in working requirements for creation, production, all the way through distribution. One of the contracts with authors, working with best ways to get an introduction to this aspect of working with eBooks and previously published books, etc. would interactive content is to attend conferences like DBW and TOCC, where things like be appreciated. contacts and working with previously published books are discussed in conference sessions and sometimes during keynote speeches. –JK What is your opinion on the continued If your business requirements and content strategy dictate that you are going to use of Flash for highly interactive distribute content to the iOS platform, then Flash should not be used. If distribution content? to mobile platforms is a known future business requirement, then project teams should start investigating whether or not they can implement an HTML5-based solution now in order to create interactive content that will not have to be completely converted or rewritten in the future.
    [Show full text]
  • Atlantis: Robust, Extensible Execution Environments for Web Applications
    Atlantis: Robust, Extensible Execution Environments for Web Applications James Mickens Mohan Dhawan Microsoft Research Rutgers University [email protected] [email protected] ABSTRACT variety of standards that define the software stack for web Today’s web applications run inside a complex browser en- applications [14, 19, 36, 52, 55]. In practice, the aggregate vironment that is buggy, ill-specified, and implemented in specification is so complex that it is difficult for any browser different ways by different browsers. Thus, web applications to implement it properly. To further complicate matters, that desire robustness must use a variety of conditional code browser vendors often add new features without consulting paths and ugly hacks to deal with the vagaries of their run- other vendors. Thus, each browser defines an idiosyncratic time. Our new exokernel browser, called Atlantis, solves JavaScript interpreter, HTML parser, and layout engine. this problem by providing pages with an extensible execu- tion environment. Atlantis defines a narrow API for basic These components are loosely compatible across different services like collecting user input, exchanging network data, vendors, but fine-tuning an application for multiple brows- and rendering images. By composing these primitives, web ers often means developing specialized application code in- pages can define custom, high-level execution environments. tended for just one browser. For example: Thus, an application which does not want a dependence on Atlantis’ predefined web stack can selectively redefine com- • Writing a portable web-based GUI is challenging be- ponents of that stack, or define markup formats and script- cause different browsers handle mouse and keyboard ing languages that look nothing like the current browser run- events in different, buggy ways (§2.4.1).
    [Show full text]
  • HTML5 Advertising Going Forward ������������������������������������������������������������325
    www.it-ebooks.info For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. www.it-ebooks.info Contents at a Glance Foreword ��������������������������������������������������������������������������������������������������������������������������� xix About the Author ��������������������������������������������������������������������������������������������������������������� xxi About the Technical Reviewer ����������������������������������������������������������������������������������������� xxiii Acknowledgments ������������������������������������������������������������������������������������������������������������ xxv Introduction �������������������������������������������������������������������������������������������������������������������� xxvii ■ Chapter 1: The Campaign Process �������������������������������������������������������������������������������������1 ■ Chapter 2: Evolution of Advertising Technology ��������������������������������������������������������������21 ■ Chapter 3: Advertising with Web Standards ��������������������������������������������������������������������37 ■ Chapter 4: Using Canvas, SVG, and Web Fonts ����������������������������������������������������������������61 ■ Chapter 5: Animations and Presentations �����������������������������������������������������������������������85 ■ Chapter 6: HTML5 APIs ��������������������������������������������������������������������������������������������������121
    [Show full text]
  • An Enhanced Sniffing Tool for Network Management
    IOSR Journal of Computer Engineering (IOSR-JCE) e-ISSN: 2278-0661,p-ISSN: 2278-8727, Volume 21, Issue 1, Ser. III (Jan - Feb 2019), PP 26-34 www.iosrjournals.org An enhanced Sniffing Tool for Network Management Bukie, P. T.1 Oyo-Ita, E.U.2Ideba, M. E.3 Oboyi, J.4 Department of Computer Science, University of Calabar Department of Computer Science, Cross River University of Technology, Calabar Department of Computer Science, University of Calabar Department of Mathematics, University of Calabar Corresponding Author: Bukie, P. T. Abstract:The use of packet sniffers is most effective in monitoring and troubleshootingcomputer networksagainst vulnerabilities mostly threaten data security and integrity. However, an initial investigation showed that the efficiency of existing packet sniffing platforms suffered setbacks in the areas of malware detection, platform dependency and user interface. As such, an easy graphical user interface (GUI) and minimal memory requirements were established asthe most essential features required to effectively monitor network activities. This report analyses the limitations of existing packet sniffing tools, using an Object- OrientedModelling (OOM) design methodology; in a bid to develop a platform independent tool with simpler GUI, better performance and security whereby a user can perform different routines built into the packet sniffing system by selecting the File or View menus for sub menus to appear for selection, in less time. -----------------------------------------------------------------------------------------------------------------------------
    [Show full text]