idnits 2.17.1 draft-west-leave-secure-cookies-alone-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document doesn't use any RFC 2119 keywords, yet seems to have RFC 2119 boilerplate text. -- The document date (November 5, 2015) is 3094 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTPbis M. West 3 Internet-Draft Google, Inc 4 Updates: 6265 (if approved) November 5, 2015 5 Intended status: Standards Track 6 Expires: May 8, 2016 8 Deprecate modification of 'secure' cookies from non-secure origins 9 draft-west-leave-secure-cookies-alone-02 11 Abstract 13 This document updates RFC6265 by removing the ability for a non- 14 secure origin to set cookies with a 'secure' flag, and to overwrite 15 cookies whose 'secure' flag is set. This deprecation improves the 16 isolation between HTTP and HTTPS origins, and reduces the risk of 17 malicious interference. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on May 8, 2016. 36 Copyright Notice 38 Copyright (c) 2015 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 54 2. Terminology and notation . . . . . . . . . . . . . . . . . . 2 55 3. Recommendations . . . . . . . . . . . . . . . . . . . . . . . 2 56 4. Security Considerations . . . . . . . . . . . . . . . . . . . 4 57 5. References . . . . . . . . . . . . . . . . . . . . . . . . . 4 58 5.1. Normative References . . . . . . . . . . . . . . . . . . 4 59 5.2. Informative References . . . . . . . . . . . . . . . . . 4 60 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 4 61 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 5 63 1. Introduction 65 Section 8.5 and Section 8.6 of [RFC6265] spell out some of the 66 drawbacks of cookies' implementation: due to historical accident, 67 non-secure origins can set cookies which will be delivered to secure 68 origins in a manner indistinguishable from cookies set by that origin 69 itself. This enables a number of attacks, which have been recently 70 spelled out in some detail in [COOKIE-INTEGRITY]. 72 We can mitigate the risk of these attacks by making it more difficult 73 for non-secure origins to influence the state of secure origins. 74 Accordingly, this document recommends the deprecation and removal of 75 non-secure origins' ability to write cookies with a 'secure' flag, 76 and their ability to overwrite cookies whose 'secure' flag is set. 78 2. Terminology and notation 80 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 81 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 82 document are to be interpreted as described in [RFC2119]. 84 The "scheme" component of a URI is defined in Section 3 of [RFC3986]. 86 3. Recommendations 88 This document updates Section 5.3 of [RFC6265] as follows: 90 1. After step 8 of the current algorithm, which sets the cookie's 91 "secure-only-flag", execute the following step: 93 1. If the "scheme" component of the "request-uri" does not 94 denote a "secure" protocol (as defined by the user agent), 95 and the cookie's "secure-only-flag" is "true", then abort 96 these steps and ignore the newly created cookie entirely. 98 2. Before step 11, execute the following step: 100 1. If the newly created cookie's "secure-only-flag" is not set, 101 and the "scheme" component of the "request-uri" does not 102 denote a "secure" protocol, then abort these steps and ignore 103 the newly created cookie entirely if the cookie store 104 contains one or more cookies that meet all of the following 105 criteria: 107 1. Their "name" matches the "name" of the newly created 108 cookie. 110 2. Their "secure-only-flag" is set. 112 3. Their "domain" domain-matches the "domain" of the newly 113 created cookie, or vice-versa. 115 Note: This comparison intentionally ignores the "path" 116 component. The intent is to allow the "secure" flag to 117 supercede the "path" restrictions to protect sites against 118 cookie fixing attacks. 120 Note: This allows "secure" pages to override "secure" cookies 121 with non-secure variants. Perhaps we should restrict that as 122 well? 124 3. Adjust the eviction priority order at the bottom of Section 5.3 125 to be the following: 127 1. Expired cookies. 129 2. Cookies whose "secure-only-flag" is not set. 131 3. Cookies that share a "domain" field with more than a 132 predetermined number of other cookies. 134 4. All cookies. 136 Note: This means that we'd remove every non-secure cookie for 137 every origin before removing any non-expired secure cookie. That 138 seems like a good reason for sites to prefer the "secure" flag. 140 4. Security Considerations 142 This specification increases a site's confidence that secure cookies 143 it sets will remain unmodified by insecure pages on hosts which it 144 domain-matches. Ideally, sites would use HSTS as described in 145 [RFC6797] to defend more robustly against the dangers of non-secure 146 transport in general, but until adoption of that protection becomes 147 ubiquitous, this deprecation this document recommends will mitigate a 148 number of risks. 150 5. References 152 5.1. Normative References 154 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 155 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 156 RFC2119, March 1997, 157 . 159 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 160 Resource Identifier (URI): Generic Syntax", STD 66, RFC 161 3986, DOI 10.17487/RFC3986, January 2005, 162 . 164 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 165 DOI 10.17487/RFC6265, April 2011, 166 . 168 5.2. Informative References 170 [COOKIE-INTEGRITY] 171 Zheng, X., Jiang, J., Liang, J., Duan, H., Chen, S., Wan, 172 T., and N. Weaver, "Cookies Lack Integrity: Real-World 173 Implications", n.d., . 176 [RFC6797] Hodges, J., Jackson, C., and A. Barth, "HTTP Strict 177 Transport Security (HSTS)", RFC 6797, DOI 10.17487/ 178 RFC6797, November 2012, 179 . 181 Appendix A. Acknowledgements 183 Richard Barnes encouraged a formalization of the deprecation 184 proposal. [COOKIE-INTEGRITY] was a useful exploration of the issues 185 [RFC6265] described. 187 Author's Address 189 Mike West 190 Google, Inc 192 Email: mkwst@google.com 193 URI: https://mikewest.org/