Network Working Group J. Hodges Internet-Draft PayPal Intended status: Standards Track Sep 8, 2011 Expires: March 11, 2012 Web Security Framework: Problem Statement and Requirements draft-hodges-websec-framework-reqs-01 Abstract Web-based malware and attacks are proliferating rapidly on the Internet. New web security mechanisms are also rapidly growing in number, although in an incoherent fashion. This document provides a brief overview of the present situation and the various seemingly piece-wise approaches being taken to mitigate the threats. It then provides an overview of requirements as presently being expressed by the community in various online and face-to-face discussions. Status of this Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on March 11, 2012. Copyright Notice Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of Hodges Expires March 11, 2012 [Page 1] Internet-Draft WebSec Framework Reqs Sep 2011 the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Where to Discuss This Draft . . . . . . . . . . . . . . . 4 2. Document Conventions . . . . . . . . . . . . . . . . . . . . . 4 3. Overall Constraints . . . . . . . . . . . . . . . . . . . . . 5 4. Overall Requirements . . . . . . . . . . . . . . . . . . . . . 6 5. Attacks and Threats to Address . . . . . . . . . . . . . . . . 7 5.1. Attacks . . . . . . . . . . . . . . . . . . . . . . . . . 8 5.2. Threats . . . . . . . . . . . . . . . . . . . . . . . . . 8 6. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . 9 7. Detailed Functional Requirements . . . . . . . . . . . . . . . 10 8. Extant Policies to Coalesce . . . . . . . . . . . . . . . . . 18 9. Example Concrete Approaches . . . . . . . . . . . . . . . . . 18 10. Security Considerations . . . . . . . . . . . . . . . . . . . 18 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18 12. Informative References . . . . . . . . . . . . . . . . . . . . 22 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 22 Hodges Expires March 11, 2012 [Page 2] Internet-Draft WebSec Framework Reqs Sep 2011 1. Introduction Over the past few years, we have seen a proliferation of AJAX-based web applications (AJAX being shorthand for asynchronous JavaScript and XML), as well as Rich Internet Applications (RIAs), based on so- called Web 2.0 technologies. These applications bring both luscious eye-candy and convenient functionality--e.g. social networking--to their users, making them quite compelling. At the same time, we are seeing an increase in attacks against these applications and their underlying technologies [1]. The latter include (but aren't limited to) Cross-Site-Request Forgery (CSRF) -based attacks [2], content- sniffing cross-site-scripting (XSS) attacks [3], attacks against browsers supporting anti-XSS policies [4], clickjacking attacks [5], malvertising attacks [6], as well as man-in-the-middle (MITM) attacks against "secure" (e.g. Transport Layer Security (TLS/SSL)-based [7]) web sites along with distribution of the tools to carry out such attacks (e.g. sslstrip) [8]. During the same time period we have also witnessed the introduction of new web security indicators, techniques, and policy communication mechanisms sprinkled throughout the various layers of the Web and HTTP. We have a new cookie security flag called HTTPOnly [9]. We have the anti-clickjacking X-Frame-Options HTTP header [10], the Strict-Transport-Security HTTP header [11], anti-CSRF headers (e.g. Origin) [12], an anti-sniffing header (X-Content-Type-Options: nosniff) [13], various approaches to content restrictions [14] [15] and notably Mozilla Content Security Policy (CSP; conveyed via a HTTP header) [16], the W3C's Cross-Origin Resource Sharing (CORS; also conveyed via a HTTP header) [17], as well as RIA security controls such as the crossdomain.xml file used to express a site's Adobe Flash security policy [18]. There's also the Application Boundaries Enforcer (ABE) [19], included as a part of NoScript [20], a popular Mozilla Firefox security extension. Sites can express their ABE rule-set at a well-known web address for downloading by individual clients [21], similarly to Flash's crossdomain.xml. Amidst this haphazard collage of new security mechanisms at least one browser vendor has even devised a new HTTP header that disables one of their newly created security features: witness the X-XSS-Protection header that disables the new anti-XSS features [22] in Microsoft's Internet Explorer 8 (IE8). Additionally, there are various proposals aimed at addressing other facets of inherent web vulnerabilities, for example: JavaScript postMessage-based mashup communications [23], hypertext isolation techniques [24], and service security policies advertised via the Domain Name System (DNS) [25]. Going even further, there are efforts to redesign web browser architectures [26], of which Google Chrome and IE8 are deployed examples. An even more radical approach is Hodges Expires March 11, 2012 [Page 3] Internet-Draft WebSec Framework Reqs Sep 2011 exhibited in the Gazelle Web Browser [27], which features a browser kernel embodied in a multi-principal OS construction providing cross- principal protection and fair sharing of all system resources. Not to be overlooked is the fact that even though there is a plethora of "standard" browser security features--e.g. the Same Origin Policy (SOP), network-related restrictions, rules for third-party cookies, content-handling mechanisms, etc. [28]--they are not implemented uniformly in today's various popular browsers and RIA frameworks [29]. This makes life even harder for web site administrators in that allowances must be made in site security posture and approaches in consideration of which browser a user may be wielding at any particular time. Although industry and researchers collectively are aware of all the above issues, we observe that the responses to date have been issue- specific and uncoordinated. What we are ending up with looks perhaps similar to Frankenstein's monster [30]--a design with noble intents but whose final execution is an almost-random amalgamation of parts that do not work well together. It can even cause destruction on its own [31]. Thus, the goal of this document is to define the requirements for a common framework expressing security constraints on HTTP interactions. Functionally, this framework should be general enough that it can be used to unite the various individual solutions above, and specific enough that it can address vulnerabilities not addressed by current solutions, and guide the development of future mechanisms. Overall, such a framework would provide web site administrators the tools for managing, in a least privilege [33] manner, the overall security characteristics of their web site/applications when realized in the context of user agents. 1.1. Where to Discuss This Draft Please disscuss this draft on the websec@ietf.org mailing list [WebSec]. 2. Document Conventions Note: ..is a note to the reader. These are points that should be expressly kept in mind and/or considered. [[XXXn: Some of the more major known issues are marked like this (where "n" in "XXXn" is a number). --JeffH]] Hodges Expires March 11, 2012 [Page 4] Internet-Draft WebSec Framework Reqs Sep 2011 [[TODOn: Things to fix (where "n" in "TODOn" is a number). --JeffH]] We will also be making use of the WebSec WG issue tracker, so use of the above two issue & TODO marks will evolve accordingly. 3. Overall Constraints Regardless of the overall approaches chosen for conveying site security policies, we believe that to be deployed at Internet-scale, and to be as widely usable as possible for both novice and expert alike, the overall solution approach will need to address these three points of tension: Granularity: There has been much debate during the discussion of some policy mechanisms (e.g. CSP) as to how fine-grained such mechanisms should be. The argument against fine-grained mechanisms is that site administrators will cause themselves pain by instantiating policies that do not yield the intended results. E.g. simply copying the expressed policies of a similar site. The claim is that this would occur for various reasons stemming from the mechanisms' complexity [34]. Configurability: Not infrequently, the complexity of underlying facilities, e.g. in server software, is not well-packaged and thus administrators are obliged to learn more about the intricacies of these systems than otherwise might be necessary. This is sometimes used as an argument for "dumbing down" the capabilities of policy expression mechanisms [34]. Usability: Research shows that when security warnings are displayed, users are often given too much information as well as being allowed to relatively easily bypass the warnings and continue with their potentially compromising activity [35] [36] [37] [38] [39]. Thus users have become trained to "click through" security notifications "in order to get work done", though not infrequently rendering themselves insecure and perhaps compromised [40]. In the next section we discuss various high-level requirements derived with the guidance of the latter tension points. Hodges Expires March 11, 2012 [Page 5] Internet-Draft WebSec Framework Reqs Sep 2011 4. Overall Requirements 1. Policy conveyance: in-band: We believe that a regime based on HTTP header(s) is appropriate. However we must devise a generalized, extensible HTTP security header(s) such that the on-going "bloat" of the number of disjoint HTTP security headers is mitigated and there is a documented framework that we can leverage as new approaches and/or threats emerge. Note: The distinction between in-band and out-of-band signaling is difficult to characterize because some seemingly out-of-band mechanisms rely on the same protocols (HTTP/HTTPS) and infrastructure (transparent proxy servers) as the protocols they ostensibly protect. It may be reasonable to devise a small set of headers to convey different classes of policies, e.g. web application content policies versus web application network capabilities policies. out-of-band: This policy communication mechanism must be secure and should have two facets, one for communicating securely out- of-band of the HTTP protocol to allow for secure client policy store bootstrapping. potential approaches are factory-installed web browser configuration, site security policy download a la Flash's crossdomain.xml and Maone's ABE for Web Authors [21], and DNS-based policy advertisement leveraging the security of DNS Security (DNSSEC) [32]. 2. Granularity: In terms of granularity, vast arrays of stand-alone blog, wiki, hosted web account, and other "simple" web sites could ostensibly benefit from relatively simple, pre-determined policies. However, complex sites--e.g. payment, ecommerce, software-as-a-service, mashup sites, etc.--often differ in various ways, as well as being inherently complex implementation-wise. One-size-fits-all policies will generally not work well for them. Thus, we believe that to be effective for a broad array of web site and application types, Hodges Expires March 11, 2012 [Page 6] Internet-Draft WebSec Framework Reqs Sep 2011 the policy expression mechanism must fundamentally facilitate fine-grained control. For example, CSP offers such control. In order to address the less complex needs of the more simple classes of web sites, the policy expression mechanism could have a "macro"-like feature enabling "canned policy profiles". Or, the configuration facilities of various components of the web infrastructure can be enhanced to provide an appropriately simple veneer over the complexity. 3. Configurability: With respect to configurability, development effort should be applied to creating easy-to-use administrative interfaces addressing the simple cases, like those mentioned above, while providing advanced administrators the tools to craft and manage fine-grained multi-faceted policies. Thus more casual or novice administrators can be aided in readily choosing, or be provided with, safe default policies while other classes of sites have the tools to craft the detailed policies they require. Examples of such an approach are Microsoft's "Packaging Wizard" [41] that easily auto-generates a quite complicated service deployment descriptor on behalf of less experienced administrators, and Firefox's simple Preferences dialog [42] as compared to its detailed about:config configuration editor page [43]. In both cases, simple usage by inexperienced users is anticipated and provided for on one hand, while complex tuning of the myriad underlying preferences is provided for on the other. 4. Usability: Much has been learned over the last few years about what does and does not work with respect to security indicators in web browsers and web pages, as noted above, these lessons should be applied to the security indicators rendered by new proposed security mechanisms. We believe that in cases of user agents venturing into insecure situations, their response should be to fail the connections by default without user recourse, rather than displaying warnings along with bypass mechanisms, as is current practice. For example, the Strict Transport Security specification stipulates the former hard-fail behavior. 5. Attacks and Threats to Address This section enumerates various attacks and threats that ought to be mitigated by a web security policy framework. In terms of defining Hodges Expires March 11, 2012 [Page 7] Internet-Draft WebSec Framework Reqs Sep 2011 threats in contrast to attacks, Lucas supplied this: <"Re: More on XSS mitigation (was Re: XSS mitigation in browsers)" (Lucas Adamski). http://lists.w3.org/Archives/Public/ public-web-security/2011Jan/0089.html> "... There's a fundamental question about whether we should be looking at these problems from an attack vs threat standpoint. An attack is XSS [or CSRF, or Response Splitting, etc.]. A threat is that an attacker could compromise a site via content injection to trick the user to disclosing confidential information (by injecting a plugin or CSS to steal data or fool the user into sending their password to the attacker's site). ..." 5.1. Attacks The below attacks should be possible to mitigate via a web application security framework (see [44] for a definition and taxonomy of attacks): 1. cross-site-scripting (XSS) [2] [44] 2. Man-in-the-middle (MITM) attacks against "secure" (e.g. Transport Layer Security (TLS/SSL)-based [7] [8] [44]) web sites. For example, be able to subsume the HSTS header [11]. 3. Cross-Site-Request Forgery (CSRF) [3] [44] (?) 4. Response Splitting [44] 5. more (ie eg from [44] ?) ? 5.2. Threats Via the attacks above, an attacker can.. 1. Obtain a victim's confidential web application credentials (e.g. cookie theft), and use the credentials to impersonate the victim and enter into transactions, often with the aim of monetizing the transaction results to the attacker's benefit. 2. Insert themselves as a Man-in-the-Middle (MITM) between victim and various services, thus is able to instigate, control, intercept, and attempt to monetize various transactions and interactions with web applications, to the benefit of the attacker. Hodges Expires March 11, 2012 [Page 8] Internet-Draft WebSec Framework Reqs Sep 2011 3. Enumerate various user agent information stores, e.g. browser history, facilitating views of the otherwise confidential habits of the victim. This information could possibly be used in various offline attacks against the victim directly, e.g. blackmail, denial of services, law enforcement actions, etc. 4. Use gathered information and credentials to construct and present a falsified persona of the victim (e.g. for character assassination). There is a risk of exfiltration of otherwise confidential victim information with all the threats listed above. 6. Use Cases This section outlines various concrete use cases. Where applicable, source email messages are cited. 1. I'm a web application site administrator. My web app includes static user-supplied content (e.g. submitted from user agents via HTML FORM + HTTP POST), but either my developers don't properly sanitize user-supplied content in all cases or/and content injection vulnerabilities exist or materialize (for various reasons). This leaves my web app vulnerable to cross-site scripting. I wish I could set overall web app-wide policies that prevent user- supplied content from injecting malicious content (e.g. JavaScript) into my web app. 2. I'm a web application site administrator. My web application is intended, and configured, to be uniformly served over HTTPS, but my developers mistakenly keep including content via insecure channels (e.g. via HTTP-only; resulting in so-called "mixed content"). I wish I could set a policy for my web app that prevents user agents from loading content insecurely even if my web app is otherwise telling them to do so. 3. I'm a web application site administrator. My site has a policy that we can only include content from certain trusted providers (e.g., our CDN, Amazon S3), but my developers keep adding dependencies on origins I don't trust. I wish I could set a policy for my site that prevents my web app from accidentally loading resources outside my whitelist. Hodges Expires March 11, 2012 [Page 9] Internet-Draft WebSec Framework Reqs Sep 2011 4. I'm a web application site administrator. I want to ensure that my web app is never framed by other web apps. 5. I'm a developer of a web application which will be included (i.e. framed) by third parties within their own web apps. I would like to ensure that my web app directs user agents to only load resources from URIs I expect it to (possibly even down to specific URI paths), without affecting the containing web app or any other web apps it also includes. 6. I'm a web application site administrator. My web app frames other web apps whose behavior, properties, and policies are not 100% known or predictable. I need to be able to apply policies that both protect my web app from potential vulnerabilities or attacks introduced by the framed web apps, and that work to ensure that the desired interactions between my web app and the framed apps are securely realized. 7. Detailed Functional Requirements Many of the below functional requirements are extracted from a recent discussion on the [public-web-security] list. Particular messages are cited inline and appropriate quotes extracted and reproduced here. Inline citations are provided for definitions of various terms. 1. Policy expression syntax: * Declarative. <"declarative languages". http://www.encyclopedia.com/ doc/1O11-declarativelanguages.html> * Extensible. <"Extensibility". https://secure.wikimedia.org/wikipedia/en/wiki/Extensible> <"Re: XSS mitigation in browsers" (Lucas Adamski). http:// lists.w3.org/Archives/Public/public-web-security/2011Jan/ 0066.html> "On a conceptual level, I am not really a believer in the current proliferation of orthogonal atomic mechanisms intended to solve very specific problems. Security is a Hodges Expires March 11, 2012 [Page 10] Internet-Draft WebSec Framework Reqs Sep 2011 holistic discipline, and so I'm a big supporter of investing in an extensible declarative security policy mechanism that could evolve as the web and the threats that it faces do. Web developers have a hard enough time with security already without being expected to master a potentially large number of different security mechanisms, each with their own unique threat model, implementation and syntax. Not to mention trying to figure out how they're expected to interact with each other... how to manage the gaps and intersections between the models." <"Re: Scope and complexity (was Re: More on XSS mitigation)" (Adam Barth). http://lists.w3.org/Archives/Public/ public-web-security/2011Jan/0108.html> "I guess I wish we had an extensibility model more like HTML where we could grow the security protections over time. For example, we can probably agree that both and