Network Working Group M. Nottingham Internet-DraftDecember 11, 2013Intended status: Standards Track M. Thomson Expires:June 14,November 21, 2014 Mozilla May 20, 2014 Opportunistic Encryption for HTTP URIsdraft-nottingham-http2-encryption-02draft-nottingham-http2-encryption-03 Abstract Thisdocument proposes two changes to HTTP/2.0; first, it suggestsdescribes how "http" URIs can be accessed usingALPN Protocol Identifies to identify the specific stack of protocols in use, including TLS, and second, it proposes a wayTransport Layer Security (TLS) toopportunistically encrypt HTTP/2.0 using TLS for HTTP URIs.mitigate pervasive monitoring attacks. Status ofthisThis 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 onJune 14,November 21, 2014. Copyright Notice Copyright (c)20132014 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 the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . .. 32 1.1. Goals and Non-Goals . . . . . . . . . . . . . . . . . . .. 32 1.2. Notational Conventions . . . . . . . . . . . . . . . . ..3 2.Proposal: Indicating Security Properties in Protocol IdentifiersUsing HTTP URIs over TLS . . . . . . . . . . . . . . . . . . 3 3. Server Authentication . . . . . . . . . . . . . . . . . . . . 32.1. Proposal: The "h2r" Protocol4. Interaction with "https" URIs . . . . . . . . . . . . . . . . 43. Security Considerations5. Requiring Use of TLS . . . . . . . . . . . . . . . . . . . .5 3.1. Downgrade Attacks4 5.1. The HTTP-TLS Header Field . . . . . . . . . . . . . . . . 5 5.2. Operational Considerations . . . . .5 4. References. . . . . . . . . . 6 6. Security Considerations . . . . . . . . . . . . . . . . . . . 64.1. Normative References6.1. Security Indicators . . . . . . . . . . . . . . . . . . .6 4.2. Informative References7 6.2. Downgrade Attacks . . . . . . . . . . . . . . . . . .6 Appendix A. Acknowledgements. . 7 6.3. Privacy Considerations . . . . . . . . . . . . . . . . . 7Appendix B. Recent History and Background7. References . . . . . . . . . . . . . . . . . . . . . . . . . 7Appendix C. Frequently Asked Questions7.1. Normative References . . . . . . . . . . . . . .8 C.1. Will this make encryption mandatory in HTTP/2.0?. . . . 7 7.2. Informative References .9 C.2. No certificate checks? Really?. . . . . . . . . . . . . .9 C.3. Why do this if a downgrade attack is so easy?. . 8 Appendix A. Acknowledgements . . . . . . . .9 C.4. Why Have separate relaxed protocol identifiers?. . . . . .9 Author's Address. . . . 8 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . .9. 8 1. IntroductionIn discussion at IETF87, it was proposed that the current means of bootstrapping encryption in HTTP [I-D.ietf-httpbis-p1-messaging] - using the "HTTPS" URI scheme - unintentionally gives the server disproportionate power in determining whether encryption (through use of TLS [RFC6246]) is used.This documentproposes using the new "alternate services" layer described in [I-D.nottingham-httpbis-alt-svc]describes a use of HTTP Alternative Services [I-D.ietf-httpbis-alt-svc] to decouple the URI scheme from the use and configuration of underlying encryption, allowing a"http://""http" URI to beupgraded to use TLS opportunistically. Additionally, becauseaccessed using TLS [RFC5246] opportunistically. Currently, "https" URIs requires acquiring and configuring a valid certificate, which means that some deploymentsmayfind supportingitTLS difficult. Therefore, this documentalso proposesdescribes a"relaxed" profile of HTTP/2.0usage model whereby sites can serve "http" URIs over TLSthat does not requirewithout being required to support strong serverauthentication, specificallyauthentication. A mechanism foruselimiting the potential for active attacks is described in Section 5. This provides clients with"http://" URIs.additional protection against them for a period after successfully connecting to a server using TLS. This does not offer the same level of protection as afforded to "https" URIs, but increases the likelihood that an active attack be detected. 1.1. Goals and Non-Goals The immediate goal is to make the use of HTTPURIsmore robust in the face of pervasive passivemonitoring. Such passive attacks are often opportunistic; they rely on sensitive information being available in the clear. Furthermore, they are often broad, where all available datamonitoring [RFC7258]. A secondary goal iscollected en masse, being analyzed separatelyto limit the potential forrelevant information.active attacks. It is nota goalintended to offer the same level ofthis documentprotection as afforded to "https" URIs, but instead toaddressincrease the likelihood that an activeor targeted attacks, although future solutions mayattack can becomplementary. Other goals includedetected. A final (but significant) goal is to provide for ease ofimplementationimplementation, deployment anddeployment, withoperation. This mechanism should have a minimal impact uponperformance (in keeping with the goals of HTTP/2.0).performance, and should not require extensive administrative effort to configure. 1.2. Notational Conventions The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. 2.Proposal: Indicating Security Properties in Protocol Identifiers In past discussions, there has been general agreement to reusingUsing HTTP URIs over TLS An origin server that supports theALPNresolution of HTTP URIs can indicate support for this specification by providing an alternative service advertisement [I-D.ietf-httpbis-alt-svc] for a protocol identifier[I-D.ietf-tls-applayerprotoneg] for all negotiation mechanisms in HTTP/2.0, not just TLS. This document proposes putting additional information into them to identify the use of encryption as wellthat uses TLS, such asconfiguration of"h2" [I-D.ietf-httpbis-http2]. A client thatencryption, independent of the URI scheme in use. Thus, we won't have just one protocol identifierreceives such an advertisement MAY direct future requests forHTTP/2.0, but two; one with and one withouttheuse of TLS. As such,associated origin to thefollowing identifiers are recommended if this approach is adopted: o h1 - http/1.x over TCP o h1t - http/1.x over TLS over TCP (as per [RFC2818]) o h2 - http/2.x over TCP o h2t - http/2.x over TLS over TCPidentified service (asper [RFC2818]) o h2r - http/2.x over TLS over TCP (see Section 2.1) Draft implementations could be indicated with a suffix; e.g., h2t- draft10. Most of these are already latently definedspecified byHTTP/2.0, with the exception being h2r, defined below. Note[I-D.ietf-httpbis-alt-svc]). A client that places thefocusimportance ofthis proposal is on the semantics of the identifiers;passive protections over performance might choose to withold requests until anexact syntax for themencrypted connection isnot part of it. By indicating the use of TLS in the protocol identifier allowsavailable. However, if such aclient and server to negotiateconnection cannot be successfully established, the client MAY resume its use ofTLS for "http://" URIs; if the server offers h2t,the cleartext connection. A client canselectalso explicitly probe for an alternative service advertisement by sending a request thatprotocol, start TLS and use it. Note that,bears little or no sensitive information, such asdiscussedone with the OPTIONS method. Clients with expired alternative services information could make a similar request inSection 3.1, there mayparallel to an attempt to contact an alternative service, to minimize the delays that might besituations (e.g,. ALPN) where advertising some of these profilesincurred by failing to contact the alternative service. 3. Server Authentication There areinapplicable or inadvisable.no existing expectations with respect to cryptographically strong server authentication when it comes to resolving HTTP URIs. Establishing it, as described in [RFC2818], creates a number of operational challenges. Forexample,these reasons, server authentication is not mandatory for HTTP URIs when using the mechanism described in this specification. When connecting to anALPN negotiationalternative service fora "https://"an "http" URI,it is only sensibleclients are required tooffer h1t and h2t. If adopted, this proposal would be effected by adjustingperform thetextserver authentication procedure described in Section33.1 of[I-D.ietf-httpbis-http2] ("Starting HTTP/2.0") along the lines described above. Note that the specific protocol identifiers above are suggestions only. 2.1. Proposal:[RFC2818]. The"h2r" Protocol If the proposal aboveserver certificate, if one isadopted, a separate proposalproffered by the alternative service, isto define a separate protocol identifiernot necessarily checked for"relaxed"validity, expiration, issuance by a trusted certificate authority or matched against the name in the URI. Therefore, the alternative service MAY provide any certificate, or even select TLSoperation. Serverscipher suites thatsupportdo not include authentication. A client MAY perform additional checks on the"h2r" protocol indicatecertificate thatthey supportit is offered (if the server does not select an unauthenticated TLSfor access to URIs withcipher suite). For instance, a client could examine the"http" URI scheme using HTTP/2.0 or greater. Servers MAY advertisecertificate to see if it has changed over time. In order to retain the"h2r" profile for resources with aauthority properties of "http"origin scheme; theyURIs, and as stipulated by [I-D.ietf-httpbis-alt-svc], clients MUST NOTadvertise ituse alternative services that identify a host other than that of the origin, unless the alternative service indication itself is strongly authenticated. This is not currently possible forresources"http" URIs on cleartext transports. 4. Interaction witha"https"origin. When a client connectsURIs An alternative service that is discovered toan "h2r" alternate service, it MUST use TLS1.1 or greater,support "http" URIs might concurrently support "https" URIs, because HTTP/2 permits the sending of requests for multiple origins (see [RFC6454]) on the one connection. Therefore, when using alternative services, both HTTP andMUST use HTTP/2.x. HTTP/2.0 SHOULDHTTPS URIs might beused as soon as TLS negotiation is completed; i.e.,sent on the"Upgrade dance" SHOULD NOT be performed. When connecting to an "h2r" service,same connection. "https" URIs rely on server authentication. Therefore, if a connection is initially created without authenticating thealgorithmserver, requests forauthenticating"https" resources cannot be sent over that connection until the serverdescribed in [RFC2818]certificate is successfully authenticated. Section 3.1changes;of [RFC2818] describes theclient does not necessarily validate its certificatebasic mechanism, though the authentication considerations in [I-D.ietf-httpbis-alt-svc] could also apply. Connections that are established without any means of server authentication (for instance, the purely anonymous TLS cipher suites), cannot be used forexpiry, hostname match or relationship to"https" URIs. 5. Requiring Use of TLS Editors' Note: this is aknown certificate authority (as itvery rough take on an approach that wouldwith "normal" HTTPS). However,provide a limited form of protection against downgrade attack. It's unclear at this point whether the additional effort (and modest operational cost) is worthwhile. The mechanism described in this specification is trival to mount an active attack against, for two reasons: o A clientMAYthat doesn't performadditional checks onauthentication an easy victim of server impersonation, through man-in-the-middle attacks. o A client that is willing to use cleartext to resolve thecertificate and make a decision asresource will do so if access toits validity before usingany TLS-enabled alternative services is blocked at the network layer. Given that theserver. Definitionprimary goal ofsuch additional checksthis specification is to prevent passive attacks, these areoutnot critical failings (especially considering the alternative - HTTP over cleartext). However, a modest form ofscopeprotection against active attacks can be provided for clients on subsequent connections. When an alternate service is able to commit to providing service for a particular origin over TLS for a bounded period of time, clients can choose to rely upon its avilability, failing when it cannot be contacted. Effectively, thisspecification. Upon initial adoptionmakes the alternative service "sticky" in the client. One drawback with this approach is that clients need to strongly authenticate the alternative service to act upon such a commitment; otherwise, an attacker could create a persistent denial of service. 5.1. The HTTP-TLS Header Field A alternative service can make thisproposal,commitment by sending a "HTTP- TLS" header field: HTTP-TLS = 1#parameter When it appears in a HTTP response from a strongly authenticated alternative service, this header field indicates that the availability of the origin through TLS-protected alternative services isexpected"sticky", and thatno such additional checks will be performed. Therefore,the client MUST NOTuse the "h2r" profilefall back toconnectcleartext protocols while this information is considered fresh. For example: HTTP/1.1 200 OK Content-Type: text/html Cache-Control: 600 Age: 30 Date: Thu, 1 May 2014 16:20:09 GMT HTTP-TLS: ma=3600 Note that the commitment is not bound toalternatea particular alternative service; clients SHOULD use other alternative serviceswhose host does not matchthat they become aware of, as long as the requirements regarding authentication and avoidance of cleartext protocols are met. When this header field appears in a response, clients MUST strongly authenticate the alternative service, as described in Section 3.1 of [RFC2818], noting theorigin (as per [I-D.nottingham-httpbis-alt-svc]), unlessadditionalchecks are performed. Servers SHOULD userequirements in [I-D.ietf-httpbis-alt-svc]. The header field MUST be ignored if strong authentication fails. Persisted information expires after a period determined by thesame certificate consistentlyvalue of the "ma" parameter. See Section 4.2.3 of [I-D.ietf-httpbis-p6-cache] for details of determining response age. ma-parameter = delta-seconds Requests for an origin that has a persisted, unexpired value for "HTTP-TLS" MUST fail if they cannot be made overtime,an authenticated TLS connection. 5.2. Operational Considerations To avoid situations where a persisted value of "HTTP-TLS" causes a client toaid future extensionsbe unable to contact a site, clients SHOULD limit the time that a value is persisted for a given origin. A hard limit might be set to a month. A lower limit might be appropriate forbuilding trustinitial observations of "HTTP-TLS"; the certainty that a site has set a correct value - andadding other services. [TODO: define "same"; likely notthesame actual certificate. ] Whencorresponding limit on persistence - can increase as theh2r protocolvalue isin use,seen more over time. Once a server has indicated that it will support authenticated TLS, a client MAY use key pinning [I-D.ietf-websec-key-pinning] or any other mechanism that would otherwise be restricted to use with HTTPS URIs, provided that the mechanism can be restricted to a single HTTP origin. 6. Security Considerations 6.1. Security Indicators User Agents MUST NOTindicate the connection hasprovide any special security indicia when an "http" resource is acquired using TLS. In particular, indicators that might suggest the same level of security ashttps:// (e.g."https" MUST NOT be used (e.g., using a "lock device").If this proposal is adopted, the "h2r" protocol could be defined in [I-D.ietf-httpbis-http2] (most likely, Section 3), or in a separate document. 3. Security Considerations 3.1.6.2. Downgrade Attacks A downgrade attack against the negotiation for TLS ispossible, depending uponpossible. With theproperties of the negotiation mechanism."HTTP-TLS" header field, this is limited to occasions where clients have no prior information (see Section 6.3), or when persisted commitments have expired. For example, because theAlt-Svc"Alt-Svc" header field[I-D.nottingham-httpbis-alt-svc][I-D.ietf-httpbis-alt-svc] likely appears inthe clear for "http://" URIs,an unauthenticated and unencrypted channel, it is subject to downgrade byattackers that are able to Man- in-the-Middle thenetworkconnection; inattackers. In its simplest form, an attacker that wants the connection to remain in the clear need only strip theAlt-Svc"Alt-Svc" header field from responses.This proposal does not offerAs long as aremedy for this risk. However, it's importantclient is willing tonoteuse cleartext TCP to contact a server, these attacks are possible. The "HTTP-TLS" header field provides an imperfect mechanism for establishing a commitment. The advantage is thatitthis only works if a previous connection isno worse than currentestablished where an active attacker was not present. A continuously present active attacker can either prevent the client from ever using TLS, or offer a self-signed certificate. This would prevent the client from ever seeing the "HTTP-TLS" header field, or if the header field is seen, from successfully validating and persisting it. 6.3. Privacy Considerations Clients that persist state for origins can be tracked over time based on their use ofunencrypted HTTP inthis information. Persisted information can be cleared to reduce thefaceability ofsuch active attacks. Future proposals might attemptservers toaddress this risk. 4.track clients. A browser client MUST clear persisted all alternative service information when clearing other origin-based state (i.e., cookies). 7. References4.1.7.1. Normative References [I-D.ietf-httpbis-alt-svc] Nottingham, M., McManus, P., and J. Reschke, "HTTP Alternative Services", draft-ietf-httpbis-alt-svc-01 (work in progress), April 2014. [I-D.ietf-httpbis-http2] Belshe, M., Peon, R.,Thomson, M.,andA. Melnikov,M. Thomson, "Hypertext Transfer Protocol version2.0", draft-ietf-httpbis-http2-082", draft-ietf-httpbis-http2-12 (work in progress),November 2013. [I-D.ietf-tls-applayerprotoneg] Friedl, S., Popov, A., Langley, A.,April 2014. [I-D.ietf-httpbis-p6-cache] Fielding, R., Nottingham, M., andS. Emile, "Transport Layer Security (TLS) Application LayerJ. Reschke, "Hypertext Transfer ProtocolNegotiation Extension", draft-ietf-tls-applayerprotoneg-03(HTTP/1.1): Caching", draft-ietf- httpbis-p6-cache-26 (work in progress),October 2013. [I-D.nottingham-httpbis-alt-svc] Nottingham, M., "HTTP Alternate Services", draft-nottingham-httpbis-alt-svc-00February 2014. [I-D.ietf-websec-key-pinning] Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning Extension for HTTP", draft-ietf-websec-key-pinning-13 (work in progress),October 2013.May 2014. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, August 2008.4.2.7.2. Informative References[I-D.ietf-httpbis-p1-messaging] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", draft-ietf-httpbis-p1-messaging-25 (work in progress), November 2013. [I-D.mbelshe-httpbis-spdy] Belshe, M. and R. Peon, "SPDY Protocol", draft-mbelshe-httpbis-spdy-00 (work in progress), February 2012. [RFC2804] IAB and IESG, "IETF Policy on Wiretapping", RFC 2804, May 2000. [RFC3365] Schiller, J., "Strong Security Requirements for Internet Engineering Task Force Standard Protocols", BCP 61, RFC 3365, August 2002. [RFC6246] Sajassi,[RFC6454] Barth, A.,Brockners, F., Mohan, D., and Y. Serbest, "Virtual Private LAN Service (VPLS) Interoperability with Customer Edge (CE) Bridges","The Web Origin Concept", RFC6246, June6454, December 2011.[RFC6973] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J., Morris, J., Hansen, M.,[RFC7258] Farrell, S. andR. Smith, "Privacy Considerations for Internet Protocols",H. Tschofenig, "Pervasive Monitoring Is an Attack", BCP 188, RFC6973, July 2013. [firesheep] Butler, E., "Firesheep", 2010, <http://codebutler.com/firesheep/>. [streetview] Kravets, D., "The Anatomy of Google's Wi-Fi Sniffing Debacle", 2012, <http://www.wired.com/threatlevel/2012/05/ google-wifi-fcc-investigation/>. [xkeyscore] Greenwald, G., "NSA tool collects 'nearly everything a user does on the internet'", 2013, <http:// www.theguardian.com/world/2013/jul/31/ nsa-top-secret-program-online-data>.7258, May 2014. Appendix A. Acknowledgements Thanks to Patrick McManus, Eliot Lear, Stephen Farrell, Guy Podjarny, Stephen Ludin, Erik Nygren, PaulHoffman andHoffman, AdamLangleyLangley, Eric Rescorla and Richard Barnes for their feedback and suggestions.Appendix B. Recent History and Background One of the design goals for SPDY [I-D.mbelshe-httpbis-spdy] was increasing the use of encryption on the Web, achieved by only supporting the protocol over a connection protected by TLS [RFC5246]. This was done, in part, because sensitive information - including not only login credentials, but also personally identifying information (PII) and even patterns of access - are increasingly prevalent on the Web, being evident in potentially every HTTP request made. Attacks such as FireSheep [firesheep] showed how easy it is to gather such information when it is sent in the clear, and incidents such as Google's collection of unencrypted data by its StreetView Cars [streetview] further illustrated the risks. In adopting SPDY as the basis of HTTP/2 [I-D.ietf-httpbis-http2], the HTTPbis Working Group agreed not to make TLS mandatory to implement (MtI) or mandatory to use (MtU) in our charter, despite an IETF policy to prefer the "best security available" [RFC3365]. There were a variety of reasons for this, but most significantly, HTTP is used for much more than the traditional browsing case, and encryption is not needed for all of these uses. Making encryption MtU or MtI was seen as unlikely to succeed because of the wide deployment of HTTP URIs. However, since making that decision, there have been developments that have caused the Working Group to discuss these issues again: 1. Active contributors to some browser implementations have stated that their products will not use HTTP/2 over unencrypted connections. If this eventuates, it will prevent wide deployment of the new protocol (i.e., it couldn't be used with those products for HTTP URIs; only HTTPS URIs). 2. It has been reported that surveillance of HTTP traffic takes place on a broad scale [xkeyscore]. While the IETF does not take a formal, moral position on wiretapping, we do have a strongly held belief "that both commercial development of the Internet and adequate privacy for its users against illegal intrusion requires the wide availability of strong cryptographic technology" [RFC2804]. This requirement for privacy is further reinforced by [RFC6973]. As a result, we decided to revisit the issue of how encryption is used in HTTP/2.0 at IETF87. Appendix C. Frequently Asked Questions C.1. Will this make encryption mandatory in HTTP/2.0? Not in the sense that this proposal would have it required (with a MUST) in the specification. What might happen, however, is that some browser implementers will take the flexibility that this approach grants and decide to not negotiate for HTTP/2.0 without one of the encryption profiles. That means that servers would need to implement one of the encryption- enabling profiles to interoperate using HTTP/2.0 for HTTP URIs. C.2. No certificate checks? Really? h2r has the effect of relaxing certificate checks on "http://" - but not "https://" - URIs when TLS is in use. Since TLS isn't in use for any "http://" URIs today, there is no net loss of security, and we gain some privacy from passive attacks. This makes TLS significantly simpler to deploy for servers; they are able to use a self-signed certificate. Additionally, it is possible to detect some attacks by remembering what certificate is used in the past "pinning" or third-party verification of the certificate in use. This may offer a way to gain stronger authentication of the origin server's identity, and mitigate downgrade attacks (although doing so is out of the scope of this document). C.3. Why do this if a downgrade attack is so easy? There are many attack scenarios (e.g., third parties in coffee shops) where active attacks are not feasible, or much more difficult. Additionally, active attacks can often be detected, because they change protocol interactions; as such, they bring a risk of discovery. C.4. Why Have separate relaxed protocol identifiers? If all implementations agree that using TLS for "http://" URIs always means that the certificate checks are "relaxed", it could be that there is no need for a separate protocol identifier. However, this needs to be discussed. Author's AddressAuthors' Addresses Mark Nottingham Email: mnot@mnot.net URI: http://www.mnot.net/ Martin Thomson Mozilla Email: martin.thomson@gmail.com