idnits 2.17.1 draft-nottingham-httpbis-alt-svc-04.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 21, 2014) is 3661 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) == Outdated reference: A later version (-17) exists of draft-ietf-httpbis-http2-10 -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Nottingham 3 Internet-Draft Akamai 4 Intended status: Standards Track P. McManus 5 Expires: September 22, 2014 Mozilla 6 March 21, 2014 8 HTTP Alternative Services 9 draft-nottingham-httpbis-alt-svc-04 11 Abstract 13 This document specifies "alternative services" for HTTP, which allow 14 an origin's resources to be authoritatively available at a separate 15 network location, possibly accessed with a different protocol 16 configuration. 18 Status of this Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on September 22, 2014. 35 Copyright Notice 37 Copyright (c) 2014 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 53 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 3 54 2. Alternative Services Concepts . . . . . . . . . . . . . . . . 4 55 2.1. Host Authentication . . . . . . . . . . . . . . . . . . . 5 56 2.2. Alternative Service Caching . . . . . . . . . . . . . . . 5 57 2.3. Requiring Server Name Indication . . . . . . . . . . . . . 6 58 2.4. Using Alternative Services . . . . . . . . . . . . . . . . 6 59 3. The Alt-Svc HTTP Header Field . . . . . . . . . . . . . . . . 7 60 3.1. Caching Alt-Svc Header Field Values . . . . . . . . . . . 7 61 4. The 4NN Not Authoritative HTTP Status Code . . . . . . . . . . 8 62 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 63 5.1. The Alt-Svc Message Header Field . . . . . . . . . . . . . 9 64 5.2. The 4NN Not Authoritative HTTP Status Code . . . . . . . . 9 65 6. Security Considerations . . . . . . . . . . . . . . . . . . . 9 66 6.1. Changing Ports . . . . . . . . . . . . . . . . . . . . . . 9 67 6.2. Changing Hosts . . . . . . . . . . . . . . . . . . . . . . 10 68 6.3. Changing Protocols . . . . . . . . . . . . . . . . . . . . 10 69 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 11 70 7.1. Normative References . . . . . . . . . . . . . . . . . . . 11 71 7.2. Informative References . . . . . . . . . . . . . . . . . . 12 72 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 12 73 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 12 75 1. Introduction 77 HTTP [I-D.ietf-httpbis-p1-messaging] conflates the identification of 78 resources with their location. In other words, http:// (and 79 https://) URLs are used to both name and find things to interact 80 with. 82 In some cases, it is desirable to separate these aspects; to be able 83 to keep the same identifier for a resource, but interact with it 84 using a different location on the network. 86 For example: 88 o An origin server might wish to redirect a client to an alternative 89 when it needs to go down for maintenance, or it has found an 90 alternative in a location that is more local to the client. 91 o An origin server might wish to offer access to its resources using 92 a new protocol (such as HTTP/2 [I-D.ietf-httpbis-http2]) or one 93 using improved security (such as TLS {{RFC5246}). 94 o An origin server might wish to segment its clients into groups of 95 capabilities, such as those supporting SNI (see [RFC6066]) and 96 those not supporting it, for operational purposes. 98 This specification defines a new concept in HTTP, "Alternative 99 Services", that allows a resource to nominate additional means of 100 interacting with it on the network. It defines a general framework 101 for this in Section 2, along with a specific mechanism for 102 discovering them using HTTP headers in Section 3. 104 It also introduces a new status code in Section 4, so that origin 105 servers (or their nominated alternatives) can indicate that they are 106 not authoritative for a given origin, in cases where the wrong 107 location is used. 109 1.1. Notational Conventions 111 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 112 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 113 document are to be interpreted as described in [RFC2119]. 115 This document uses the Augmented BNF defined in [RFC5234] along with 116 the "OWS", "DIGIT", "parameter", "port" and "delta-second" rules from 117 [I-D.ietf-httpbis-p1-messaging], and uses the "#rule" extension 118 defined in Section 7 of that document. 120 2. Alternative Services Concepts 122 This specification defines a new concept in HTTP, the "alternative 123 service." When an origin (see [RFC6454]) has resources are 124 accessible through a different protocol / host / port combination, it 125 is said to have an alternative service. 127 An alternative service can be used to interact with the resources on 128 an origin server at a separate location on the network, possibly 129 using a different protocol configuration. Alternative services are 130 considered authoritative for an origin's resources, in the sense of 131 [I-D.ietf-httpbis-p1-messaging] Section 9.1. 133 For example, an origin: 135 ("http", "www.example.com", "80") 137 might declare that its resources are also accessible at the 138 alternative service: 140 ("h2", "new.example.com", "81") 142 By their nature, alternative services are explicitly at the 143 granularity of an origin; i.e., they cannot be selectively applied to 144 resources within an origin. 146 Alternative services do not replace or change the origin for any 147 given resource; in general, they are not visible to the software 148 "above" the access mechanism. The alternative service is essentially 149 alternative routing information that can also be used to reach the 150 origin in the same way that DNS CNAME or SRV records define routing 151 information at the name resolution level. Each origin maps to a set 152 of these routes - the default route is derived from origin itself and 153 the other routes are introduced based on alternative-protocol 154 information. 156 Furthermore, it is important to note that the first member of an 157 alternative service tuple is different from the "scheme" component of 158 an origin; it is more specific, identifying not only the major 159 version of the protocol being used, but potentially communication 160 options for that protocol. 162 This means that clients using an alternative service will change the 163 host, port and protocol that they are using to fetch resources, but 164 these changes MUST NOT be propagated to the application that is using 165 HTTP; from that standpoint, the URI being accessed and all 166 information derived from it (scheme, host, port) are the same as 167 before. 169 Importantly, this includes its security context; in particular, when 170 TLS [RFC5246] is in use, the alternative server will need to present 171 a certificate for the origin's host name, not that of the 172 alternative. Likewise, the Host header is still derived from the 173 origin, not the alternative service (just as it would if a CNAME were 174 being used). 176 The changes MAY, however, be made visible in debugging tools, 177 consoles, etc. 179 Formally, an alternative service is identified by the combination of: 181 o An ALPN protocol, as per [I-D.ietf-tls-applayerprotoneg] 182 o A host, as per [RFC3986] 183 o A port, as per [RFC3986] 185 Additionally, each alternative service MUST have: 187 o A freshness lifetime, expressed in seconds; see Section 2.2 189 There are many ways that a client could discover the alternative 190 service(s) associated with an origin. 192 2.1. Host Authentication 194 Clients MUST NOT use alternative services with a host other than the 195 origin's without strong server authentication; this mitigates the 196 attack described in Section 6.2. One way to achieve this is for the 197 alternative to use TLS with a certificate that is valid for that 198 origin. 200 For example, if the origin's host is "www.example.com" and an 201 alternative is offered on "other.example.com" with the "h2" protocol, 202 and the certificate offered is valid for "www.example.com", the 203 client can use the alternative. However, if "other.example.com" is 204 offered with the "h2c" protocol, the client cannot use it, because 205 there is no mechanism in that protocol to establish strong server 206 authentication. 208 Furthermore, this means that the HTTP Host header and the SNI 209 information provided in TLS by the client will be that of the origin, 210 not the alternative. 212 2.2. Alternative Service Caching 214 Mechanisms for discovering alternative services can associate a 215 freshness lifetime with them; for example, the Alt-Svc header field 216 uses the "ma" parameter. 218 Clients MAY choose to use an alternative service instead of the 219 origin at any time when it is considered fresh; see Section 2.4 for 220 specific recommendations. 222 Clients with existing connections to alternative services are not 223 required to fall back to the origin when its freshness lifetime ends; 224 i.e., the caching mechanism is intended for limiting how long an 225 alternative service can be used for establishing new requests, not 226 limiting the use of existing ones. 228 To mitigate risks associated with caching compromised values (see 229 Section 6.2 for details), user agents SHOULD examine cached 230 alternative services when they detect a change in network 231 configuration, and remove any that could be compromised (for example, 232 those whose association with the trust root is questionable). UAs 233 that do not have a means of detecting network changes SHOULD place an 234 upper bound on their lifetime. 236 2.3. Requiring Server Name Indication 238 A client must only use a TLS-based alternative service if the client 239 also supports TLS Server Name Indication (SNI) [RFC6066]. This 240 supports the conservation of IP addresses on the alternative service 241 host. 243 2.4. Using Alternative Services 245 By their nature, alternative services are optional; clients are not 246 required to use them. However, it is advantageous for clients to 247 behave in a predictable way when they are used by servers (e.g., for 248 load balancing). 250 Therefore, if a client becomes aware of an alternative service, the 251 client SHOULD use that alternative service for all requests to the 252 associated origin as soon as it is available, provided that the 253 security properties of the alternative service protocol are 254 desirable, as compared to the existing connection. 256 The client is not required to block requests; the origin's connection 257 can be used until the alternative connection is established. 258 However, if the security properties of the existing connection are 259 weak (e.g. cleartext HTTP/1.1) then it might make sense to block 260 until the new connection is fully available in order to avoid 261 information leakage. 263 Furthermore, if the connection to the alternative service fails or is 264 unresponsive, the client MAY fall back to using the origin. Note, 265 however, that this could be the basis of a downgrade attack, thus 266 losing any enhanced security properties of the alternative service. 268 3. The Alt-Svc HTTP Header Field 270 A HTTP(S) origin server can advertise the availability of alternative 271 services (see Section 2) to clients by adding an Alt-Svc header field 272 to responses. 274 Alt-Svc = 1#( alternative *( OWS ";" OWS parameter ) ) 275 alternative = <"> protocol-id <"> "=" port 276 protocol-id = 278 For example: 280 Alt-Svc: "http2"=8000 282 This indicates that the "http2" protocol on the same host using the 283 indicated port (in this case, 8000). 285 Alt-Svc MAY occur in any HTTP response message, regardless of the 286 status code. 288 Alt-Svc does not allow advertisement of alternative services on other 289 hosts, to protect against various header-based attacks. 291 It can, however, have multiple values: 293 Alt-Svc: "h2c"=8000, "h2"=443 295 The value(s) advertised by Alt-Svc can be used by clients to open a 296 new connection to one or more alternative services immediately, or 297 simultaneously with subsequent requests on the same connection. 299 Intermediaries MUST NOT change or append Alt-Svc values. 301 Finally, note that while it may be technically possible to put 302 content other than printable ASCII in a HTTP header, some 303 implementations only support ASCII (or a superset of it) in header 304 field values. Therefore, this field SHOULD NOT be used to convey 305 protocol identifiers that are not printable ASCII, or those that 306 contain quote characters. 308 3.1. Caching Alt-Svc Header Field Values 310 When an alternative service is advertised using Alt-Svc, it is 311 considered fresh for 24 hours from generation of the message. This 312 can be modified with the 'ma' (max-age) parameter; 313 Alt-Svc: "h2"=443;ma=3600 315 which indicates the number of seconds since the response was 316 generated the alternative service is considered fresh for. 318 ma = delta-seconds 320 See [I-D.ietf-httpbis-p6-cache] Section 4.2.3 for details of 321 determining response age. For example, a response: 323 HTTP/1.1 200 OK 324 Content-Type: text/html 325 Cache-Control: 600 326 Age: 30 327 Alt-Svc: "h2c"=8000; ma=60 329 indicates that an alternative service is available and usable for the 330 next 60 seconds. However, the response has already been cached for 331 30 seconds (as per the Age header field value), so therefore the 332 alternative service is only fresh for the 30 seconds from when this 333 response was received, minus estimated transit time. 335 When an Alt-Svc response header is received from an origin, its value 336 invalidates and replaces all cached alternative services for that 337 origin. 339 See Section 2.2 for general requirements on caching alternative 340 services. 342 Note that the freshness lifetime for HTTP caching (here, 600 seconds) 343 does not affect caching of Alt-Svc values. 345 4. The 4NN Not Authoritative HTTP Status Code 347 The 4NN (Not Authoritative) status code indicates that the current 348 origin server (usually, but not always an alternative service; see 349 Section 2) is not authoritative for the requested resource, in the 350 sense of [I-D.ietf-httpbis-p1-messaging], Section 9.1. 352 Clients receiving 4NN (Not Authoritative) from an alternative service 353 MUST remove the corresponding entry from its alternative service 354 cache (see Section 2.2) for that origin. Regardless of the 355 idempotency of the request method, they MAY retry the request, either 356 at another alternative server, or at the origin. 358 4NN (Not Authoritative) MAY carry an Alt-Svc header field. 360 This status code MUST NOT be generated by proxies. 362 A 4NN response is cacheable by default; i.e., unless otherwise 363 indicated by the method definition or explicit cache controls (see 364 Section 4.2.2 of [I-D.ietf-httpbis-p6-cache]). 366 5. IANA Considerations 368 5.1. The Alt-Svc Message Header Field 370 This document registers Alt-Svc in the Permanent Message Header 371 Registry [RFC3864]. 373 o Header Field Name: Alt-Svc 374 o Application Protocol: http 375 o Status: standard 376 o Author/Change Controller: IETF 377 o Specification Document: [this document] 378 o Related Information: 380 5.2. The 4NN Not Authoritative HTTP Status Code 382 This document registers the 4NN (Not Authoritative) HTTP Status code 383 [I-D.ietf-httpbis-p2-semantics]. 385 o Status Code: 4NN 386 o Short Description: Not Authoritative 387 o Specification: [this document], Section 4 389 6. Security Considerations 391 Identified security considerations should be enumerated in the 392 appropriate documents depending on which proposals are accepted. 393 Those listed below are generic to all uses of alternative services; 394 more specific ones might be necessary. 396 6.1. Changing Ports 398 Using an alternative service implies accessing an origin's resources 399 on an alternative port, at a minimum. An attacker that can inject 400 alternative services and listen at the advertised port is therefore 401 able to hijack an origin. 403 For example, an attacker that can add HTTP response header fields can 404 redirect traffic to a different port on the same host using the Alt- 405 Svc header field; if that port is under the attacker's control, they 406 can thus masquerade as the HTTP server. 408 This risk can be mitigated by restricting the ability to advertise 409 alternative services, and restricting who can open a port for 410 listening on that host. 412 6.2. Changing Hosts 414 When the host is changed due to the use of an alternative service, it 415 presents an opportunity for attackers to hijack communication to an 416 origin. 418 For example, if an attacker can convince a user agent to send all 419 traffic for "innocent.example.org" to "evil.example.com" by 420 successfully associating it as an alternative service, they can 421 masquerade as that origin. This can be done locally (see mitigations 422 above) or remotely (e.g., by an intermediary as a man-in-the-middle 423 attack). 425 This is the reason for the requirement in Section 2.1 that any 426 alternative service with a host different to the origin's be strongly 427 authenticated with the origin's identity; i.e., presenting a 428 certificate for the origin proves that the alternative service is 429 authorized to serve traffic for the origin. 431 However, this authorization is only as strong as the method used to 432 authenticate the alternative service. In particular, there are well- 433 known exploits to make an attacker's certificate appear as 434 legitimate. 436 Alternative services could be used to persist such an attack; for 437 example, an intermediary could man-in-the-middle TLS-protected 438 communication to a target, and then direct all traffic to an 439 alternative service with a large freshness lifetime, so that the user 440 agent still directs traffic to the attacker even when not using the 441 intermediary. 443 As a result, there is a requirement in Section 2.2 to examine cached 444 alternative services when a network change is detected. 446 6.3. Changing Protocols 448 When the ALPN protocol is changed due to the use of an alternative 449 service, the security properties of the new connection to the origin 450 can be different from that of the "normal" connection to the origin, 451 because the protocol identifier itself implies this. 453 For example, if a "https://" URI had a protocol advertised that does 454 not use some form of end-to-end encryption (most likely, TLS), it 455 violates the expectations for security that the URI scheme implies. 457 Therefore, clients cannot blindly use alternative services, but 458 instead evaluate the option(s) presented to assure that security 459 requirements and expectations (of specifications, implementations and 460 end users) are met. 462 7. References 464 7.1. Normative References 466 [I-D.ietf-httpbis-p1-messaging] 467 Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 468 (HTTP/1.1): Message Syntax and Routing", 469 draft-ietf-httpbis-p1-messaging-26 (work in progress), 470 February 2014. 472 [I-D.ietf-httpbis-p6-cache] 473 Fielding, R., Nottingham, M., and J. Reschke, "Hypertext 474 Transfer Protocol (HTTP/1.1): Caching", 475 draft-ietf-httpbis-p6-cache-26 (work in progress), 476 February 2014. 478 [I-D.ietf-tls-applayerprotoneg] 479 Friedl, S., Popov, A., Langley, A., and S. Emile, 480 "Transport Layer Security (TLS) Application Layer Protocol 481 Negotiation Extension", draft-ietf-tls-applayerprotoneg-05 482 (work in progress), March 2014. 484 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 485 Requirement Levels", BCP 14, RFC 2119, March 1997. 487 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 488 Resource Identifier (URI): Generic Syntax", STD 66, 489 RFC 3986, January 2005. 491 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 492 Specifications: ABNF", STD 68, RFC 5234, January 2008. 494 [RFC6066] Eastlake, D., "Transport Layer Security (TLS) Extensions: 495 Extension Definitions", RFC 6066, January 2011. 497 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 498 December 2011. 500 7.2. Informative References 502 [I-D.ietf-httpbis-http2] 503 Belshe, M., Peon, R., and M. Thomson, "Hypertext Transfer 504 Protocol version 2", draft-ietf-httpbis-http2-10 (work in 505 progress), February 2014. 507 [I-D.ietf-httpbis-p2-semantics] 508 Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 509 (HTTP/1.1): Semantics and Content", 510 draft-ietf-httpbis-p2-semantics-26 (work in progress), 511 February 2014. 513 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 514 Procedures for Message Header Fields", BCP 90, RFC 3864, 515 September 2004. 517 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 518 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 520 Appendix A. Acknowledgements 522 Thanks to Eliot Lear, Stephen Farrell, Guy Podjarny, Stephen Ludin, 523 Erik Nygren, Paul Hoffman, Adam Langley, Will Chan and Richard Barnes 524 for their feedback and suggestions. 526 The Alt-Svc header field was influenced by the design of the 527 Alternative-Protocol header in SPDY. 529 Authors' Addresses 531 Mark Nottingham 532 Akamai 534 Email: mnot@mnot.net 535 URI: http://www.mnot.net/ 537 Patrick McManus 538 Mozilla 540 Email: mcmanus@ducksong.com 541 URI: https://mozillians.org/u/pmcmanus/