Opportunistic Security for HTTPmnot@mnot.nethttp://www.mnot.net/Mozillamartin.thomson@gmail.com
General
HTTP Working GroupInternet-DraftThis document describes how http URIs can be accessed using Transport Layer Security (TLS) to
mitigate pervasive monitoring attacks.This document describes a use of HTTP Alternative Services to decouple
the URI scheme from the use and configuration of underlying encryption, allowing a http URI to be
accessed using TLS opportunistically.Serving https URIs require acquiring and configuring a valid certificate, which means that some
deployments find supporting TLS difficult. This document describes a usage model whereby sites can
serve http URIs over TLS without being required to support strong server authentication.Opportunistic Security does not provide the same guarantees
as using TLS with https URIs; it is vulnerable to active attacks, and does not change the security
context of the connection. Normally, users will not be able to tell that it is in use (i.e., there
will be no “lock icon”).By its nature, this technique is vulnerable to active attacks. A mechanism for partially mitigating
them is described in .The immediate goal is to make the use of HTTP more robust in the face of pervasive passive
monitoring .A secondary goal is to limit the potential for active attacks. It is not intended to offer the same
level of protection as afforded to https URIs, but instead to increase the likelihood that an
active attack can be detected.A final (but significant) goal is to provide for ease of implementation, deployment and operation.
This mechanism is expected to have a minimal impact upon performance, and require a trivial
administrative effort to configure.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
.An origin server that supports the resolution of http URIs can indicate support for this
specification by providing an alternative service advertisement for a
protocol identifier that uses TLS, such as h2.A client that receives such an advertisement MAY make future requests intended for the associated
origin () to the identified service (as specified by ).A client that places the importance of protection against passive attacks over performance might
choose to withhold requests until an encrypted connection is available. However, if such a
connection cannot be successfully established, the client can resume its use of the cleartext
connection.A client can also explicitly probe for an alternative service advertisement by sending a request
that bears little or no sensitive information, such as one with the OPTIONS method. Likewise,
clients with existing alternative services information could make such a request before they
expire, in order minimize the delays that might be incurred.By their nature, http URIs do not require cryptographically strong server authentication; that is
only implied by https URIs. Furthermore, doing so (as per ) creates a number of
operational challenges. For these reasons, server authentication is not mandatory for http URIs
when using the mechanism described in this specification.When connecting to an alternative service for an http URI, clients are not required to perform the
server authentication procedure described in Section 3.1 of . The server certificate, if
one is proffered by the alternative service, is not necessarily checked for validity, expiration,
issuance by a trusted certificate authority or matched against the name in the URI. Therefore, the
alternative service can provide any certificate, or even select TLS cipher suites that do not
include authentication.A client MAY perform additional checks on the offered certificate if the server does not select an
unauthenticated TLS cipher suite. This document doesn’t define any such checks, though clients
could be configured with a policy that defines what is acceptable.As stipulated by , clients MUST NOT use alternative services with a
host other than the origin’s, unless the alternative service itself is strongly authenticated (as
the origin’s host); for example, using TLS with a certificate that validates as per .When using alternative services, requests for resources identified by both http and https URIs
might use the same connection, because HTTP/2 permits requests for multiple origins on the same
connection.Since https URIs rely on server authentication, a connection that is initially created for http
URIs without authenticating the server cannot be used for https URIs until the server certificate
is successfully authenticated. Section 3.1 of describes the basic mechanism, though the
authentication considerations in also apply.Connections that are established without any means of server authentication (for instance, the
purely anonymous TLS cipher suites), cannot be used for https URIs.Editors’ Note: this is a very rough take on an approach that would 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 trivial to mount an active attack against, for two
reasons:A client that doesn’t perform authentication is an easy victim of server impersonation, through
man-in-the-middle attacks.A client that is willing to use HTTP over cleartext to resolve the resource will do so if access
to any TLS-enabled alternative services is blocked at the network layer.Given that the primary goal of this specification is to prevent passive attacks, these are not
critical failings (especially considering the alternative - HTTP over cleartext). However, a modest
form of protection against active attacks can be provided for clients on subsequent connections.When an alternative 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 availability, failing when it
cannot be contacted. Effectively, this makes the choice to use a secured protocol “sticky” in the
client.A alternative service can make this commitment by sending a HTTP-TLS header field, described here
using the ‘#’ ABNF extension defined in Section 7 of :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 is
“sticky”, and that the client MUST NOT fall back to cleartext protocols while this information is
considered fresh.For example:This header field creates a commitment from the origin of the associated resource (in
the example, http://example.com). For the duration of the commitment, clients SHOULD strongly
authenticate the server for all subsequent requests made to that origin, though this creates some
risks for clients (see ).Authentication for HTTP over TLS is described in Section 3.1 of , noting the additional
requirements in Section 2.1 of . The header field MUST be ignored if
strong authentication fails; otherwise, an attacker could create a persistent denial of service by
falsifying a commitment.The commitment to use authenticated TLS persists for a period determined by the value of the ma
parameter. See Section 4.2.3 of for details of determining response age.The commitment made by the HTTP-TLS header field applies only to the origin of the resource that
generates the HTTP-TLS header field.Requests for an origin that has a persisted, unexpired value for HTTP-TLS MUST fail if they cannot
be made over an authenticated TLS connection.Note that the commitment is not bound to a particular alternative service. Clients SHOULD use
alternative services that they become aware of. However, clients MUST NOT use an unauthenticated
alternative service for an origin with this commitment. Where there is an active commitment,
clients MAY instead ignore advertisements for unsecured alternatives services.To avoid situations where a persisted value of HTTP-TLS causes a client to be unable to contact a
site, clients SHOULD limit the time that a value is persisted for a given origin. A lower limit
might be appropriate for initial observations of HTTP-TLS; the certainty that a site has set a
correct value - and the corresponding limit on persistence - can increase as the value is seen more
over time.Once a server has indicated that it will support authenticated TLS, a client MAY use 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.User Agents MUST NOT provide any special security indicia when an http resource is acquired using
TLS. In particular, indicators that might suggest the same level of security as https MUST NOT be
used (e.g., using a “lock device”).A downgrade attack against the negotiation for TLS is possible. With the HTTP-TLS header field,
this is limited to occasions where clients have no prior information (see ), or when
persisted commitments have expired.For example, because the Alt-Svc header field likely appears in an
unauthenticated and unencrypted channel, it is subject to downgrade by network attackers. In its
simplest form, an attacker that wants the connection to remain in the clear need only strip the
Alt-Svc header field from responses.Downgrade attacks can be partially mitigated using the HTTP-TLS header field, because when it is
used, a client can avoid using cleartext to contact a supporting server. However, this only works
when a previous connection has been established without an active attacker present; a continuously
present active attacker can either prevent the client from ever using TLS, or offer its own
certificate.Cached alternative services can be used to track clients over time; e.g., using a user-specific
hostname. Clearing the cache reduces the ability of servers to track clients; therefore clients
MUST clear cached alternative service information when clearing other origin-based state (i.e.,
cookies).Many existing HTTP/1.1 implementations use the presence or absence of TLS in the stack to determine
whether requests are for http or https resources. This is necessary in many cases because the
most common form of an HTTP/1.1 request does not carry an explicit indication of the URI scheme.HTTP/1.1 MUST NOT be used for opportunistically secured requests.Some HTTP/1.1 implementations use ambient signals to determine if a request is for an https
resource. For example, implementations might look for TLS on the stack or a port number of 443. An
implementation that supports opportunistically secured requests SHOULD suppress these signals if
there is any potential for confusion.Key words for use in RFCs to Indicate Requirement LevelsIn many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.HTTP Over TLSThis memo describes how to use Transport Layer Security (TLS) to secure Hypertext Transfer Protocol (HTTP) connections over the Internet. This memo provides information for the Internet community.The Transport Layer Security (TLS) Protocol Version 1.2This document specifies Version 1.2 of the Transport Layer Security (TLS) protocol. The TLS protocol provides communications security over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery. [STANDARDS-TRACK]The Web Origin ConceptThis document defines the concept of an "origin", which is often used as the scope of authority or privilege by user agents. Typically, user agents isolate content retrieved from different origins to prevent malicious web site operators from interfering with the operation of benign web sites. In addition to outlining the principles that underlie the concept of origin, this document details how to determine the origin of a URI and how to serialize an origin into a string. It also defines an HTTP header field, named "Origin", that indicates which origins are associated with an HTTP request. [STANDARDS-TRACK]Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and RoutingThe Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document provides an overview of HTTP architecture and its associated terminology, defines the "http" and "https" Uniform Resource Identifier (URI) schemes, defines the HTTP/1.1 message syntax and parsing requirements, and describes related security concerns for implementations.Hypertext Transfer Protocol (HTTP/1.1): CachingThe Hypertext Transfer Protocol (HTTP) is a stateless \%application- level protocol for distributed, collaborative, hypertext information systems. This document defines HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages.Public Key Pinning Extension for HTTPThis document defines a new HTTP header that allows web host operators to instruct user agents to remember ("pin") the hosts' cryptographic identities over a period of time. During that time, user agents (UAs) will require that the host presents a certificate chain including at least one Subject Public Key Info structure whose fingerprint matches one of the pinned fingerprints for that host. By effectively reducing the number of trusted authorities who can authenticate the domain during the lifetime of the pin, pinning may reduce the incidence of man-in-the-middle attacks due to compromised Certification Authorities.Hypertext Transfer Protocol Version 2 (HTTP/2)This specification describes an optimized expression of the semantics of the Hypertext Transfer Protocol (HTTP), referred to as HTTP version 2 (HTTP/2). HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection. It also introduces unsolicited push of representations from servers to clients.This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax. HTTP's existing semantics remain unchanged.HTTP Alternative ServicesThis document specifies "alternative services" for HTTP, which allow an origin's resources to be authoritatively available at a separate network location, possibly accessed with a different protocol configuration.Pervasive Monitoring Is an AttackPervasive monitoring is a technical attack that should be mitigated in the design of IETF protocols, where possible.Opportunistic Security: Some Protection Most of the TimeThis document defines the concept "Opportunistic Security" in the context of communications protocols. Protocol designs based on Opportunistic Security use encryption even when authentication is not available, and use authentication when possible, thereby removing barriers to the widespread use of encryption on the Internet.Thanks to Patrick McManus, Eliot Lear, Stephen Farrell, Guy Podjarny, Stephen Ludin, Erik Nygren,
Paul Hoffman, Adam Langley, Eric Rescorla and Richard Barnes for their feedback and suggestions.