1
2
3
4
5Internet Engineering Task Force (IETF) R.B. Shoemaker
6Request for Comments: 8737 ISRG
7Category: Standards Track February 2020
8ISSN: 2070-1721
9
10
11 Automated Certificate Management Environment (ACME) TLS
12 Application-Layer Protocol Negotiation (ALPN) Challenge Extension
13
14Abstract
15
16 This document specifies a new challenge for the Automated Certificate
17 Management Environment (ACME) protocol that allows for domain control
18 validation using TLS.
19
20Status of This Memo
21
22 This is an Internet Standards Track document.
23
24 This document is a product of the Internet Engineering Task Force
25 (IETF). It represents the consensus of the IETF community. It has
26 received public review and has been approved for publication by the
27 Internet Engineering Steering Group (IESG). Further information on
28 Internet Standards is available in Section 2 of RFC 7841.
29
30 Information about the current status of this document, any errata,
31 and how to provide feedback on it may be obtained at
32 https://www.rfc-editor.org/info/rfc8737.
33
34Copyright Notice
35
36 Copyright (c) 2020 IETF Trust and the persons identified as the
37 document authors. All rights reserved.
38
39 This document is subject to BCP 78 and the IETF Trust's Legal
40 Provisions Relating to IETF Documents
41 (https://trustee.ietf.org/license-info) in effect on the date of
42 publication of this document. Please review these documents
43 carefully, as they describe your rights and restrictions with respect
44 to this document. Code Components extracted from this document must
45 include Simplified BSD License text as described in Section 4.e of
46 the Trust Legal Provisions and are provided without warranty as
47 described in the Simplified BSD License.
48
49Table of Contents
50
51 1. Introduction
52 2. Terminology
53 3. TLS with Application-Layer Protocol Negotiation (TLS ALPN)
54 Challenge
55 4. acme-tls/1 Protocol Definition
56 5. Security Considerations
57 6. IANA Considerations
58 6.1. SMI Security for PKIX Certificate Extension OID
59 6.2. ALPN Protocol ID
60 6.3. ACME Validation Method
61 7. Normative References
62 Appendix A. Design Rationale
63 Acknowledgments
64 Author's Address
65
661. Introduction
67
68 The Automatic Certificate Management Environment (ACME) [RFC8555]
69 specification describes methods for validating control of domain
70 names via HTTP and DNS. Deployment experience has shown it is also
71 useful to be able to validate domain control using the TLS layer
72 alone. In particular, this allows hosting providers, Content
73 Distribution Networks (CDNs), and TLS-terminating load balancers to
74 validate domain control without modifying the HTTP handling behavior
75 of their backends.
76
77 This document specifies a new TLS-based challenge type, tls-alpn-01.
78 This challenge requires negotiating a new application-layer protocol
79 using the TLS Application-Layer Protocol Negotiation (ALPN) Extension
80 [RFC7301]. Because this protocol does not build on a pre-existing
81 deployment base, the ability to complete tls-alpn-01 challenges
82 requires changes by service providers, making it explicitly an opt-in
83 process. Because service providers must proactively deploy new code
84 in order to implement tls-alpn-01, we can specify stronger controls
85 in that code, resulting in a stronger validation method.
86
872. Terminology
88
89 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
90 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
91 "OPTIONAL" in this document are to be interpreted as described in
92 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
93 capitals, as shown here.
94
953. TLS with Application-Layer Protocol Negotiation (TLS ALPN) Challenge
96
97 The TLS with Application-Layer Protocol Negotiation (TLS ALPN)
98 validation method proves control over a domain name by requiring the
99 ACME client to configure a TLS server to respond to specific
100 connection attempts using the ALPN extension with identifying
101 information. The ACME server validates control of the domain name by
102 connecting to a TLS server at one of the addresses resolved for the
103 domain name and verifying that a certificate with specific content is
104 presented.
105
106 The tls-alpn-01 ACME challenge object has the following format:
107
108 type (required, string): The string "tls-alpn-01"
109
110 token (required, string): A random value that uniquely identifies
111 the challenge. This value MUST have at least 128 bits of entropy.
112 It MUST NOT contain any characters outside the base64url alphabet
113 as described in Section 5 of [RFC4648]. Trailing '=' padding
114 characters MUST be stripped. See [RFC4086] for additional
115 information on randomness requirements.
116
117 The client prepares for validation by constructing a self-signed
118 certificate that MUST contain an acmeIdentifier extension and a
119 subjectAlternativeName extension [RFC5280]. The
120 subjectAlternativeName extension MUST contain a single dNSName entry
121 where the value is the domain name being validated. The
122 acmeIdentifier extension MUST contain the SHA-256 digest [FIPS180-4]
123 of the key authorization [RFC8555] for the challenge. The
124 acmeIdentifier extension MUST be critical so that the certificate
125 isn't inadvertently used by non-ACME software.
126
127 The acmeIdentifier extension is identified by the id-pe-
128 acmeIdentifier object identifier (OID) in the id-pe arc [RFC5280]:
129
130 id-pe-acmeIdentifier OBJECT IDENTIFIER ::= { id-pe 31 }
131
132 The extension has the following ASN.1 [X.680] format :
133
134 Authorization ::= OCTET STRING (SIZE (32))
135
136 The extnValue of the id-pe-acmeIdentifier extension is the ASN.1 DER
137 encoding [X.690] of the Authorization structure, which contains the
138 SHA-256 digest of the key authorization for the challenge.
139
140 Once this certificate has been created, it MUST be provisioned such
141 that it is returned during a TLS handshake where the "acme-tls/1"
142 application-layer protocol has been negotiated and a Server Name
143 Indication (SNI) extension [RFC6066] has been provided containing the
144 domain name being validated.
145
146 A client responds by POSTing an empty JSON object ({}) to the
147 challenge URL to acknowledge that the challenge is ready to be
148 validated by the server. The base64url encoding of the protected
149 headers and payload is described in Section 6.1 of [RFC8555].
150
151 POST /acme/authz/1234/1
152 Host: example.com
153 Content-Type: application/jose+json
154
155 {
156 "protected": base64url({
157 "alg": "ES256",
158 "kid": "https://example.com/acme/acct/1",
159 "nonce": "JHb54aT_KTXBWQOzGYkt9A",
160 "url": "https://example.com/acme/authz/1234/1"
161 }),
162 "payload": base64url({}),
163 "signature": "Q1bURgJoEslbD1c5...3pYdSMLio57mQNN4"
164 }
165
166 On receiving this request from a client, the server constructs and
167 stores the key authorization from the challenge "token" value and the
168 current client account key.
169
170 The server then verifies the client's control over the domain by
171 verifying that the TLS server was configured as expected using the
172 following steps:
173
174 1. The ACME server computes the expected SHA-256 digest of the key
175 authorization.
176
177 2. The ACME server resolves the domain name being validated and
178 chooses one of the IP addresses returned for validation (the
179 server MAY validate against multiple addresses if more than one
180 is returned).
181
182 3. The ACME server initiates a TLS connection to the chosen IP
183 address. This connection MUST use TCP port 443. The ACME server
184 MUST provide an ALPN extension with the single protocol name
185 "acme-tls/1" and an SNI extension containing only the domain name
186 being validated during the TLS handshake.
187
188 4. The ACME server verifies that during the TLS handshake the
189 application-layer protocol "acme-tls/1" was successfully
190 negotiated (and that the ALPN extension contained only the value
191 "acme-tls/1") and that the certificate returned contains:
192
193 * a subjectAltName extension containing the dNSName being
194 validated and no other entries
195
196 * a critical acmeIdentifier extension containing the expected
197 SHA-256 digest computed in step 1
198
199 The comparison of dNSNames MUST be case insensitive [RFC4343]. Note
200 that as ACME doesn't support Unicode identifiers, all dNSNames MUST
201 be encoded using the rules of [RFC3492].
202
203 If all of the above steps succeed, then the validation is successful.
204 Otherwise, it fails.
205
2064. acme-tls/1 Protocol Definition
207
208 The "acme-tls/1" protocol MUST only be used for validating ACME tls-
209 alpn-01 challenges. The protocol consists of a TLS handshake in
210 which the required validation information is transmitted. The "acme-
211 tls/1" protocol does not carry application data. Once the handshake
212 is completed, the client MUST NOT exchange any further data with the
213 server and MUST immediately close the connection. While this
214 protocol uses X.509 certificates, it does not use the authentication
215 method described in [RFC5280] and, as such, does not require a valid
216 signature on the provided certificate nor require the TLS handshake
217 to complete successfully. An ACME server may wish to use an off-the-
218 shelf TLS stack where it is not simple to allow these divergences in
219 the protocol as defined. Because of this, an ACME server MAY choose
220 to withhold authorization if either the certificate signature is
221 invalid or the handshake doesn't fully complete.
222
223 ACME servers that implement "acme-tls/1" MUST only negotiate TLS 1.2
224 [RFC5246] or higher when connecting to clients for validation.
225
2265. Security Considerations
227
228 The design of this challenge relies on some assumptions centered
229 around how an HTTPS server behaves during validation.
230
231 The first assumption is that when an HTTPS server is being used to
232 serve content for multiple DNS names from a single IP address, it
233 properly segregates control of those names to the users that own
234 them. This means that if User A registers Host A and User B
235 registers Host B, the HTTPS server should not allow a TLS request
236 using an SNI value for Host A to be served by User B or a TLS
237 connection with a server_name extension identifying Host B to be
238 answered by User A. If the HTTPS server allows User B to serve this
239 request, it allows them to illegitimately validate control of Host A
240 to the ACME server.
241
242 The second assumption is that a server will not violate [RFC7301] by
243 blindly agreeing to use the "acme-tls/1" protocol without actually
244 understanding it.
245
246 To further mitigate the risk of users claiming domain names used by
247 other users on the same infrastructure hosting providers, CDNs, and
248 other service providers SHOULD NOT allow users to provide their own
249 certificates for the TLS ALPN validation process. If providers wish
250 to implement TLS ALPN validation, they SHOULD only generate
251 certificates used for validation themselves and not expose this
252 functionality to users.
253
254 The extensions to the ACME protocol described in this document build
255 upon the Security Considerations and threat model defined in
256 Section 10.1 of [RFC8555].
257
2586. IANA Considerations
259
2606.1. SMI Security for PKIX Certificate Extension OID
261
262 Within the "Structure of Management Information (SMI) Numbers (MIB
263 Module Registrations)" registry, the following entry has been added
264 to the "SMI Security for PKIX Certificate Extension"
265 (1.3.6.1.5.5.7.1) table.
266
267 +---------+----------------------+------------+
268 | Decimal | Description | References |
269 +=========+======================+============+
270 | 31 | id-pe-acmeIdentifier | RFC 8737 |
271 +---------+----------------------+------------+
272
273 Table 1
274
2756.2. ALPN Protocol ID
276
277 Within the "Transport Layer Security (TLS) Extensions" registry, the
278 following entry has been added to the "TLS Application-Layer Protocol
279 Negotiation (ALPN) Protocol IDs" table.
280
281 +------------+------------------------------------+-----------+
282 | Protocol | Identification Sequence | Reference |
283 +============+====================================+===========+
284 | acme-tls/1 | 0x61 0x63 0x6d 0x65 0x2d 0x74 0x6c | RFC 8737 |
285 | | 0x73 0x2f 0x31 ("acme-tls/1") | |
286 +------------+------------------------------------+-----------+
287
288 Table 2
289
2906.3. ACME Validation Method
291
292 Within the "Automated Certificate Management Environment (ACME)
293 Protocol" registry, the following entry has been added to the "ACME
294 Validation Methods" registry.
295
296 +-------------+-----------------+------+-----------+
297 | Label | Identifier Type | ACME | Reference |
298 +=============+=================+======+===========+
299 | tls-alpn-01 | dns | Y | RFC 8737 |
300 +-------------+-----------------+------+-----------+
301
302 Table 3
303
3047. Normative References
305
306 [FIPS180-4]
307 National Institute of Standards and Technology (NIST),
308 "Secure Hash Standard (SHS)", FIPS PUB 180-4,
309 DOI 10.6028/NIST.FIPS.180-4, August 2015,
310 <https://nvlpubs.nist.gov/nistpubs/FIPS/
311 NIST.FIPS.180-4.pdf>.
312
313 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
314 Requirement Levels", BCP 14, RFC 2119,
315 DOI 10.17487/RFC2119, March 1997,
316 <https://www.rfc-editor.org/info/rfc2119>.
317
318 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode
319 for Internationalized Domain Names in Applications
320 (IDNA)", RFC 3492, DOI 10.17487/RFC3492, March 2003,
321 <https://www.rfc-editor.org/info/rfc3492>.
322
323 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker,
324 "Randomness Requirements for Security", BCP 106, RFC 4086,
325 DOI 10.17487/RFC4086, June 2005,
326 <https://www.rfc-editor.org/info/rfc4086>.
327
328 [RFC4343] Eastlake 3rd, D., "Domain Name System (DNS) Case
329 Insensitivity Clarification", RFC 4343,
330 DOI 10.17487/RFC4343, January 2006,
331 <https://www.rfc-editor.org/info/rfc4343>.
332
333 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data
334 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006,
335 <https://www.rfc-editor.org/info/rfc4648>.
336
337 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
338 (TLS) Protocol Version 1.2", RFC 5246,
339 DOI 10.17487/RFC5246, August 2008,
340 <https://www.rfc-editor.org/info/rfc5246>.
341
342 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
343 Housley, R., and W. Polk, "Internet X.509 Public Key
344 Infrastructure Certificate and Certificate Revocation List
345 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008,
346 <https://www.rfc-editor.org/info/rfc5280>.
347
348 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS)
349 Extensions: Extension Definitions", RFC 6066,
350 DOI 10.17487/RFC6066, January 2011,
351 <https://www.rfc-editor.org/info/rfc6066>.
352
353 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan,
354 "Transport Layer Security (TLS) Application-Layer Protocol
355 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301,
356 July 2014, <https://www.rfc-editor.org/info/rfc7301>.
357
358 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
359 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
360 May 2017, <https://www.rfc-editor.org/info/rfc8174>.
361
362 [RFC8555] Barnes, R., Hoffman-Andrews, J., McCarney, D., and J.
363 Kasten, "Automatic Certificate Management Environment
364 (ACME)", RFC 8555, DOI 10.17487/RFC8555, March 2019,
365 <https://www.rfc-editor.org/info/rfc8555>.
366
367 [X.680] ITU-T, "Information technology -- Abstract Syntax Notation
368 One (ASN.1): Specification of basic notation", ITU-T
369 Recommendation X.680, ISO/IEC 8824-1:2015, August 2015,
370 <https://www.itu.int/rec/T-REC-X.680-201508-I/en>.
371
372 [X.690] ITU-T, "Information Technology -- ASN.1 encoding rules:
373 Specification of Basic Encoding Rules (BER), Canonical
374 Encoding Rules (CER) and Distinguished Encoding Rules
375 (DER)", ITU-T Recommendation X.690, ISO/IEC 8825-1:2015,
376 August 2015,
377 <https://www.itu.int/rec/T-REC-X.690-201508-I/en>.
378
379Appendix A. Design Rationale
380
381 The TLS ALPN challenge exists to iterate on the TLS SNI challenge
382 defined in the early ACME drafts. The TLS SNI challenge was
383 convenient for service providers who were either operating large TLS-
384 layer load balancing systems at which they wanted to perform
385 validation or running servers fronting large numbers of DNS names
386 from a single host as it allowed validation purely within the TLS
387 layer. The value provided by the TLS SNI challenge was considered
388 large enough that this document was written in order to provide a new
389 challenge type that addressed the existing security concerns.
390
391 A security issue in the TLS SNI challenge was discovered by Frans
392 Rosen, which allowed users of various service providers to
393 illegitimately validate control of the DNS names of other users of
394 the provider. When the TLS SNI challenge was designed, it was
395 assumed that a user would only be able to respond to TLS traffic via
396 SNI for domain names they had registered with a service provider
397 (i.e., if a user registered 'a.example', they would only be able to
398 respond to SNI requests for 'a.example' and not for SNI requests for
399 'b.example'). It turns out that a number of large service providers
400 do not honor this property. Because of this, users were able to
401 respond to SNI requests for the names used by the TLS SNI challenge
402 validation process. This meant that (1) if User A and User B had
403 registered Host A and Host B, respectively, User A would be able to
404 claim the constructed SNI challenge name for Host B, and (2) when the
405 validation connection was made, User A would be able to answer,
406 thereby proving 'control' of Host B. As the SNI name used was a
407 subdomain of the domain name being validated, rather than the domain
408 name itself, it was likely to not already be registered with the
409 service provider for traffic routing, making it much easier for a
410 hijack to occur.
411
412Acknowledgments
413
414 The author would like to thank all those that provided design
415 insights and editorial review of this document, including Richard
416 Barnes, Ryan Hurst, Adam Langley, Ryan Sleevi, Jacob Hoffman-Andrews,
417 Daniel McCarney, Marcin Walas, Martin Thomson, and especially Frans
418 Rosen, who discovered the vulnerability in the TLS SNI method that
419 necessitated the writing of this specification.
420
421Author's Address
422
423 Roland Bracewell Shoemaker
424 Internet Security Research Group
425
426 Email: roland@letsencrypt.org
427