Network Working Group J. Hodges Internet-Draft PayPal Intended status: Standards Track Feb 2013 Expires: August 5, 2013 Web Security Framework: Problem Statement and Requirements draft-ietf-websec-framework-reqs-00 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 August 5, 2013. Copyright Notice Copyright (c) 2013 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 August 5, 2013 [Page 1] Internet-Draft WebSec Framework Reqs Feb 2013 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 . . . . . . . . . . . . . . . . . . . . . 5 3. Overall Constraints . . . . . . . . . . . . . . . . . . . . . 5 4. Overall Requirements . . . . . . . . . . . . . . . . . . . . . 6 5. Vulnerabilities, Attacks, and Threats . . . . . . . . . . . . 8 5.1. Attacks . . . . . . . . . . . . . . . . . . . . . . . . . 8 5.2. Threats . . . . . . . . . . . . . . . . . . . . . . . . . 9 6. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . 9 7. Detailed Functional Requirements . . . . . . . . . . . . . . . 11 8. Extant Policies to Coalesce . . . . . . . . . . . . . . . . . 15 9. Example Concrete Approaches . . . . . . . . . . . . . . . . . 15 10. Security Considerations . . . . . . . . . . . . . . . . . . . 15 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 15 12. Informative References . . . . . . . . . . . . . . . . . . . . 19 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 21 Appendix B. Discussion References . . . . . . . . . . . . . . . . 21 B.1. Source: Attacks and Threats . . . . . . . . . . . . . . . 21 B.2. Source: Policy Expression Syntax [1] . . . . . . . . . . . 21 B.3. Source: Policy Expression Syntax [2] . . . . . . . . . . . 22 B.4. Source: Tooling . . . . . . . . . . . . . . . . . . . . . 22 B.5. Source: Performance . . . . . . . . . . . . . . . . . . . 23 B.6. Source: Granularity . . . . . . . . . . . . . . . . . . . 23 B.7. Source: Notifications and Reporting . . . . . . . . . . . 23 B.8. Source: Facilitating Separation of Duties . . . . . . . . 24 B.9. Source: Hierarchical Policy Application . . . . . . . . . 24 B.10. Source: Framing Policy Hierarchy, cross-origin, granularity . . . . . . . . . . . . . . . . . . . . . . . 24 B.11. Source: Policy Delivery [1] . . . . . . . . . . . . . . . 26 B.12. Source: Policy Delivery [2] . . . . . . . . . . . . . . . 26 B.13. Source: Policy Conflict Resolution . . . . . . . . . . . . 27 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 28 Hodges Expires August 5, 2013 [Page 2] Internet-Draft WebSec Framework Reqs Feb 2013 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 [RFC6797], 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 August 5, 2013 [Page 3] Internet-Draft WebSec Framework Reqs Feb 2013 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. [[ The author(s) understand that many of the references to web security issues are now somewhat dated and more recent work has appeared in the literature. Suggestions of references to use in superseding the ones herein are welcome; references to web security survey papers would be good. ]] 1.1. Where to Discuss This Draft Please disscuss this draft on the websec@ietf.org mailing list [WebSec]. Hodges Expires August 5, 2013 [Page 4] Internet-Draft WebSec Framework Reqs Feb 2013 2. Document Conventions NOTE: ..is a note to the reader. These are points that should be expressly kept in mind and/or considered. [[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 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 Hodges Expires August 5, 2013 [Page 5] Internet-Draft WebSec Framework Reqs Feb 2013 compromised [40]. In the next section we discuss various high-level requirements derived with the guidance of the latter tension points. 4. Overall Requirements 1. Policy conveyance: in-band: HTTP header(s) are already presently used to convey policy to user agents. However, devising generalized, extensible HTTP security header(s) such that the on-going "bloat" of the number of disjoint HTTP security headers is mitigated, is a stated requirement by various parties. Also, then there would be a documented framework that can be leveraged as new approaches and/or threats emerge. It may be reasonable to devise distinct sets of headers to convey different classes of policies, e.g., web application content policies (such as [W3C.CR-CSP-20121115]) versus web application network connection policies (such as [RFC6797]). out-of-band: An out-of-band 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 ofthe Secure DNS (DNSSEC) [32]. 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 (e.g., transparent proxy servers) as the protocols they ostensibly protect. 2. Granularity: In terms of granularity, vast arrays of stand-alone blog, wiki, hosted web account, and other "simple" web sites could Hodges Expires August 5, 2013 [Page 6] Internet-Draft WebSec Framework Reqs Feb 2013 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, to be effective for a broad array of web site and application types, some derived requirements are: the policy expression mechanism should fundamentally facilitate fine-grained control. For example, CSP [W3C.CR-CSP-20121115] offers such control. In order to address the less complex needs of the more simple classes of web sites, the policy expression mechanism should have some facility for enabling "canned policy profiles". In addition, 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 Hodges Expires August 5, 2013 [Page 7] Internet-Draft WebSec Framework Reqs Feb 2013 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 [RFC6797] suggests the former so-called "hard-fail" behavior. 5. Vulnerabilities, Attacks, and Threats This section enumerates vulnerabilities and attacks of concern, and then illustrates plausible threats that could result from exploitation of the vulnerabilities. The intent is to illustrate threats that ought to be mitigated by a web security policy framework. The definitions of vulnerability, attack, and threat used in this document are based on the definitions from [RFC4949], and are paraphrased here as: Vulnerability: A flaw or weakness in a system's design, implementation, or operation and management that could be exploited. Attack: An intentional act of vulnerability exploitation, usually characterized by one or more of: the method or technique used, and/or the point of initiation, and/or the method of delivery, etc. For example: active attack, passive attack, offline attack, Cross-site Scripting (XSS) attack, SQL injection attack, etc. Threat: Any circumstance or event with the potential to adversely affect a system and its user(s) through unauthorized access, destruction, disclosure, or modification of data, or denial of service. See also Appendix B.1 Source: Attacks and Threats. 5.1. Attacks These are some of the attacks which are desirable to mitigate via a web application security framework (see [WASC-THREAT] for a more complete taxonomy of attacks): Hodges Expires August 5, 2013 [Page 8] Internet-Draft WebSec Framework Reqs Feb 2013 1. Cross-site-scripting (XSS) [2] [WASC-THREAT-XSS] 2. Cross-Site-Request Forgery (CSRF) [WASC-THREAT-CSRF] 3. Response Splitting [WASC-THREAT-RESP] 4. User Interface Redressing [UIRedress], aka Clickjacking [Clickjacking]. 5. Man-in-the-middle (MITM) attacks against "secure" web applications, i.e., ones accessed using TLS/SSL [RFC5246] [WASC-THREAT-TLS] [SSLSTRIP]. 6. [[TODO2: more? (e.g. from [WASC-THREAT] ?) --JeffH]] 5.2. Threats Via attacks exploiting the vulnerabilities above, an attacker can.. 1. Obtain a victim's confidential web application credentials (e.g., via 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. 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 example use cases. Hodges Expires August 5, 2013 [Page 9] Internet-Draft WebSec Framework Reqs Feb 2013 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 insecure HTTP; 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. 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. Hodges Expires August 5, 2013 [Page 10] Internet-Draft WebSec Framework Reqs Feb 2013 7. [[TODO3: additional use cases to add? --JeffH]] 7. Detailed Functional Requirements Many of the below functional requirements are extracted from a discussion on the [public-web-security] mailing list (in early 2011). Particular messages are cited inline and appropriate quotes extracted and reproduced here. Inline citations are provided for definitions of various terms. The overall functional requirement categories are: 1. Policy mechanism scope 2. Policy expression syntax 3. Tooling 4. Performance 5. Granularity 6. Notifications and reporting 7. Facilitating Separation of Duties 8. Hierarchical Policy Application 9. Policy Delivery 10. Policy Conflict Resolution [[TODO4: additional functional requirement categories to add? --JeffH]] These requirements are discussed in more detail below: 1. Policy mechanism scope and extensibility: There is a current proliferation of orthogonal atomic mechanisms intended to solve very specific problems. 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; e.g., how to manage the gaps and intersections Hodges Expires August 5, 2013 [Page 11] Internet-Draft WebSec Framework Reqs Feb 2013 between the models. Thus the desire to have an extensible security policy mechanism that could evolve as the web evolves, and the threats that the web faces also evolve. For example, an extensibility model similar to HTML where the security protections could grown over time. See also Appendix B.2 Source: Policy Expression Syntax [1]. 2. Policy expression syntax: The policy expression syntax for a web security framework should be declarative [DeclLang] (and extensible, as noted above). This is for simplicity sake, as the alternative to declarative is procedural/functional, e.g., the class of language ECMAscript falls into. See also Appendix B.2 Source: Policy Expression Syntax [1], and, Appendix B.3 Source: Policy Expression Syntax [2]. 3. Tooling: We will need tools to (idealy) analyze a web application and generate an initial security policy. See also Appendix B.4 Source: Tooling. 4. Performance: Minimizing performance impact is a first-order concern. See also Appendix B.5 Source: Performance. 5. Granularity: For example, discriminate between: + "inline" script in versus , or not. + "inline" script and "src=" loaded script. + Classes of "content", e.g. scriptable content, passive multimedia, nested documents, etc. See also Appendix B.6 Source: Granularity. Hodges Expires August 5, 2013 [Page 12] Internet-Draft WebSec Framework Reqs Feb 2013 6. Notifications and Reporting: Convey to the user agent an identifier (e.g. a URI) denoting where to send policy violation reports. Could also specify a DOM event to be dedicated for this purpose. An ability to specify that a origin's policies are to be enforced in a "report only" mode will be useful for debugging policies as well as site-policy interactions. E.g. for answering the question: "does my policy 'break' my site?". See also Appendix B.7 Source: Notifications and Reporting. 7. Facilitating Separation of Duties: Specifically, allowing for Web Site operations/deployment personnel to apply site policy, rather then having it being encoded in the site implementation code by side developers/ implementors. See also Appendix B.8 Source: Facilitating Separation of Duties. 8. Hierarchical Policy Application: The notion that policy emitted by the application's source origin is able to constrain behavior and policies of contained origins. See also Appendix B.9 Source: Hierarchical Policy Application. 9. Framing Policy Hierarchy, cross-origin, granularity, auditability, roles: [[TODO5: Need more fully coalesce the source info from appendix into this item. --JeffH]] + "Framing" is a client-side instance notion, where webapp1's client-side instance (aka "document") loads another webapp, "webapp2", into an HTML