forked from httpwg/http2-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraft-ietf-httpbis-alt-svc.xml
executable file
·866 lines (808 loc) · 33.7 KB
/
draft-ietf-httpbis-alt-svc.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="lib/rfc2629.xslt"?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no" ?>
<?rfc linkmailto="no" ?>
<?rfc editing="no" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc-ext allow-markup-in-artwork="yes" ?>
<?rfc-ext include-index="no" ?>
<!DOCTYPE rfc [
<!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
<!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
<!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
<!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
<!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
<!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
<!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
<!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
<!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
<!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
<!ENTITY mdash "—">
]>
<rfc ipr="trust200902"
category="std"
docName="draft-ietf-httpbis-alt-svc-latest"
x:maturity-level="proposed"
xmlns:x="http://purl.org/net/xml2rfc/ext">
<x:feedback template="mailto:[email protected]?subject={docname},%20%22{section}%22&body=<{ref}>:"/>
<front>
<title abbrev="Alternative Services">HTTP Alternative Services</title>
<author initials="M." surname="Nottingham" fullname="Mark Nottingham">
<organization>Akamai</organization>
<address>
<email>[email protected]</email>
<uri>http://www.mnot.net/</uri>
</address>
</author>
<author initials="P." surname="McManus" fullname="Patrick McManus">
<organization>Mozilla</organization>
<address>
<email>[email protected]</email>
<uri>https://mozillians.org/u/pmcmanus/</uri>
</address>
</author>
<author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
<organization abbrev="greenbytes">greenbytes GmbH</organization>
<address>
<email>[email protected]</email>
<uri>http://greenbytes.de/tech/webdav/</uri>
</address>
</author>
<date year="2014"/>
<area>Applications</area>
<workgroup>HTTPbis</workgroup>
<keyword>HTTP</keyword>
<abstract>
<t>
This 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.</t>
</abstract>
<note title="Editorial Note (To be removed by RFC Editor)">
<t>
Discussion of this draft takes place on the HTTPBIS working group mailing list
([email protected]), which is archived at <eref
target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
</t>
<t>
Working Group information can be found at <eref
target="http://tools.ietf.org/wg/httpbis/"/>; that specific to HTTP/2 are at <eref
target="http://http2.github.io/"/>.
</t>
<t>
The changes in this draft are summarized in <xref
target="change.log"/>.
</t>
</note>
</front>
<middle>
<section anchor="introduction" title="Introduction">
<t>
HTTP <xref target="HTTP-p1"/> conflates the identification of
resources with their location. In other words, "http://" (and "https://") URLs are
used to both name and find things to interact with.
</t>
<t>
In some cases, it is desirable to separate these aspects; to be able to keep
the same identifier for a resource, but interact with it using a different
location on the network.
</t>
<t>For example:
<list style="symbols">
<t>
An origin server might wish to redirect a client to an alternative when it
needs to go down for maintenance, or it has found an alternative in a
location that is more local to the client.
</t>
<t>
An origin server might wish to offer access to its resources using a new
protocol (such as HTTP/2, see <xref target="HTTP2"/>) or one using improved
security (such as Transport Layer Security (TLS), see <xref target="RFC5246"/>).
</t>
<t>
An origin server might wish to segment its clients into groups of
capabilities, such as those supporting Server Name Indication (SNI,
see <xref target="RFC6066" x:sec="3" x:fmt="of"/>) and those not
supporting it, for operational purposes.
</t>
</list>
</t>
<t>
This specification defines a new concept in HTTP, "Alternative Services", that
allows a resource to nominate additional means of interacting with it on the
network. It defines a general framework for this in <xref target="alternative"/>, along with
a specific mechanism for discovering them using HTTP header fields in <xref target="alt-svc"/>.
</t>
<t>
It also introduces a new status code in <xref target="status"/>, so that origin servers (or
their nominated alternatives) can indicate that they are not authoritative for
a given origin, in cases where the wrong location is used.
</t>
<section title="Notational Conventions" anchor="notational-conventions">
<t>
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 <xref target="RFC2119"/>.
</t>
<t>
This document uses the Augmented BNF defined in <xref target="RFC5234"/>
along with the "OWS", "delta-seconds", "parameter", "port", "token",
and "uri-host" rules from <xref target="HTTP-p1"/>, and uses the "#rule"
extension defined in <xref target="HTTP-p1" x:rel="#abnf.extension" x:fmt="sec"/> of that document.
</t>
</section>
</section>
<section title="Alternative Services Concepts" anchor="alternative">
<t>
This specification defines a new concept in HTTP, the "<x:dfn>alternative service</x:dfn>".
When an origin (see <xref target="RFC6454"/>) has resources that are accessible through a
different protocol / host / port combination, it is said to have an alternative
service.
</t>
<t>
An alternative service can be used to interact with the resources on an origin
server at a separate location on the network, possibly using a different
protocol configuration. Alternative services are considered authoritative for
an origin's resources, in the sense of <xref target="HTTP-p1" x:rel="#establishing.authority" x:fmt=","/>.
</t>
<figure>
<preamble>For example, an origin:</preamble>
<artwork type="example">
("http", "www.example.com", "80")
</artwork>
</figure>
<figure>
<preamble>might declare that its resources are also accessible at the alternative service:</preamble>
<artwork type="example">
("h2", "new.example.com", "81")
</artwork>
</figure>
<t>
By their nature, alternative services are explicitly at the granularity of an
origin; i.e., they cannot be selectively applied to resources within an origin.
</t>
<t>
Alternative services do not replace or change the origin for any given resource;
in general, they are not visible to the software "above" the access mechanism.
The alternative service is essentially alternative routing information that can
also be used to reach the origin in the same way that DNS CNAME or SRV records
define routing information at the name resolution level. Each origin maps to a
set of these routes — the default route is derived from origin itself and the
other routes are introduced based on alternative-protocol information.
</t>
<t>
Furthermore, it is important to note that the first member of an alternative
service tuple is different from the "scheme" component of an origin; it is more
specific, identifying not only the major version of the protocol being used,
but potentially communication options for that protocol.
</t>
<t>
This means that clients using an alternative service will change the host, port
and protocol that they are using to fetch resources, but these changes &MUST-NOT;
be propagated to the application that is using HTTP; from that standpoint, the
URI being accessed and all information derived from it (scheme, host, port) are
the same as before.
</t>
<t>
Importantly, this includes its security context; in particular, when TLS
<xref target="RFC5246"/> is in use, the alternative server will need to present a certificate
for the origin's host name, not that of the alternative. Likewise, the Host
header field is still derived from the origin, not the alternative service (just as it
would if a CNAME were being used).
</t>
<t>
The changes &MAY;, however, be made visible in debugging tools, consoles, etc.
</t>
<t>
Formally, an alternative service is identified by the combination of:
<list style="symbols">
<t>An Application Layer Protocol Negotiation (ALPN) protocol, as per
<xref target="I-D.ietf-tls-applayerprotoneg"/></t>
<t>A host, as per <xref target="RFC3986" x:fmt="," x:sec="3.2.2"/></t>
<t>A port, as per <xref target="RFC3986" x:fmt="," x:sec="3.2.3"/></t>
</list>
</t>
<t>
Additionally, each alternative service &MUST; have:
<list style="symbols">
<t>A freshness lifetime, expressed in seconds; see <xref target="caching"/></t>
</list>
</t>
<t>
There are many ways that a client could discover the alternative service(s)
associated with an origin.
</t>
<section title="Host Authentication" anchor="host_auth">
<t>
Clients &MUST-NOT; use alternative services with a host other than the origin's
without strong server authentication; this mitigates the attack described in
<xref target="host_security"/>. One way to achieve this is for the alternative to use TLS
with a certificate that is valid for that origin.
</t>
<t>
For example, if the origin's host is "www.example.com" and an alternative is
offered on "other.example.com" with the "h2" protocol, and the certificate
offered is valid for "www.example.com", the client can use the alternative.
However, if "other.example.com" is offered with the "h2c" protocol, the client
cannot use it, because there is no mechanism in that protocol to establish
strong server authentication.
</t>
<t>
Furthermore, this means that the HTTP Host header field and the SNI information
provided in TLS by the client will be that of the origin, not the alternative.
</t>
</section>
<section title="Alternative Service Caching" anchor="caching" >
<t>
Mechanisms for discovering alternative services can associate a freshness
lifetime with them; for example, the Alt-Svc header field uses the "ma"
parameter.
</t>
<t>
Clients &MAY; choose to use an alternative service instead of the origin at any
time when it is considered fresh; see <xref target="switching"/> for specific
recommendations.
</t>
<t>
Clients with existing connections to alternative services are not required to
fall back to the origin when its freshness lifetime ends; i.e., the caching
mechanism is intended for limiting how long an alternative service can be used
for establishing new requests, not limiting the use of existing ones.
</t>
<t>
To mitigate risks associated with caching compromised values (see
<xref target="host_security"/> for details), user agents &SHOULD; examine cached alternative
services when they detect a change in network configuration, and remove any
that could be compromised (for example, those whose association with the trust
root is questionable). UAs that do not have a means of detecting network
changes &SHOULD; place an upper bound on their lifetime.
</t>
</section>
<section title="Requiring Server Name Indication" anchor="requiring-server-name-indication">
<t>
A client &MUST; only use a TLS-based alternative service if the client also
supports TLS Server Name Indication (SNI) (<xref target="RFC6066" x:sec="3" x:fmt=","/>).
This supports the conservation of IP addresses on the alternative service host.
</t>
</section>
<section title="Using Alternative Services" anchor="switching">
<t>
By their nature, alternative services are optional; clients are not required to
use them. However, it is advantageous for clients to behave in a predictable
way when they are used by servers (e.g., for load balancing).
</t>
<t>
Therefore, if a client becomes aware of an alternative service, the client
&SHOULD; use that alternative service for all requests to the associated origin
as soon as it is available, provided that the security properties of the
alternative service protocol are desirable, as compared to the existing
connection.
</t>
<t>
When a client uses an alternate service, it &MUST; emit the Service header field
(<xref target="service"/>) on every request using that alternate service.
</t>
<t>
The client is not required to block requests; the origin's connection can be
used until the alternative connection is established. However, if the security
properties of the existing connection are weak (e.g. cleartext HTTP/1.1) then
it might make sense to block until the new connection is fully available in
order to avoid information leakage.
</t>
<t>
Furthermore, if the connection to the alternative service fails or is
unresponsive, the client &MAY; fall back to using the origin. Note, however, that
this could be the basis of a downgrade attack, thus losing any enhanced
security properties of the alternative service.
</t>
</section>
</section>
<section title="The Alt-Svc HTTP Header Field" anchor="alt-svc">
<t>
An HTTP(S) origin server can advertise the availability of alternative services
to clients by adding an Alt-Svc header field to responses.
</t>
<figure>
<artwork type="abnf2616">
Alt-Svc = 1#( alternative *( OWS ";" OWS parameter ) )
alternative = protocol-id "=" port
protocol-id = token ; percent-encoded ALPN protocol identifier
</artwork>
</figure>
<t>
ALPN protocol names are octet sequences with no
additional constraints on format.<!-- besides length?-->
Octets not allowed in tokens (<xref target="HTTP-p1" x:fmt="," x:rel="#field.components"/>)
&MUST; be percent-encoded as per <xref target="RFC3986" x:fmt="of" x:sec="2.1"/>.
Consequently, the octet representing the percent character "%" (hex 25) &MUST;
be percent-encoded as well.
</t>
<t>
In order to have precisely one way to represent any ALPN protocol name, the following
additional constraints apply:
<list style="numbers">
<t>
Octets in the ALPN protocol &MUST-NOT; be percent-encoded if they are valid
token characters except "%", and
</t>
<t>
When using percent-encoding, uppercase hex digits &MUST; be used.
</t>
</list>
</t>
<t>
With these constraints, recipients can apply simple string comparison to
match protocol identifiers.
</t>
<figure>
<preamble>For example:</preamble>
<artwork type="example">
Alt-Svc: http2=8000
</artwork>
<postamble>
This indicates that the "http2" protocol on the same host using the
indicated port (in this case, 8000).
</postamble>
</figure>
<texttable style="all" align="left">
<preamble>Examples for protocol name escaping:</preamble>
<ttcol>ALPN protocol name</ttcol>
<ttcol>protocol-id</ttcol>
<ttcol>Note</ttcol>
<c>http2</c>
<c>http2</c>
<c>No escaping needed</c>
<c>w=x:y#z</c>
<c>w%3Dx%3Ay#z</c>
<c>"=" and ":" escaped</c>
<c>x%y</c>
<c>x%25y</c>
<c>"%" needs escaping</c>
</texttable>
<t>
Alt-Svc &MAY; occur in any HTTP response message, regardless of the status code.
</t>
<t>
Alt-Svc does not allow advertisement of alternative services on other hosts, to
protect against various header-based attacks.
</t>
<figure>
<preamble>It can, however, have multiple values:</preamble>
<artwork type="example">
Alt-Svc: h2c=8000, h2=443
</artwork>
</figure>
<t>
The value(s) advertised by Alt-Svc can be used by clients to open a new
connection to one or more alternative services immediately, or simultaneously
with subsequent requests on the same connection.
</t>
<t>
Intermediaries &MUST-NOT; change or append Alt-Svc field values.
</t>
<section title="Caching Alt-Svc Header Field Values" anchor="caching-alt-svc-header-field-values">
<t>
When an alternative service is advertised using Alt-Svc, it is considered fresh
for 24 hours from generation of the message. This can be modified with the 'ma'
(max-age) parameter;
</t>
<figure>
<artwork type="example">
Alt-Svc: h2=443;ma=3600
</artwork>
</figure>
<t>
which indicates the number of seconds since the response was generated the
alternative service is considered fresh for.
</t>
<figure>
<artwork type="abnf2616">
ma = delta-seconds
</artwork></figure>
<t>
See <xref target="HTTP-p6" x:rel="#age.calculations" x:fmt="of"/> for details of determining
response age.
</t>
<figure>
<preamble>For example, a response:</preamble>
<artwork type="message/http; msgtype="response"" x:indent-with=" ">
HTTP/1.1 200 OK
Content-Type: text/html
Cache-Control: 600
Age: 30
Alt-Svc: h2c=8000; ma=60
</artwork>
<postamble>
indicates that an alternative service is available and usable for the next 60
seconds. However, the response has already been cached for 30 seconds (as per
the Age header field value), so therefore the alternative service is only fresh
for the 30 seconds from when this response was received, minus estimated
transit time.
</postamble>
</figure>
<t>
When an Alt-Svc response header field is received from an origin, its value
invalidates and replaces all cached alternative services for that origin.
</t>
<t>
See <xref target="caching"/> for general requirements on caching alternative services.
</t>
<t>
Note that the freshness lifetime for HTTP caching (here, 600 seconds) does not
affect caching of Alt-Svc values.
</t>
</section>
</section>
<section title="The Service HTTP Header Field" anchor="service">
<t>
The Service HTTP header field is used in requests to indicate the identity of the
alternate service in use, just as the Host header field identifies the host and port
of the origin.
</t>
<figure>
<artwork type="abnf2616">
Service = uri-host [ ":" port ]
</artwork>
</figure>
<t>
Service is intended to allow alternate services to detect loops, differentiate
traffic for purposes of load balancing, and generally to ensure that it is
possible to identify the intended destination of traffic, since introducing
this information after a protocol is in use has proven to be problematic.
</t>
<t>
When using an Alternate Service, clients &MUST; include a Service header in all
requests.
</t>
<figure>
<preamble>For example:</preamble>
<artwork type="message/http; msgtype="request"" x:indent-with=" ">
GET /thing
Host: origin.example.com
Service: alternate.example.net
User-Agent: Example/1.0
</artwork>
</figure>
</section>
<section title="The 421 Not Authoritative HTTP Status Code" anchor="status">
<t>
The 421 (Not Authoritative) status code indicates that the current origin
server (usually, but not always an alternative service; see <xref target="alternative"/>) is
not authoritative for the requested resource, in the sense of
<xref target="HTTP-p1" x:rel="#establishing.authority" x:fmt=","/>.
</t>
<t>
Clients receiving 421 (Not Authoritative) from an alternative service &MUST;
remove the corresponding entry from its alternative service cache (see
<xref target="caching"/>) for that origin. Regardless of the idempotency of the request
method, they &MAY; retry the request, either at another alternative server, or at
the origin.
</t>
<t>
421 (Not Authoritative) &MAY; carry an Alt-Svc header field.
</t>
<t>
This status code &MUST-NOT; be generated by proxies.
</t>
<t>
A 421 response is cacheable by default; i.e., unless otherwise indicated by the
method definition or explicit cache controls (see <xref target="HTTP-p6" x:rel="#heuristic.freshness" x:fmt="of"/>).
</t>
</section>
<section title="IANA Considerations" anchor="iana-considerations" >
<section anchor="the-alt-svc-message-header-field" title="The Alt-Svc Message Header Field">
<t>
This document registers Alt-Svc in the Permanent Message Header Registry
<xref target="RFC3864"/>.
</t>
<t>
<list style="symbols">
<t>Header Field Name: Alt-Svc</t>
<t>Application Protocol: http</t>
<t>Status: standard</t>
<t>Author/Change Controller: IETF</t>
<t>Specification Document: [this document]</t>
<t>Related Information: </t>
</list>
</t>
</section>
<section title="The Service Message Header Field" anchor="the-service-message-header-field" >
<t>
This document registers Alt-Svc in the Permanent Message Header Registry
<xref target="RFC3864"/>.
</t>
<t>
<list style="symbols">
<t>Header Field Name: Service</t>
<t>Application Protocol: http</t>
<t>Status: standard</t>
<t>Author/Change Controller: IETF</t>
<t>Specification Document: [this document]</t>
<t>Related Information: </t>
</list>
</t>
</section>
<section title="The 421 Not Authoritative HTTP Status Code" anchor="status.code.registration">
<t>
This document registers the 421 (Not Authoritative) HTTP Status code
in the Hypertext Transfer Protocol (HTTP) Status Code Registry
(<xref target="HTTP-p2" x:fmt="," x:rel="#status.code.registry"/>).
</t>
<t>
<list style="empty">
<t>Status Code: 421</t>
<t>Short Description: Not Authoritative</t>
<t>Specification: <xref target="status"/> of this document</t>
</list>
</t>
</section>
</section>
<section title="Security Considerations" anchor="security-considerations">
<section title="Changing Ports" anchor="changing-ports" >
<t>
Using an alternative service implies accessing an origin's resources on an
alternative port, at a minimum. An attacker that can inject alternative services
and listen at the advertised port is therefore able to hijack an origin.
</t>
<t>
For example, an attacker that can add HTTP response header fields can redirect
traffic to a different port on the same host using the Alt-Svc header field; if
that port is under the attacker's control, they can thus masquerade as the HTTP
server.
</t>
<t>
This risk can be mitigated by restricting the ability to advertise alternative
services, and restricting who can open a port for listening on that host.
</t>
</section>
<section title="Changing Hosts" anchor="host_security">
<t>
When the host is changed due to the use of an alternative service, it presents
an opportunity for attackers to hijack communication to an origin.
</t>
<t>
For example, if an attacker can convince a user agent to send all traffic for
"innocent.example.org" to "evil.example.com" by successfully associating it as
an alternative service, they can masquerade as that origin. This can be done
locally (see mitigations above) or remotely (e.g., by an intermediary as a
man-in-the-middle attack).
</t>
<t>
This is the reason for the requirement in <xref target="host_auth"/> that any alternative
service with a host different to the origin's be strongly authenticated with
the origin's identity; i.e., presenting a certificate for the origin proves
that the alternative service is authorized to serve traffic for the origin.
</t>
<t>
However, this authorization is only as strong as the method used to
authenticate the alternative service. In particular, there are well-known
exploits to make an attacker's certificate appear as legitimate.
</t>
<t>
Alternative services could be used to persist such an attack; for example, an
intermediary could man-in-the-middle TLS-protected communication to a target,
and then direct all traffic to an alternative service with a large freshness
lifetime, so that the user agent still directs traffic to the attacker even when
not using the intermediary.
</t>
<t>
As a result, there is a requirement in <xref target="caching"/> to examine cached alternative
services when a network change is detected.
</t>
</section>
<section title="Changing Protocols" anchor="changing-protocols">
<t>
When the ALPN protocol is changed due to the use of an alternative service, the
security properties of the new connection to the origin can be different from
that of the "normal" connection to the origin, because the protocol identifier
itself implies this.
</t>
<t>
For example, if a "https://" URI had a protocol advertised that does not use
some form of end-to-end encryption (most likely, TLS), it violates the
expectations for security that the URI scheme implies.
</t>
<t>
Therefore, clients cannot blindly use alternative services, but instead evaluate
the option(s) presented to assure that security requirements and expectations
(of specifications, implementations and end users) are met.
</t>
</section>
</section>
<section title="Acknowledgements" anchor="acknowledgements" >
<t>
Thanks to Eliot Lear, Stephen Farrell, Guy Podjarny, Stephen Ludin, Erik
Nygren, Paul Hoffman, Adam Langley, Will Chan and Richard Barnes for their
feedback and suggestions.
</t>
<t>
The Alt-Svc header field was influenced by the design of the
Alternative-Protocol header field in SPDY.
</t>
</section>
</middle>
<back>
<references title="Normative References">
<reference anchor="RFC2119">
<front>
<title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner">
<organization>Harvard University</organization>
</author>
<date year="1997" month="March"/>
</front>
<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
</reference>
<reference anchor="RFC3986">
<front>
<title abbrev="URI Generic Syntax">Uniform Resource Identifier (URI): Generic Syntax</title>
<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
<organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
</author>
<author initials="R." surname="Fielding" fullname="Roy T. Fielding">
<organization abbrev="Day Software">Day Software</organization>
</author>
<author initials="L." surname="Masinter" fullname="Larry Masinter">
<organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
</author>
<date year="2005" month="January"/>
</front>
<seriesInfo name="STD" value="66"/>
<seriesInfo name="RFC" value="3986"/>
</reference>
<reference anchor="RFC5234">
<front>
<title>Augmented BNF for Syntax Specifications: ABNF</title>
<author initials="D." surname="Crocker" fullname="D. Crocker"/>
<author initials="P." surname="Overell" fullname="P. Overell"/>
<date year="2008" month="January"/>
</front>
<seriesInfo name="STD" value="68"/>
<seriesInfo name="RFC" value="5234"/>
</reference>
<reference anchor="RFC6066">
<front>
<title>Transport Layer Security (TLS) Extensions: Extension Definitions</title>
<author initials="D." surname="Eastlake" fullname="D. Eastlake"/>
<date year="2011" month="January"/>
</front>
<seriesInfo name="RFC" value="6066"/>
</reference>
<reference anchor="RFC6454">
<front>
<title>The Web Origin Concept</title>
<author initials="A." surname="Barth" fullname="A. Barth"/>
<date year="2011" month="December"/>
</front>
<seriesInfo name="RFC" value="6454"/>
</reference>
<reference anchor="I-D.ietf-tls-applayerprotoneg">
<front>
<title>Transport Layer Security (TLS) Application Layer Protocol Negotiation Extension</title>
<author initials="S." surname="Friedl" fullname="Stephan Friedl"/>
<author initials="A." surname="Popov" fullname="Andrey Popov"/>
<author initials="A." surname="Langley" fullname="Adam Langley"/>
<author initials="S." surname="Emile" fullname="Stephan Emile"/>
<date month="March" year="2014"/>
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-tls-applayerprotoneg-05"/>
</reference>
<reference anchor="HTTP-p1">
<front>
<title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
<author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
<organization abbrev="Adobe">Adobe Systems Incorporated</organization>
<address><email>[email protected]</email></address>
</author>
<author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
<organization abbrev="greenbytes">greenbytes GmbH</organization>
<address><email>[email protected]</email></address>
</author>
<date month="February" year="2014" />
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-26" />
<x:source href="refs/draft-ietf-httpbis-p1-messaging-26.xml"
basename="https://svn.tools.ietf.org/svn/wg/httpbis/draft-ietf-httpbis/26/p1-messaging"/>
</reference>
<reference anchor="HTTP-p6">
<front>
<title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
<author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
<organization abbrev="Adobe">Adobe Systems Incorporated</organization>
<address><email>[email protected]</email></address>
</author>
<author fullname="Mark Nottingham" initials="M." role="editor" surname="Nottingham">
<organization>Akamai</organization>
<address><email>[email protected]</email></address>
</author>
<author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
<organization abbrev="greenbytes">greenbytes GmbH</organization>
<address><email>[email protected]</email></address>
</author>
<date month="February" year="2014" />
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-26"/>
<x:source href="refs/draft-ietf-httpbis-p6-cache-26.xml"
basename="https://svn.tools.ietf.org/svn/wg/httpbis/draft-ietf-httpbis/26/p6-cache"/>
</reference>
</references>
<references title="Informative References">
<reference anchor="RFC3864">
<front>
<title>Registration Procedures for Message Header Fields</title>
<author initials="G." surname="Klyne" fullname="G. Klyne"/>
<author initials="M." surname="Nottingham" fullname="M. Nottingham"/>
<author initials="J." surname="Mogul" fullname="J. Mogul"/>
<date year="2004" month="September"/>
</front>
<seriesInfo name="BCP" value="90"/>
<seriesInfo name="RFC" value="3864"/>
</reference>
<reference anchor="RFC5246">
<front>
<title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
<author initials="T." surname="Dierks" fullname="T. Dierks"/>
<author initials="E." surname="Rescorla" fullname="E. Rescorla"/>
<date year="2008" month="August"/>
</front>
<seriesInfo name="RFC" value="5246"/>
</reference>
<reference anchor="HTTP-p2">
<front>
<title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
<author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
<organization abbrev="Adobe">Adobe Systems Incorporated</organization>
<address><email>[email protected]</email></address>
</author>
<author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
<organization abbrev="greenbytes">greenbytes GmbH</organization>
<address><email>[email protected]</email></address>
</author>
<date month="February" year="2014" />
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-26" />
<x:source href="refs/draft-ietf-httpbis-p2-semantics-26.xml"
basename="https://svn.tools.ietf.org/svn/wg/httpbis/draft-ietf-httpbis/26/p2-semantics"/>
</reference>
<reference anchor="HTTP2">
<front>
<title>Hypertext Transfer Protocol version 2</title>
<author initials="M." surname="Belshe" fullname="Mike Belshe"/>
<author initials="R." surname="Peon" fullname="Roberto Peon"/>
<author initials="M." surname="Thomson" fullname="Martin Thomson" role="editor"/>
<date month="April" year="2014"/>
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-http2-12"/>
</reference>
</references>
<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
<section title="Since draft-nottingham-httpbis-alt-svc-05" anchor="changes.since.draft-nottingham-httpbis-alt-svc-05">
<t>
This is the first version after adoption of draft-nottingham-httpbis-alt-svc-05
as Working Group work item. It only contains editorial changes.
</t>
</section>
<section title="Since draft-ietf-httpbis-alt-svc-00" anchor="changes.since.draft-ietf-httpbis-alt-svc-00">
<t>
Selected 421 as proposed status code for "Not Authoritative".
</t>
<t>
Changed header field syntax to use percent-encoding of ALPN protocol names
(<eref target="https://github.com/http2/http2-spec/issues/446"/>).
</t>
</section>
<section title="Since draft-ietf-httpbis-alt-svc-01" anchor="changes.since.draft-ietf-httpbis-alt-svc-01">
<t>
None yet.
</t>
</section>
</section>
</back>
</rfc>