RFC 8162

Using Secure DNS to Associate Certificates with Domain Names for S/MIME

πŸ“… published May 2017, from ietf

RFC 8162: Using Secure DNS to Associate Certificates with Domain Names for S/MIME πŸ’Œ

Okay bestie, this is RFC 8162 πŸŽ€, and it's called "Using Secure DNS to Associate Certificates with Domain Names for S/MIME". It was written by P. Hoffman (ICANN) and J. Schlyter (Kirei AB) πŸ’–. It came out in May 2017 as part of the IETF stream, its ISSN is 2070-1721, and it's marked Experimental πŸ§ͺ. The title block doesn't list anything it obsoletes or updates, so it's a standalone experiment πŸ¦‹.

Abstract ✨

This document describes how to use secure DNS to associate an S/MIME user's certificate with the intended domain name. It's kind of like how DNS-Based Authentication of Named Entities (DANE), RFC 6698, does the same job for TLS πŸ”.

Status of This Memo πŸ“œ

This document is not an Internet Standards Track specification. It's being published for examination, experimental implementation, and evaluation πŸ§ͺ.

It defines an Experimental Protocol for the Internet community 🌈. It's a product of the Internet Engineering Task Force (IETF) and represents the consensus of the IETF community. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). Not every document the IESG approves is a candidate for any level of Internet Standard, so see Section 2 of RFC 7841 for that part πŸ’….

For the current status, any errata, and how to give feedback, check http://www.rfc-editor.org/info/rfc8162 ✨.

Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved πŸ’œ.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as in effect on the date of publication. Please read these carefully, because they spell out your rights and restrictions for this document πŸ“–. Code Components pulled out of this document must include the Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Simplified BSD License describes 🫢.

Table of Contents πŸ—ΊοΈ

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
  1.1.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   3
  1.2.  Experiment Goal . . . . . . . . . . . . . . . . . . . . .   3
2.  The SMIMEA Resource Record  . . . . . . . . . . . . . . . . .   4
3.  Location of the SMIMEA Record . . . . . . . . . . . . . . . .   4
4.  Email Address Variants and Internationalization
    Considerations  . . . . . . . . . . . . . . . . . . . . . . .   5
5.  Mandatory-to-Implement Features . . . . . . . . . . . . . . .   6
6.  Application Use of S/MIME Certificate Associations  . . . . .   6
7.  Certificate Size and DNS  . . . . . . . . . . . . . . . . . .   7
8.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   7
9.  Security Considerations . . . . . . . . . . . . . . . . . . .   7
  9.1.  Response Size . . . . . . . . . . . . . . . . . . . . . .   8
  9.2.  Email Address Information Leak  . . . . . . . . . . . . .   8
10. References  . . . . . . . . . . . . . . . . . . . . . . . . .   9
  10.1.  Normative References . . . . . . . . . . . . . . . . . .   9
  10.2.  Informative References . . . . . . . . . . . . . . . . .  10
Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  11
Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  11

1. Introduction 🌸

Okay so S/MIME [RFC5751] messages often carry a certificate, and some carry more than one πŸ“¨. These certificates help authenticate the sender, and they can be used to encrypt the replies. For the S/MIME receiver to authenticate that a message really comes from the sender it names, the receiver's Mail User Agent (MUA) must validate that the certificate is associated with the purported sender πŸ•΅οΈβ€β™€οΈ. Right now, the MUA must trust a trust anchor that the sender's certificate is rooted in, and it must successfully validate the certificate. There are other requirements on the MUA too, like tying the identity in the certificate to the one in the message, but those are out of scope for this document πŸ™ˆ.

Some people want to authenticate that the sender's certificate belongs to the sender without trusting a configured trust anchor πŸ‘€. Others want to fix the pain of hunting down certificates from outside the enterprise 😩. The DNS administrator for a domain is already authorized to give identifying information about the zone, so it makes sense to let that same admin make an authoritative binding between email messages that claim to come from the domain and a certificate that someone authorized to send mail from those servers might use πŸ’…. The easiest way to do that is the DNS. Iconic, honestly πŸ‘‘.

This document describes a mechanism for associating a user's certificate with the domain. It's similar to what DANE itself describes [RFC6698], as updated by [RFC7218] and [RFC7671], and it's also similar to the mechanism in [RFC7929] for OpenPGP πŸ¦‹. Most of the operational and security considerations for this mechanism are described in RFC 6698, and they aren't repeated here at all πŸ™ƒ. Only the major differences between this mechanism and the one in RFC 6698 are described here, so the reader must be familiar with RFC 6698 before reading this document πŸ“š.

1.1. Terminology πŸ”€

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here πŸ’œ.

This document also uses standard PKIX, DNSSEC, and S/MIME terminology. For those terms, see PKIX [RFC5280], DNSSEC [RFC4033] [RFC4034] [RFC4035], and S/MIME [RFC5751] ✨.

1.2. Experiment Goal πŸ§ͺ

This specification is one experiment in improving access to public keys for end-to-end email security πŸ”. There are a bunch of reasonable ways to do this for OpenPGP or S/MIME, like using the DNS, SMTP, or HTTP 🌍. Proposals for each have been made, with different levels of implementation and deployment support πŸ› οΈ. For each experiment, specs like this one let people try things out. Some will succeed, and some will uncover technical or other blockers for large- or small-scale deployments πŸ§—β€β™€οΈ. The IETF encourages people who implement and deploy these experiments to publicly document what they learned, so future specs in this space can benefit πŸ“.

This document defines an RRtype whose use is Experimental πŸ¦‹. The goal is to see whether encrypted email usage goes up if an automated discovery method is available to Mail Transfer Agents (MTAs), and if MUAs help end users with email encryption key management πŸ”‘.

Honest moment: it's unclear whether this RRtype will scale to some of the bigger email service deployments 😬. People have raised concerns about the size of the SMIMEA record and the size of the resulting DNS zone files πŸ“ˆ. Hopefully this experiment will show the IETF whether or not that's actually a problem 🀞.

If the experiment succeeds, the findings are expected to lead to an updated document for Standards Track approval πŸ†.

2. The SMIMEA Resource Record πŸ“‡

The SMIMEA DNS resource record (RR) is used to associate an end entity certificate or public key with the associated email address, which forms a "SMIMEA certificate association" πŸ’Œ. The semantics of how the SMIMEA resource record is interpreted are covered later in this document πŸ“–. Note that the information in a SMIMEA record might be for the end entity certificate, or it might be for the trust anchor or an intermediate certificate 🧠. This mechanism is similar to the one in [RFC7929] for OpenPGP πŸ¦‹.

The type value for the SMIMEA RRtype is defined in Section 8 πŸ”’. The SMIMEA resource record is class independent 🌐.

The SMIMEA wire format and presentation format are the same as the TLSA record's, as described in Section 2.1 of [RFC6698] πŸŽ€. The certificate usage field, the selector field, and the matching type field all have the same format. The semantics are also the same, except where RFC 6698 talks about TLS as the target protocol for the certificate information πŸ’….

3. Location of the SMIMEA Record πŸ—ΊοΈ

The DNS doesn't allow every character that's supported in the "local-part" of email addresses, as defined in [RFC5322] and [RFC6530] πŸ™…β€β™€οΈ. So email addresses get mapped into DNS with the following method ✨:

  1. The "left-hand side" of the email address, called the "local-part" in both the mail message format definition [RFC5322] and the internationalized email spec [RFC6530], is encoded in UTF-8 (or its subset ASCII) πŸ”€. If the local-part is written in another charset, it MUST be converted to UTF-8 πŸ’–.
  2. The local-part gets canonicalized first, using these rules 🧹. If the local-part is unquoted, any comments and/or folding whitespace (CFWS) around dots (".") get removed. Any enclosing double quotes get removed. Any literal quoting gets removed too βœ‚οΈ.
  3. If the local-part has any non-ASCII characters, it SHOULD be normalized using Unicode Normalization Form C from [UNICODE] 🌏. The recommended normalization rules are in Section 10.1 of [RFC6530] πŸ“š.
  4. The local-part gets hashed with the SHA2-256 [RFC5754] algorithm. The hash is truncated to 28 octets and written in its hexadecimal representation, and that becomes the left-most label in the prepared domain name πŸ”.
  5. The string "_smimecert" becomes the second left-most label in the prepared domain name 🏷️.
  6. The domain name (the "right-hand side" of the email address, called the "domain" in [RFC5322]) gets appended to the result of step 5, which completes the prepared domain name πŸŽ‰.

For example, if you want to request an SMIMEA resource record for a user whose email address is "hugh@example.com", you'd place an SMIMEA query for this QNAME 🧚:

c93f1e400f26708f98cb19d936620da35eec8f72e57f9eec01c1afd6._smimecert.example.com

4. Email Address Variants and Internationalization Considerations ✨

okay so email local-parts are kinda chaotic 😭 Mail systems usually handle variant forms of them. The most common variants are upper and lower case, and systems often fix those automatically once they recognize a name. Other variants include systems that ignore "noise" characters like dots, so johnsmith and John.Smith would count as the same thing. Many systems also allow "extensions" like john-ext or mary+ext, where john or mary is the effective local-part and the ext gets passed to the recipient for further handling 🧚. This can make it tricky to find the SMIMEA record for a dynamically created email address.

[RFC5321] and its predecessors have always been clear that only the recipient MTA is allowed to interpret the local-part of an address. So sending MUAs and MTAs that support this specification MUST NOT perform any kind of mapping rules based on the email address πŸ™…β€β™€οΈ. To improve the odds of finding SMIMEA resource records for a particular local-part, domains that allow variant forms (like treating local-parts as case-insensitive) might publish SMIMEA resource records for all of the variants. They might publish variants on first use (for example, a webmail provider that also controls DNS for a domain can publish variants as used by the owner of a particular local-part), or they might just publish SMIMEA resource records for the most common variants.

Section 3 above defines how the local-part is used to determine where to look for an SMIMEA resource record. Given how many kinds of local-parts show up in email, designing a good experiment here is hard πŸ₯Ί. First, some current implementations are known to lowercase at least US-ASCII local-parts. Second, we know from (many) other situations that any strategy based on guessing and making multiple DNS queries is not going to reach consensus, and there are good reasons for that. Third, the underlying issues are just hard. See Section 10.1 of [RFC6530] for a discussion of just some of the issues that would need to be tackled to fully address this problem.

Honestly though, this specification is not the place to fix these local-part issues, and fixing them isn't required to figure out the outcome of this experiment πŸ’–. If this experiment succeeds, further work on email addresses with non-ASCII local-parts will be needed. That work would be better based on what this experiment finds, rather than doing nothing or starting this experiment with a speculative approach to a very complex topic 🌸.


5. Mandatory-to-Implement Features πŸ’…

S/MIME MUAs conforming to this specification MUST be able to correctly interpret SMIMEA records with certificate usages 0, 1, 2, and 3. They also MUST be able to compare a certificate association with a certificate offered by another S/MIME MUA using selector types 0 and 1, and matching type 0 (no hash used) and matching type 1 (SHA-256). They SHOULD be able to make such comparisons with matching type 2 (SHA-512) too πŸ‘‘.

S/MIME MUAs conforming to this specification MUST be able to interpret any S/MIME capabilities (defined in [RFC4262]) in any certificates they receive through SMIMEA records πŸŽ€.

6. Application Use of S/MIME Certificate Associations πŸ”

The SMIMEA record lets an application or service grab an S/MIME certificate or public key and use it to verify a digital signature or to encrypt a message to that public key. The DNS answer MUST pass DNSSEC validation. If DNSSEC validation reaches any state other than "Secure" (as specified in [RFC4035]), then the DNSSEC validation MUST be treated as a failure 🚫.

If no S/MIME certificates are known for an email address, an SMIMEA DNS lookup MAY be performed to look for the certificate or public key that corresponds to that address. The result can then be used to verify a received signed message, or to send out an encrypted email message πŸ’Œ. An application whose attempt fails to retrieve a DNSSEC-verified SMIMEA resource record from the DNS should remember that failed attempt and not retry it for some time. This stops the app from sending out a DNS request for every single email it sends, and those DNS requests count as a privacy leak πŸ™ˆ.

7. Certificate Size and DNS πŸ“¦

Because the SMIMEA record can be pretty big, applications SHOULD use TCP (not UDP) to query for the SMIMEA resource record 🧦.

The reliability of transporting large DNS resource records has gotten better over the last few years, but it's still recommended to keep DNS records as small as possible without sacrificing the security properties of the public key πŸ“. The algorithm type and key size of certificates should not be modified to make this section work.

8. IANA Considerations πŸ“‹

This document uses a new DNS RRtype, SMIMEA, whose value (53) was allocated by IANA from the "Resource Record (RR) TYPEs" subregistry of the "Domain Name System (DNS) Parameters" registry 🌈.

9. Security Considerations 🚨

Client treatment of any information included in the trust anchor is a matter of local policy. This specification does not mandate that the domain name administrator inspect or validate that information 🧐.

DNSSEC does not protect the queries from pervasive monitoring as defined in [RFC7258]. Since DNS queries are mostly unencrypted right now, a query looking up a target SMIMEA record could reveal that a user using the (monitored) recursive DNS server is trying to send encrypted email to a target πŸ‘€.

Lots of different components could be responsible for encrypting an email message to a target recipient. It could be done by the sender's MUA, by an MUA plugin, or by the sender's MTA, and each one has its own characteristics 🧩. An MUA can ask the user to make a decision before continuing, and it can either accept or refuse a message. The MTA might deliver the message as is, or it might encrypt the message before delivering it. Each of these components should attempt to encrypt an unencrypted outgoing message whenever possible πŸ”’.

In theory, two different local-parts could hash to the same value. This document assumes that such a hash collision has a negligible chance of happening 🎲.

If an obtained S/MIME certificate is revoked or expired, that certificate MUST NOT be used, even if not using it would mean sending a message in plaintext πŸ™…β€β™€οΈ.

Anyone who can obtain a DNSSEC private key of a domain name through coercion, theft, or brute-force calculations can replace any SMIMEA record in that zone and in all of the delegated child zones πŸ’€. Any future messages encrypted with the malicious SMIMEA key could then be read. So a certificate or key obtained from a DNSSEC-validated SMIMEA record can only be trusted as much as the DNS domain can be trusted.

Organizations that are required to be able to read everyone's encrypted email should publish the escrow key as the SMIMEA record. Mail servers of such organizations MAY optionally re-encrypt the message to the individual's S/MIME key. This case can be seen as a special case of the key-replacement attack described above πŸ—οΈ.

9.1. Response Size πŸ“

To prevent amplification attacks, an Authoritative DNS server MAY wish to prevent returning SMIMEA records over UDP unless the source IP address has been confirmed with DNS Cookies [RFC7873] πŸͺ. If a query comes in over UDP without source IP address verification, the server MUST NOT return REFUSED. Instead, it answers the query with an empty answer section and the truncation flag set (TC=1).

9.2. Email Address Information Leak πŸ•΅οΈβ€β™€οΈ

The hashing of the local-part in this document is not a security feature. Publishing SMIMEA records will create a list of hashes of valid email addresses, which could make it easier to get a list of valid email addresses for a particular domain. It's desirable not to make email address harvesting easier where possible πŸ™ƒ.

The domain name part of the email address is not used as part of the hash, so the hashes can be used in multiple zones deployed using DNAME [RFC6672]. That also makes it slightly easier and cheaper to brute-force the SHA2-256 hashes into common and short local-parts, because single rainbow tables [Rainbow] can be reused across domains. This can be somewhat countered by using NSEC3 [RFC5155].

DNS zones signed with DNSSEC that use NSEC [RFC4033] for denial of existence are susceptible to zone walking, a mechanism that lets someone enumerate all the SMIMEA hashes in a zone. This can be combined with previously hashed common or short local-parts (in rainbow tables) to deduce valid email addresses. DNSSEC-signed zones that use NSEC3 for denial of existence, instead of NSEC, are significantly harder to brute-force after a zone walk 🧱.

10. References πŸ“š

10.1. Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <http://www.rfc-editor.org/info/rfc2119>.

   [RFC4033]  Arends, R., Austein, R., Larson, M., Massey, D., and S.
              Rose, "DNS Security Introduction and Requirements",
              RFC 4033, DOI 10.17487/RFC4033, March 2005,
              <http://www.rfc-editor.org/info/rfc4033>.

   [RFC4034]  Arends, R., Austein, R., Larson, M., Massey, D., and S.
              Rose, "Resource Records for the DNS Security Extensions",
              RFC 4034, DOI 10.17487/RFC4034, March 2005,
              <http://www.rfc-editor.org/info/rfc4034>.

   [RFC4035]  Arends, R., Austein, R., Larson, M., Massey, D., and S.
              Rose, "Protocol Modifications for the DNS Security
              Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005,
              <http://www.rfc-editor.org/info/rfc4035>.

   [RFC5280]  Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
              Housley, R., and W. Polk, "Internet X.509 Public Key
              Infrastructure Certificate and Certificate Revocation List
              (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008,
              <http://www.rfc-editor.org/info/rfc5280>.

   [RFC5751]  Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet
              Mail Extensions (S/MIME) Version 3.2 Message
              Specification", RFC 5751, DOI 10.17487/RFC5751, January
              2010, <http://www.rfc-editor.org/info/rfc5751>.

   [RFC5754]  Turner, S., "Using SHA2 Algorithms with Cryptographic
              Message Syntax", RFC 5754, DOI 10.17487/RFC5754, January
              2010, <http://www.rfc-editor.org/info/rfc5754>.

   [RFC6698]  Hoffman, P. and J. Schlyter, "The DNS-Based Authentication
              of Named Entities (DANE) Transport Layer Security (TLS)
              Protocol: TLSA", RFC 6698, DOI 10.17487/RFC6698, August
              2012, <http://www.rfc-editor.org/info/rfc6698>.

   [RFC7671]  Dukhovni, V. and W. Hardaker, "The DNS-Based
              Authentication of Named Entities (DANE) Protocol: Updates
              and Operational Guidance", RFC 7671, DOI 10.17487/RFC7671,
              October 2015, <http://www.rfc-editor.org/info/rfc7671>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <http://www.rfc-editor.org/info/rfc8174>.

10.2. Informative References ✨

Okay bestie, these are the informative refs, so they're the extra reading that backs up the spec without being required to implement it πŸ“šπŸ«Ά Here's the lineup:

[Rainbow] is Oechslin's paper on making a faster cryptanalytic time-memory trade-off 🌈 It's from 2003, and you can find it at <http://www.iacr.org/cryptodb/archive/2003/CRYPTO/1615/1615.ps>. Its DOI is 10.1007/978-3-540-45146-4_36. Very academic, very iconic πŸ’…

[RFC4262] is Santesson's X.509 certificate extension for S/MIME capabilities πŸŽ€ It came out in December 2005 with DOI 10.17487/RFC4262 and lives at <http://www.rfc-editor.org/info/rfc4262>.

[RFC5155] is Laurie, Sisson, Arends, and Blacka on DNSSEC hashed authenticated denial of existence 🧚 Dated March 2008, DOI 10.17487/RFC5155, found at <http://www.rfc-editor.org/info/rfc5155>.

[RFC5321] is Klensin's Simple Mail Transfer Protocol βœ‰οΈ October 2008, DOI 10.17487/RFC5321, at <http://www.rfc-editor.org/info/rfc5321>. Every email girlie knows this one πŸ’–

[RFC5322] is Resnick (Ed.) on the Internet Message Format πŸ’Œ Also October 2008, DOI 10.17487/RFC5322, at <http://www.rfc-editor.org/info/rfc5322>.

[RFC6530] is Klensin and Ko's overview and framework for internationalized email 🌸 February 2012, DOI 10.17487/RFC6530, at <http://www.rfc-editor.org/info/rfc6530>.

[RFC6672] is Rose and Wijngaards on DNAME redirection in the DNS πŸ¦‹ June 2012, DOI 10.17487/RFC6672, at <http://www.rfc-editor.org/info/rfc6672>.

[RFC7218] is Gudmundsson adding acronyms to make DANE conversations way easier πŸ™ˆ April 2014, DOI 10.17487/RFC7218, at <http://www.rfc-editor.org/info/rfc7218>. Honestly, the naming is iconic.

[RFC7258] is Farrell and Tschofenig saying pervasive monitoring is an attack, and it's BCP 188 ✨ May 2014, DOI 10.17487/RFC7258, at <http://www.rfc-editor.org/info/rfc7258>. This one is serious, so pay attention 😭

[RFC7873] is Eastlake 3rd and Andrews on DNS Cookies πŸ“ May 2016, DOI 10.17487/RFC7873, at <http://www.rfc-editor.org/info/rfc7873>.

[RFC7929] is Wouters on DANE bindings for OpenPGP πŸ”₯ August 2016, DOI 10.17487/RFC7929, at <http://www.rfc-editor.org/info/rfc7929>.

[UNICODE] is The Unicode Consortium's "The Unicode Standard" 🌈 You can find the latest version at <http://www.unicode.org/versions/latest/>.


Acknowledgements 🫢

Okay, big shoutout time! A huge chunk of this document is copied from [RFC7929] πŸ’œ That material was created by Paul Wouters and other people in the IETF DANE WG, so give them all the love πŸ‘‘

Brian Dickson, Stephen Farrell, Miek Gieben, Martin Pels, and Jim Schaad brought technical ideas and support to the table too ✨ Thank you, queens πŸŽ€


Authors' Addresses πŸ’Œ

Paul Hoffman ICANN

Email: paul.hoffman@icann.org

Jakob Schlyter Kirei AB

Email: jakob@kirei.se

πŸ“¦ where this page comes from