idnits 2.17.1 draft-ietf-dkim-rfc4871bis-07.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 : ---------------------------------------------------------------------------- -- The draft header indicates that this document obsoletes RFC5672, but the abstract doesn't seem to directly say this. It does mention RFC5672 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1316 has weird spacing: '... email elec...' -- The document date (April 24, 2011) is 4744 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'ITU-X660-1997' is defined on line 2857, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-180-2-2002' -- Possible downref: Non-RFC (?) normative reference: ref. 'ITU-X660-1997' ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Downref: Normative reference to an Informational RFC: RFC 5598 -- Obsolete informational reference (is this intentional?): RFC 4409 (Obsoleted by RFC 6409) -- Obsolete informational reference (is this intentional?): RFC 4870 (Obsoleted by RFC 4871) -- Obsolete informational reference (is this intentional?): RFC 4871 (Obsoleted by RFC 6376) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 5451 (Obsoleted by RFC 7001) -- Obsolete informational reference (is this intentional?): RFC 5751 (Obsoleted by RFC 8551) Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 11 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group D. Crocker, Ed. 3 Internet-Draft Brandenburg InternetWorking 4 Obsoletes: 4871, 5672 T. Hansen, Ed. 5 (if approved) AT&T Laboratories 6 Intended status: Standards Track M. Kucherawy, Ed. 7 Expires: October 26, 2011 Cloudmark 8 April 24, 2011 10 DomainKeys Identified Mail (DKIM) Signatures 11 draft-ietf-dkim-rfc4871bis-07 13 Abstract 15 DomainKeys Identified Mail (DKIM) permits a person, role, or 16 organization that owns the signing domain to claim some 17 responsibility for a message by associating the domain with the 18 message. This can be an author's organization, an operational relay 19 or one of their agents. DKIM separates the question of the identity 20 of the signer of the message from the purported author of the 21 message. Assertion of responsibility is validated through a 22 cryptographic signature and querying the signer's domain directly to 23 retrieve the appropriate public key. Message transit from author to 24 recipient is through relays that typically make no substantive change 25 to the message content and thus preserve the DKIM signature. 27 This memo obsoletes RFC4871 and RFC5672 {DKIM 14}. 29 Status of this Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on October 26, 2011. 46 Copyright Notice 48 Copyright (c) 2011 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Notes to Editor and Reviewers . . . . . . . . . . . . . . . . 5 64 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 65 2.1. Signing Identity . . . . . . . . . . . . . . . . . . . . . 6 66 2.2. Scalability . . . . . . . . . . . . . . . . . . . . . . . 6 67 2.3. Simple Key Management . . . . . . . . . . . . . . . . . . 6 68 2.4. Data Integrity . . . . . . . . . . . . . . . . . . . . . . 6 69 3. Terminology and Definitions . . . . . . . . . . . . . . . . . 7 70 3.1. Signers . . . . . . . . . . . . . . . . . . . . . . . . . 7 71 3.2. Verifiers . . . . . . . . . . . . . . . . . . . . . . . . 7 72 3.3. Identity . . . . . . . . . . . . . . . . . . . . . . . . . 7 73 3.4. Identifier . . . . . . . . . . . . . . . . . . . . . . . . 8 74 3.5. Signing Domain Identifier (SDID) . . . . . . . . . . . . . 8 75 3.6. Agent or User Identifier (AUID) . . . . . . . . . . . . . 8 76 3.7. Identity Assessor . . . . . . . . . . . . . . . . . . . . 8 77 3.8. Whitespace . . . . . . . . . . . . . . . . . . . . . . . . 8 78 3.9. Imported ABNF Tokens . . . . . . . . . . . . . . . . . . . 9 79 3.10. Common ABNF Tokens . . . . . . . . . . . . . . . . . . . . 9 80 3.11. DKIM-Quoted-Printable . . . . . . . . . . . . . . . . . . 10 81 4. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 11 82 4.1. Selectors . . . . . . . . . . . . . . . . . . . . . . . . 11 83 4.2. Tag=Value Lists . . . . . . . . . . . . . . . . . . . . . 13 84 4.3. Signing and Verification Algorithms . . . . . . . . . . . 14 85 4.4. Canonicalization . . . . . . . . . . . . . . . . . . . . . 15 86 4.5. The DKIM-Signature Header Field . . . . . . . . . . . . . 20 87 4.6. Key Management and Representation . . . . . . . . . . . . 29 88 4.7. Computing the Message Hashes . . . . . . . . . . . . . . . 33 89 4.8. Input Requirements . . . . . . . . . . . . . . . . . . . . 36 90 4.9. Signing by Parent Domains . . . . . . . . . . . . . . . . 36 91 4.10. Relationship between SDID and AUID . . . . . . . . . . . . 36 92 5. Semantics of Multiple Signatures . . . . . . . . . . . . . . . 37 93 5.1. Example Scenarios . . . . . . . . . . . . . . . . . . . . 37 94 5.2. Interpretation . . . . . . . . . . . . . . . . . . . . . . 38 95 6. Signer Actions . . . . . . . . . . . . . . . . . . . . . . . . 39 96 6.1. Determine Whether the Email Should Be Signed and by 97 Whom . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 98 6.2. Select a Private Key and Corresponding Selector 99 Information . . . . . . . . . . . . . . . . . . . . . . . 40 100 6.3. Normalize the Message to Prevent Transport Conversions . . 41 101 6.4. Determine the Header Fields to Sign . . . . . . . . . . . 41 102 6.5. Recommended Signature Content . . . . . . . . . . . . . . 43 103 6.6. Compute the Message Hash and Signature . . . . . . . . . . 45 104 6.7. Insert the DKIM-Signature Header Field . . . . . . . . . . 45 105 7. Verifier Actions . . . . . . . . . . . . . . . . . . . . . . . 46 106 7.1. Extract Signatures from the Message . . . . . . . . . . . 46 107 7.2. Communicate Verification Results . . . . . . . . . . . . . 52 108 7.3. Interpret Results/Apply Local Policy . . . . . . . . . . . 52 109 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 53 110 8.1. DKIM-Signature Tag Specifications . . . . . . . . . . . . 53 111 8.2. DKIM-Signature Query Method Registry . . . . . . . . . . . 54 112 8.3. DKIM-Signature Canonicalization Registry . . . . . . . . . 54 113 8.4. _domainkey DNS TXT Record Tag Specifications . . . . . . . 55 114 8.5. DKIM Key Type Registry . . . . . . . . . . . . . . . . . . 56 115 8.6. DKIM Hash Algorithms Registry . . . . . . . . . . . . . . 56 116 8.7. DKIM Service Types Registry . . . . . . . . . . . . . . . 56 117 8.8. DKIM Selector Flags Registry . . . . . . . . . . . . . . . 57 118 8.9. DKIM-Signature Header Field . . . . . . . . . . . . . . . 57 119 9. Security Considerations . . . . . . . . . . . . . . . . . . . 57 120 9.1. Misuse of Body Length Limits ("l=" Tag) . . . . . . . . . 57 121 9.2. Misappropriated Private Key . . . . . . . . . . . . . . . 58 122 9.3. Key Server Denial-of-Service Attacks . . . . . . . . . . . 59 123 9.4. Attacks Against the DNS . . . . . . . . . . . . . . . . . 59 124 9.5. Replay Attacks . . . . . . . . . . . . . . . . . . . . . . 60 125 9.6. Limits on Revoking Keys . . . . . . . . . . . . . . . . . 61 126 9.7. Intentionally Malformed Key Records . . . . . . . . . . . 61 127 9.8. Intentionally Malformed DKIM-Signature Header Fields . . . 61 128 9.9. Information Leakage . . . . . . . . . . . . . . . . . . . 61 129 9.10. Remote Timing Attacks . . . . . . . . . . . . . . . . . . 61 130 9.11. Reordered Header Fields . . . . . . . . . . . . . . . . . 61 131 9.12. RSA Attacks . . . . . . . . . . . . . . . . . . . . . . . 62 132 9.13. Inappropriate Signing by Parent Domains . . . . . . . . . 62 133 9.14. Attacks Involving Addition of Header Fields . . . . . . . 62 134 9.15. Malformed Inputs . . . . . . . . . . . . . . . . . . . . . 63 135 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 64 136 10.1. Normative References . . . . . . . . . . . . . . . . . . . 64 137 10.2. Informative References . . . . . . . . . . . . . . . . . . 65 138 Appendix A. Example of Use (INFORMATIVE) . . . . . . . . . . . . 66 139 A.1. The User Composes an Email . . . . . . . . . . . . . . . . 66 140 A.2. The Email is Signed . . . . . . . . . . . . . . . . . . . 67 141 A.3. The Email Signature is Verified . . . . . . . . . . . . . 68 142 Appendix B. Usage Examples (INFORMATIVE) . . . . . . . . . . . . 69 143 B.1. Alternate Submission Scenarios . . . . . . . . . . . . . . 69 144 B.2. Alternate Delivery Scenarios . . . . . . . . . . . . . . . 71 145 Appendix C. Creating a Public Key (INFORMATIVE) . . . . . . . . . 73 146 C.1. Compatibility with DomainKeys Key Records . . . . . . . . 74 147 Appendix D. MUA Considerations . . . . . . . . . . . . . . . . . 74 148 Appendix E. Acknowledgements . . . . . . . . . . . . . . . . . . 75 149 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 76 151 1. Notes to Editor and Reviewers 153 This version of the memo contains notations such as "{DKIM 2}". 154 These correspond to DKIM working group issue tracker items. they 155 should be deleted prior to publication. 157 2. Introduction 159 DomainKeys Identified Mail (DKIM) permits a person, role, or 160 organization to claim some responsibility for a message by 161 associating a domain name [RFC1034] with the message [RFC5322], which 162 they are authorized to use. This can be an author's organization, an 163 operational relay or one of their agents. Assertion of 164 responsibility is validated through a cryptographic signature and 165 querying the signer's domain directly to retrieve the appropriate 166 public key. Message transit from author to recipient is through 167 relays that typically make no substantive change to the message 168 content and thus preserve the DKIM signature. A message can contain 169 multiple signatures, from the same or different organizations 170 involved with the message. 172 The approach taken by DKIM differs from previous approaches to 173 message signing (e.g., Secure/Multipurpose Internet Mail Extensions 174 (S/MIME) [RFC1847], OpenPGP [RFC4880]) in that: 176 o the message signature is written as a message header field so that 177 neither human recipients nor existing MUA (Mail User Agent) 178 software is confused by signature-related content appearing in the 179 message body; 181 o there is no dependency on public and private key pairs being 182 issued by well-known, trusted certificate authorities; 184 o there is no dependency on the deployment of any new Internet 185 protocols or services for public key distribution or revocation; 187 o signature verification failure does not force rejection of the 188 message; 190 o no attempt is made to include encryption as part of the mechanism; 192 o message archiving is not a design goal. 194 DKIM: 196 o is compatible with the existing email infrastructure and 197 transparent to the fullest extent possible; 199 o requires minimal new infrastructure; 201 o can be implemented independently of clients in order to reduce 202 deployment time; 204 o can be deployed incrementally; 206 o allows delegation of signing to third parties. 208 2.1. Signing Identity 210 DKIM separates the question of the identity of the signer of the 211 message from the purported author of the message. In particular, a 212 signature includes the identity of the signer. Verifiers can use the 213 signing information to decide how they want to process the message. 214 The signing identity is included as part of the signature header 215 field. 217 INFORMATIVE RATIONALE: The signing identity specified by a DKIM 218 signature is not required to match an address in any particular 219 header field because of the broad methods of interpretation by 220 recipient mail systems, including MUAs. 222 2.2. Scalability 224 DKIM is designed to support the extreme scalability requirements that 225 characterize the email identification problem. There are currently 226 over 70 million domains and a much larger number of individual 227 addresses. DKIM seeks to preserve the positive aspects of the 228 current email infrastructure, such as the ability for anyone to 229 communicate with anyone else without introduction. 231 2.3. Simple Key Management 233 DKIM differs from traditional hierarchical public-key systems in that 234 no Certificate Authority infrastructure is required; the verifier 235 requests the public key from a repository in the domain of the 236 claimed signer directly rather than from a third party. 238 The DNS is proposed as the initial mechanism for the public keys. 239 Thus, DKIM currently depends on DNS administration and the security 240 of the DNS system. DKIM is designed to be extensible to other key 241 fetching services as they become available. 243 2.4. Data Integrity 245 A DKIM signature associates the d= name with the computed hash of 246 some or all of the message (see Section 3.7) in order to prevent the 247 re-use of the signature with different messages. Verifying the 248 signature asserts that the hashed content has not changed since it 249 was signed, and asserts nothing else about "protecting" the end-to- 250 end integrity of the message. 252 3. Terminology and Definitions 254 This section defines terms used in the rest of the document. 256 DKIM is designed to operate within the Internet Mail service, as 257 defined in [RFC5598]. Basic email terminology is taken from that 258 specification. 260 Syntax descriptions use Augmented BNF (ABNF) [RFC5234]. 262 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 263 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 264 document are to be interpreted as described in [RFC2119]. 266 3.1. Signers 268 Elements in the mail system that sign messages on behalf of a domain 269 are referred to as signers. These may be MUAs (Mail User Agents), 270 MSAs (Mail Submission Agents), MTAs (Mail Transfer Agents), or other 271 agents such as mailing list exploders. In general, any signer will 272 be involved in the injection of a message into the message system in 273 some way. The key issue is that a message must be signed before it 274 leaves the administrative domain of the signer. 276 3.2. Verifiers 278 Elements in the mail system that verify signatures are referred to as 279 verifiers. These may be MTAs, Mail Delivery Agents (MDAs), or MUAs. 280 In most cases it is expected that verifiers will be close to an end 281 user (reader) of the message or some consuming agent such as a 282 mailing list exploder. 284 3.3. Identity 286 A person, role, or organization. In the context of DKIM, examples 287 include the author, the author's organization, an ISP along the 288 handling path, an independent trust assessment service, and a mailing 289 list operator. 291 3.4. Identifier 293 A label that refers to an identity. 295 3.5. Signing Domain Identifier (SDID) 297 A single domain name that is the mandatory payload output of DKIM and 298 that refers to the identity claiming responsibility for introduction 299 of a message into the mail stream. For DKIM processing, the name has 300 only basic domain name semantics; any possible owner-specific 301 semantics are outside the scope of DKIM. It is specified in 302 Section 4.5. 304 3.6. Agent or User Identifier (AUID) 306 A single identifier that refers to the agent or user on behalf of 307 whom the Signing Domain Identifier (SDID) has taken responsibility. 308 The AUID comprises a domain name and an optional . The 309 domain name is the same as that used for the SDID or is a sub-domain 310 of it. For DKIM processing, the domain name portion of the AUID has 311 only basic domain name semantics; any possible owner-specific 312 semantics are outside the scope of DKIM. It is specified in 313 Section 4.5 . 315 3.7. Identity Assessor 317 A module that consumes DKIM's mandatory payload, which is the 318 responsible Signing Domain Identifier (SDID). The module is 319 dedicated to the assessment of the delivered identifier. Other DKIM 320 (and non-DKIM) values can also be delivered to this module as well as 321 to a more general message evaluation filtering engine. However, this 322 additional activity is outside the scope of the DKIM signature 323 specification. 325 3.8. Whitespace 327 There are three forms of whitespace: 329 o WSP represents simple whitespace, i.e., a space or a tab character 330 (formal definition in [RFC5234]). 332 o LWSP is linear whitespace, defined as WSP plus CRLF (formal 333 definition in [RFC5234]). 335 o FWS is folding whitespace. It allows multiple lines separated by 336 CRLF followed by at least one whitespace, to be joined. 338 The formal ABNF for these are (WSP and LWSP are given for information 339 only): 340 WSP = SP / HTAB 341 LWSP = *(WSP / CRLF WSP) 342 FWS = [*WSP CRLF] 1*WSP 344 The definition of FWS is identical to that in [RFC5322] except for 345 the exclusion of obs-FWS. 347 3.9. Imported ABNF Tokens 349 The following tokens are imported from other RFCs as noted. Those 350 RFCs should be considered definitive. 352 The following tokens are imported from [RFC5321]: 354 o "Local-part" (implementation warning: this permits quoted strings) 356 o "sub-domain" 358 The following tokens are imported from [RFC5322]: 360 o "field-name" (name of a header field) 362 o "dot-atom-text" (in the Local-part of an email address) 364 The following tokens are imported from [RFC2045]: 366 o "qp-section" (a single line of quoted-printable-encoded text) 368 o "hex-octet" (a quoted-printable encoded octet) 370 INFORMATIVE NOTE: Be aware that the ABNF in [RFC2045] does not 371 obey the rules of [RFC5234] and must be interpreted accordingly, 372 particularly as regards case folding. 374 Other tokens not defined herein are imported from [RFC5234]. These 375 are intuitive primitives such as SP, HTAB, WSP, ALPHA, DIGIT, CRLF, 376 etc. 378 3.10. Common ABNF Tokens 379 The following ABNF tokens are used elsewhere in this document: 380 hyphenated-word = ALPHA [ *(ALPHA / DIGIT / "-") (ALPHA / DIGIT) ] 381 ALPHADIGITPS = (ALPHA / DIGIT / "+" / "/") 382 base64string = ALPHADIGITPS *([FWS] ALPHADIGITPS) 383 [ [FWS] "=" [ [FWS] "=" ] ] 384 hdr-name = field-name 385 qp-hdr-value = dkim-quoted-printable ; with "|" encoded 387 3.11. DKIM-Quoted-Printable 389 The DKIM-Quoted-Printable encoding syntax resembles that described in 390 Quoted-Printable [RFC2045], Section 6.7: any character MAY be encoded 391 as an "=" followed by two hexadecimal digits from the alphabet 392 "0123456789ABCDEF" (no lowercase characters permitted) representing 393 the hexadecimal-encoded integer value of that character. All control 394 characters (those with values < %x20), 8-bit characters (values > 395 %x7F), and the characters DEL (%x7F), SPACE (%x20), and semicolon 396 (";", %x3B) MUST be encoded. Note that all whitespace, including 397 SPACE, CR, and LF characters, MUST be encoded. After encoding, FWS 398 MAY be added at arbitrary locations in order to avoid excessively 399 long lines; such whitespace is NOT part of the value, and MUST be 400 removed before decoding. 402 ABNF: 404 dkim-quoted-printable = *(FWS / hex-octet / dkim-safe-char) 405 ; hex-octet is from RFC2045 406 dkim-safe-char = %x21-3A / %x3C / %x3E-7E 407 ; '!' - ':', '<', '>' - '~' 408 ; Characters not listed as "mail-safe" in 409 ; [RFC2049] are also not recommended. 411 INFORMATIVE NOTE: DKIM-Quoted-Printable differs from Quoted- 412 Printable as defined in [RFC2045] in several important ways: 414 1. Whitespace in the input text, including CR and LF, must be 415 encoded. [RFC2045] does not require such encoding, and does 416 not permit encoding of CR or LF characters that are part of a 417 CRLF line break. 419 2. Whitespace in the encoded text is ignored. This is to allow 420 tags encoded using DKIM-Quoted-Printable to be wrapped as 421 needed. In particular, [RFC2045] requires that line breaks in 422 the input be represented as physical line breaks; that is not 423 the case here. 425 3. The "soft line break" syntax ("=" as the last non-whitespace 426 character on the line) does not apply. 428 4. DKIM-Quoted-Printable does not require that encoded lines be 429 no more than 76 characters long (although there may be other 430 requirements depending on the context in which the encoded 431 text is being used). 433 4. Protocol Elements 435 Protocol Elements are conceptual parts of the protocol that are not 436 specific to either signers or verifiers. The protocol descriptions 437 for signers and verifiers are described in later sections (Signer 438 Actions (Section 6) and Verifier Actions (Section 7)). NOTE: This 439 section must be read in the context of those sections. 441 4.1. Selectors 443 To support multiple concurrent public keys per signing domain, the 444 key namespace is subdivided using "selectors". For example, 445 selectors might indicate the names of office locations (e.g., 446 "sanfrancisco", "coolumbeach", and "reykjavik"), the signing date 447 (e.g., "january2005", "february2005", etc.), or even an individual 448 user. 450 Selectors are needed to support some important use cases. For 451 example: 453 o Domains that want to delegate signing capability for a specific 454 address for a given duration to a partner, such as an advertising 455 provider or other outsourced function. 457 o Domains that want to allow frequent travelers to send messages 458 locally without the need to connect with a particular MSA. 460 o "Affinity" domains (e.g., college alumni associations) that 461 provide forwarding of incoming mail, but that do not operate a 462 mail submission agent for outgoing mail. 464 Periods are allowed in selectors and are component separators. When 465 keys are retrieved from the DNS, periods in selectors define DNS 466 label boundaries in a manner similar to the conventional use in 467 domain names. Selector components might be used to combine dates 468 with locations, for example, "march2005.reykjavik". In a DNS 469 implementation, this can be used to allow delegation of a portion of 470 the selector namespace. 472 ABNF: 473 selector = sub-domain *( "." sub-domain ) 475 The number of public keys and corresponding selectors for each domain 476 is determined by the domain owner. Many domain owners will be 477 satisfied with just one selector, whereas administratively 478 distributed organizations may choose to manage disparate selectors 479 and key pairs in different regions or on different email servers. 481 Beyond administrative convenience, selectors make it possible to 482 seamlessly replace public keys on a routine basis. If a domain 483 wishes to change from using a public key associated with selector 484 "january2005" to a public key associated with selector 485 "february2005", it merely makes sure that both public keys are 486 advertised in the public-key repository concurrently for the 487 transition period during which email may be in transit prior to 488 verification. At the start of the transition period, the outbound 489 email servers are configured to sign with the "february2005" private 490 key. At the end of the transition period, the "january2005" public 491 key is removed from the public-key repository. 493 INFORMATIVE NOTE: A key may also be revoked as described below. 494 The distinction between revoking and removing a key selector 495 record is subtle. When phasing out keys as described above, a 496 signing domain would probably simply remove the key record after 497 the transition period. However, a signing domain could elect to 498 revoke the key (but maintain the key record) for a further period. 499 There is no defined semantic difference between a revoked key and 500 a removed key. 502 While some domains may wish to make selector values well known, 503 others will want to take care not to allocate selector names in a way 504 that allows harvesting of data by outside parties. For example, if 505 per-user keys are issued, the domain owner will need to make the 506 decision as to whether to associate this selector directly with the 507 name of a registered end-user, or make it some unassociated random 508 value, such as a fingerprint of the public key. 510 INFORMATIVE OPERATIONS NOTE: Reusing a selector with a new key 511 (for example, changing the key associated with a user's name) 512 makes it impossible to tell the difference between a message that 513 didn't verify because the key is no longer valid versus a message 514 that is actually forged. For this reason, signers are ill-advised 515 to reuse selectors for new keys. A better strategy is to assign 516 new keys to new selectors. 518 4.2. Tag=Value Lists 520 DKIM uses a simple "tag=value" syntax in several contexts, including 521 in messages and domain signature records. 523 Values are a series of strings containing either plain text, "base64" 524 text (as defined in [RFC2045], Section 6.8), "qp-section" (ibid, 525 Section 6.7), or "dkim-quoted-printable" (as defined in 526 Section 3.11). The name of the tag will determine the encoding of 527 each value. Unencoded semicolon (";") characters MUST NOT occur in 528 the tag value, since that separates tag-specs. 530 INFORMATIVE IMPLEMENTATION NOTE: Although the "plain text" defined 531 below (as "tag-value") only includes 7-bit characters, an 532 implementation that wished to anticipate future standards would be 533 advised not to preclude the use of UTF8-encoded text in tag=value 534 lists. 536 Formally, the ABNF syntax rules are as follows: 537 tag-list = tag-spec 0*( ";" tag-spec ) [ ";" ] 538 tag-spec = [FWS] tag-name [FWS] "=" [FWS] tag-value [FWS] 539 tag-name = ALPHA 0*ALNUMPUNC 540 tag-value = [ tval 0*( 1*(WSP / FWS) tval ) ] 541 ; WSP and FWS prohibited at beginning and end 542 tval = 1*VALCHAR 543 VALCHAR = %x21-3A / %x3C-7E 544 ; EXCLAMATION to TILDE except SEMICOLON 545 ALNUMPUNC = ALPHA / DIGIT / "_" 547 Note that WSP is allowed anywhere around tags. In particular, any 548 WSP after the "=" and any WSP before the terminating ";" is not part 549 of the value; however, WSP inside the value is significant. 551 Tags MUST be interpreted in a case-sensitive manner. Values MUST be 552 processed as case sensitive unless the specific tag description of 553 semantics specifies case insensitivity. 555 Tags with duplicate names MUST NOT occur within a single tag-list; if 556 a tag name does occur more than once, the entire tag-list is invalid. 558 Whitespace within a value MUST be retained unless explicitly excluded 559 by the specific tag description. 561 Tag=value pairs that represent the default value MAY be included to 562 aid legibility. 564 Unrecognized tags MUST be ignored. 566 Tags that have an empty value are not the same as omitted tags. An 567 omitted tag is treated as having the default value; a tag with an 568 empty value explicitly designates the empty string as the value. 570 4.3. Signing and Verification Algorithms 572 DKIM supports multiple digital signature algorithms. Two algorithms 573 are defined by this specification at this time: rsa-sha1 and rsa- 574 sha256. Signers MUST implement and SHOULD sign using rsa-sha256. 575 Verifiers MUST implement rsa-sha256. 577 INFORMATIVE NOTE: Although rsa-sha256 is strongly encouraged, some 578 senders of low-security messages (such as routine newsletters) may 579 prefer to use rsa-sha1 because of reduced CPU requirements to 580 compute a SHA1 hash. MTAs with compliant verifierst that do not 581 implement rsa-sha1 will treat such messages as unsigned. {DKIM 13} 582 In general, rsa-sha256 should always be used whenever possible. 584 4.3.1. The rsa-sha1 Signing Algorithm 586 The rsa-sha1 Signing Algorithm computes a message hash as described 587 in Section 4.7 below using SHA-1 [FIPS-180-2-2002] as the hash-alg. 588 That hash is then signed by the signer using the RSA algorithm 589 (defined in PKCS#1 version 1.5 [RFC3447]) as the crypt-alg and the 590 signer's private key. The hash MUST NOT be truncated or converted 591 into any form other than the native binary form before being signed. 592 The signing algorithm SHOULD use a public exponent of 65537. 594 4.3.2. The rsa-sha256 Signing Algorithm 596 The rsa-sha256 Signing Algorithm computes a message hash as described 597 in Section 4.7 below using SHA-256 [FIPS-180-2-2002] as the hash-alg. 598 That hash is then signed by the signer using the RSA algorithm 599 (defined in PKCS#1 version 1.5 [RFC3447]) as the crypt-alg and the 600 signer's private key. The hash MUST NOT be truncated or converted 601 into any form other than the native binary form before being signed. 603 4.3.3. Key Sizes 605 Selecting appropriate key sizes is a trade-off between cost, 606 performance, and risk. Since short RSA keys more easily succumb to 607 off-line attacks, signers MUST use RSA keys of at least 1024 bits for 608 long-lived keys. Verifiers MUST be able to validate signatures with 609 keys ranging from 512 bits to 2048 bits, and they MAY be able to 610 validate signatures with larger keys. Verifier policies may use the 611 length of the signing key as one metric for determining whether a 612 signature is acceptable. 614 Factors that should influence the key size choice include the 615 following: 617 o The practical constraint that large (e.g., 4096 bit) keys may not 618 fit within a 512-byte DNS UDP response packet 620 o The security constraint that keys smaller than 1024 bits are 621 subject to off-line attacks 623 o Larger keys impose higher CPU costs to verify and sign email 625 o Keys can be replaced on a regular basis, thus their lifetime can 626 be relatively short 628 o The security goals of this specification are modest compared to 629 typical goals of other systems that employ digital signatures 631 See [RFC3766] for further discussion on selecting key sizes. 633 4.3.4. Other Algorithms 635 Other algorithms MAY be defined in the future. Verifiers MUST ignore 636 any signatures using algorithms that they do not implement. 638 4.4. Canonicalization 640 Some mail systems modify email in transit, potentially invalidating a 641 signature. For most signers, mild modification of email is 642 immaterial to validation of the DKIM domain name's use. For such 643 signers, a canonicalization algorithm that survives modest in-transit 644 modification is preferred. 646 Other signers demand that any modification of the email, however 647 minor, result in a signature verification failure. These signers 648 prefer a canonicalization algorithm that does not tolerate in-transit 649 modification of the signed email. 651 Some signers may be willing to accept modifications to header fields 652 that are within the bounds of email standards such as [RFC5322], but 653 are unwilling to accept any modification to the body of messages. 655 To satisfy all requirements, two canonicalization algorithms are 656 defined for each of the header and the body: a "simple" algorithm 657 that tolerates almost no modification and a "relaxed" algorithm that 658 tolerates common modifications such as whitespace replacement and 659 header field line rewrapping. A signer MAY specify either algorithm 660 for header or body when signing an email. If no canonicalization 661 algorithm is specified by the signer, the "simple" algorithm defaults 662 for both header and body. Verifiers MUST implement both 663 canonicalization algorithms. Note that the header and body may use 664 different canonicalization algorithms. Further canonicalization 665 algorithms MAY be defined in the future; verifiers MUST ignore any 666 signatures that use unrecognized canonicalization algorithms. 668 Canonicalization simply prepares the email for presentation to the 669 signing or verification algorithm. It MUST NOT change the 670 transmitted data in any way. Canonicalization of header fields and 671 body are described below. 673 NOTE: This section assumes that the message is already in "network 674 normal" format (text is ASCII encoded, lines are separated with CRLF 675 characters, etc.). See also Section 6.3 for information about 676 normalizing the message. 678 4.4.1. The "simple" Header Canonicalization Algorithm 680 The "simple" header canonicalization algorithm does not change header 681 fields in any way. Header fields MUST be presented to the signing or 682 verification algorithm exactly as they are in the message being 683 signed or verified. In particular, header field names MUST NOT be 684 case folded and whitespace MUST NOT be changed. 686 4.4.2. The "relaxed" Header Canonicalization Algorithm 688 The "relaxed" header canonicalization algorithm MUST apply the 689 following steps in order: 691 o Convert all header field names (not the header field values) to 692 lowercase. For example, convert "SUBJect: AbC" to "subject: AbC". 694 o Unfold all header field continuation lines as described in 695 [RFC5322]; in particular, lines with terminators embedded in 696 continued header field values (that is, CRLF sequences followed by 697 WSP) MUST be interpreted without the CRLF. Implementations MUST 698 NOT remove the CRLF at the end of the header field value. 700 o Convert all sequences of one or more WSP characters to a single SP 701 character. WSP characters here include those before and after a 702 line folding boundary. 704 o Delete all WSP characters at the end of each unfolded header field 705 value. 707 o Delete any WSP characters remaining before and after the colon 708 separating the header field name from the header field value. The 709 colon separator MUST be retained. 711 4.4.3. The "simple" Body Canonicalization Algorithm 713 The "simple" body canonicalization algorithm ignores all empty lines 714 at the end of the message body. An empty line is a line of zero 715 length after removal of the line terminator. If there is no body or 716 no trailing CRLF on the message body, a CRLF is added. It makes no 717 other changes to the message body. In more formal terms, the 718 "simple" body canonicalization algorithm converts "0*CRLF" at the end 719 of the body to a single "CRLF". 721 Note that a completely empty or missing body is canonicalized as a 722 single "CRLF"; that is, the canonicalized length will be 2 octets. 724 The sha1 value (in base64) for an empty body (canonicalized to a 725 "CRLF") is: 726 uoq1oCgLlTqpdDX/iUbLy7J1Wic= 727 The sha256 value is: 728 frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY= 730 4.4.4. The "relaxed" Body Canonicalization Algorithm 732 The "relaxed" body canonicalization algorithm MUST apply the 733 following steps (a) and (b) in order: 735 a. Reduce whitespace: 737 * Ignore all whitespace at the end of lines. Implementations 738 MUST NOT remove the CRLF at the end of the line. 740 * Reduce all sequences of WSP within a line to a single SP 741 character. 743 b. Ignore all empty lines at the end of the message body. "Empty 744 line" is defined in Section 3.4.3. If the body is non-empty, but 745 does not end with a CRLF, a CRLF is added. (For email, this is 746 only possible when using extensions to SMTP or non-SMTP transport 747 mechanisms.) 749 The sha1 value (in base64) for an empty body (canonicalized to a null 750 input) is: 751 2jmj7l5rSw0yVb/vlWAYkK/YBwk= 752 The sha256 value is: 753 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= 754 INFORMATIVE NOTE: It should be noted that the relaxed body 755 canonicalization algorithm may enable certain types of extremely 756 crude "ASCII Art" attacks where a message may be conveyed by 757 adjusting the spacing between words. If this is a concern, the 758 "simple" body canonicalization algorithm should be used instead. 760 4.4.5. Body Length Limits 762 A body length count MAY be specified to limit the signature 763 calculation to an initial prefix of the body text, measured in 764 octets. If the body length count is not specified, the entire 765 message body is signed. 767 INFORMATIVE RATIONALE: This capability is provided because it is 768 very common for mailing lists to add trailers to messages (e.g., 769 instructions how to get off the list). Until those messages are 770 also signed, the body length count is a useful tool for the 771 verifier since it may as a matter of policy accept messages having 772 valid signatures with extraneous data. 774 INFORMATIVE IMPLEMENTATION NOTE: Using body length limits enables 775 an attack in which an attacker modifies a message to include 776 content that solely benefits the attacker. It is possible for the 777 appended content to completely replace the original content in the 778 end recipient's eyes and to defeat duplicate message detection 779 algorithms. To avoid this attack, signers should be wary of using 780 this tag, and verifiers might wish to ignore the tag, {DKIM 2} 781 perhaps based on other criteria. 783 The body length count allows the signer of a message to permit data 784 to be appended to the end of the body of a signed message. The body 785 length count MUST be calculated following the canonicalization 786 algorithm; for example, any whitespace ignored by a canonicalization 787 algorithm is not included as part of the body length count. Signers 788 of MIME messages that include a body length count SHOULD be sure that 789 the length extends to the closing MIME boundary string. 791 INFORMATIVE IMPLEMENTATION NOTE: A signer wishing to ensure that 792 the only acceptable modifications are to add to the MIME postlude 793 would use a body length count encompassing the entire final MIME 794 boundary string, including the final "--CRLF". A signer wishing 795 to allow additional MIME parts but not modification of existing 796 parts would use a body length count extending through the final 797 MIME boundary string, omitting the final "--CRLF". Note that this 798 only works for some MIME types, e.g., multipart/mixed but not 799 multipart/signed. 801 A body length count of zero means that the body is completely 802 unsigned. 804 Signers wishing to ensure that no modification of any sort can occur 805 should specify the "simple" canonicalization algorithm for both 806 header and body and omit the body length count. 808 4.4.6. Canonicalization Examples (INFORMATIVE) 810 In the following examples, actual whitespace is used only for 811 clarity. The actual input and output text is designated using 812 bracketed descriptors: "" for a space character, "" for a 813 tab character, and "" for a carriage-return/line-feed sequence. 814 For example, "X Y" and "XY" represent the same three 815 characters. 817 Example 1: A message reading: 818 A: X 819 B : Y 820 Z 821 822 C 823 D E 824 825 827 when canonicalized using relaxed canonicalization for both header and 828 body results in a header reading: 829 a:X 830 b:Y Z 832 and a body reading: 833 C 834 D E 836 Example 2: The same message canonicalized using simple 837 canonicalization for both header and body results in a header 838 reading: 839 A: X 840 B : Y 841 Z 843 and a body reading: 844 C 845 D E 846 Example 3: When processed using relaxed header canonicalization and 847 simple body canonicalization, the canonicalized version has a header 848 of: 849 a:X 850 b:Y Z 852 and a body reading: 853 C 854 D E 856 4.5. The DKIM-Signature Header Field 858 The signature of the email is stored in the DKIM-Signature header 859 field. This header field contains all of the signature and key- 860 fetching data. The DKIM-Signature value is a tag-list as described 861 in Section 4.2. 863 The DKIM-Signature header field SHOULD be treated as though it were a 864 trace header field as defined in Section 3.6 of [RFC5322], and hence 865 SHOULD NOT be reordered and SHOULD be prepended to the message. 867 The DKIM-Signature header field being created or verified is always 868 included in the signature calculation, after the rest of the header 869 fields being signed; however, when calculating or verifying the 870 signature, the value of the "b=" tag (signature value) of that DKIM- 871 Signature header field MUST be treated as though it were an empty 872 string. Unknown tags in the DKIM-Signature header field MUST be 873 included in the signature calculation but MUST be otherwise ignored 874 by verifiers. Other DKIM-Signature header fields that are included 875 in the signature should be treated as normal header fields; in 876 particular, the "b=" tag is not treated specially. 878 The encodings for each field type are listed below. Tags described 879 as qp-section are encoded as described in Section 6.7 of MIME Part 880 One [RFC2045], with the additional conversion of semicolon characters 881 to "=3B"; intuitively, this is one line of quoted-printable encoded 882 text. The dkim-quoted-printable syntax is defined in Section 3.11. 884 Tags on the DKIM-Signature header field along with their type and 885 requirement status are shown below. Unrecognized tags MUST be 886 ignored. 888 v= Version (MUST be included). This tag defines the version of this 889 specification that applies to the signature record. It MUST have 890 the value "1". Note that verifiers must do a string comparison on 891 this value; for example, "1" is not the same as "1.0". 893 ABNF: 894 sig-v-tag = %x76 [FWS] "=" [FWS] "1" 896 INFORMATIVE NOTE: DKIM-Signature version numbers are expected 897 to increase arithmetically as new versions of this 898 specification are released. 900 a= The algorithm used to generate the signature (plain-text; 901 REQUIRED). Verifiers MUST support "rsa-sha1" and "rsa-sha256"; 902 signers SHOULD sign using "rsa-sha256". 904 ABNF: 906 sig-a-tag = %x61 [FWS] "=" [FWS] sig-a-tag-alg 907 sig-a-tag-alg = sig-a-tag-k "-" sig-a-tag-h 908 sig-a-tag-k = "rsa" / x-sig-a-tag-k 909 sig-a-tag-h = "sha1" / "sha256" / x-sig-a-tag-h 910 x-sig-a-tag-k = ALPHA *(ALPHA / DIGIT) 911 ; for later extension 912 x-sig-a-tag-h = ALPHA *(ALPHA / DIGIT) 913 ; for later extension 915 b= The signature data (base64; REQUIRED). Whitespace is ignored in 916 this value and MUST be ignored when reassembling the original 917 signature. In particular, the signing process can safely insert 918 FWS in this value in arbitrary places to conform to line-length 919 limits. See Signer Actions (Section 6) for how the signature is 920 computed. 922 ABNF: 923 sig-b-tag = %x62 [FWS] "=" [FWS] sig-b-tag-data 924 sig-b-tag-data = base64string 925 bh= The hash of the canonicalized body part of the message as 926 limited by the "l=" tag (base64; REQUIRED). Whitespace is ignored 927 in this value and MUST be ignored when reassembling the original 928 signature. In particular, the signing process can safely insert 929 FWS in this value in arbitrary places to conform to line-length 930 limits. See Section 4.7 for how the body hash is computed. 932 ABNF: 933 sig-bh-tag = %x62 %x68 [FWS] "=" [FWS] sig-bh-tag-data 934 sig-bh-tag-data = base64string 936 c= Message canonicalization (plain-text; OPTIONAL, default is 937 "simple/simple"). This tag informs the verifier of the type of 938 canonicalization used to prepare the message for signing. It 939 consists of two names separated by a "slash" (%d47) character, 940 corresponding to the header and body canonicalization algorithms 941 respectively. These algorithms are described in Section 4.4. If 942 only one algorithm is named, that algorithm is used for the header 943 and "simple" is used for the body. For example, "c=relaxed" is 944 treated the same as "c=relaxed/simple". 946 ABNF: 947 sig-c-tag = %x63 [FWS] "=" [FWS] sig-c-tag-alg 948 ["/" sig-c-tag-alg] 949 sig-c-tag-alg = "simple" / "relaxed" / x-sig-c-tag-alg 950 x-sig-c-tag-alg = hyphenated-word ; for later extension 952 d= The SDID claiming responsibility for an introduction of a message 953 into the mail stream (plain-text; REQUIRED). Hence, the SDID 954 value is used to form the query for the public key. The SDID MUST 955 correspond to a valid DNS name under which the DKIM key record is 956 published. The conventions and semantics used by a signer to 957 create and use a specific SDID are outside the scope of the DKIM 958 Signing specification, as is any use of those conventions and 959 semantics. When presented with a signature that does not meet 960 these requirements, verifiers MUST consider the signature invalid. 962 Internationalized domain names MUST be encoded as described in 963 Section 2.3 of [RFC5890] to "A-Labels". {DKIM 4}. 965 ABNF: 967 sig-d-tag = %x64 [FWS] "=" [FWS] domain-name 968 domain-name = sub-domain 1*("." sub-domain) 969 ; from RFC5321 Domain, excluding address-literal 971 h= Signed header fields (plain-text, but see description; REQUIRED). 972 A colon-separated list of header field names that identify the 973 header fields presented to the signing algorithm. The field MUST 974 contain the complete list of header fields in the order presented 975 to the signing algorithm. The field MAY contain names of header 976 fields that do not exist when signed; nonexistent header fields do 977 not contribute to the signature computation (that is, they are 978 treated as the null input, including the header field name, the 979 separating colon, the header field value, and any CRLF 980 terminator). The field MUST NOT include the DKIM-Signature header 981 field that is being created or verified, but may include others. 982 Folding whitespace (FWS) MAY be included on either side of the 983 colon separator. Header field names MUST be compared against 984 actual header field names in a case-insensitive manner. This list 985 MUST NOT be empty. See Section 6.4 for a discussion of choosing 986 header fields to sign. 988 ABNF: 989 sig-h-tag = %x68 [FWS] "=" [FWS] hdr-name 990 0*( [FWS] ":" [FWS] hdr-name ) 992 INFORMATIVE EXPLANATION: By "signing" header fields that do not 993 actually exist, a signer can prevent insertion of those header 994 fields before verification. However, since a signer cannot 995 possibly know what header fields might be created in the 996 future, and that some MUAs might present header fields that are 997 embedded inside a message (e.g., as a message/rfc822 content 998 type), the security of this solution is not total. 1000 INFORMATIVE EXPLANATION: The exclusion of the header field name 1001 and colon as well as the header field value for non-existent 1002 header fields prevents an attacker from inserting an actual 1003 header field with a null value. 1005 i= The Agent or User Identifier (AUID) on behalf of which the SDID is 1006 taking responsibility (dkim-quoted-printable; OPTIONAL, default is 1007 an empty Local-part followed by an "@" followed by the domain from 1008 the "d=" tag). 1010 The syntax is a standard email address where the Local-part MAY be 1011 omitted. The domain part of the address MUST be the same as, or a 1012 subdomain of, the value of the "d=" tag. 1014 Internationalized domain names MUST be converted as described in 1015 Section 2.3 of [RFC5890] to "A-Labels" {DKIM 4}. 1017 ABNF: 1019 sig-i-tag = %x69 [FWS] "=" [FWS] [ Local-part ] 1020 "@" domain-name 1022 The AUID is specified as having the same syntax as an email 1023 address, but is not required to have the same semantics. Notably, 1024 the domain name is not required to be registered in the DNS -- so 1025 it might not resolve in a query -- and the Local-part MAY be drawn 1026 from a namespace unrelated to any mailbox. The details of the 1027 structure and semantics for the namespace are determined by the 1028 Signer. Any knowledge or use of those details by verifiers or 1029 assessors is outside the scope of the DKIM Signing specification. 1030 The Signer MAY choose to use the same namespace for its AUIDs as 1031 its users' email addresses or MAY choose other means of 1032 representing its users. However, the signer SHOULD use the same 1033 AUID for each message intended to be evaluated as being within the 1034 same sphere of responsibility, if it wishes to offer receivers the 1035 option of using the AUID as a stable identifier that is finer 1036 grained than the SDID. 1038 INFORMATIVE NOTE: The Local-part of the "i=" tag is optional 1039 because in some cases a signer may not be able to establish a 1040 verified individual identity. In such cases, the signer might 1041 wish to assert that although it is willing to go as far as 1042 signing for the domain, it is unable or unwilling to commit to 1043 an individual user name within their domain. It can do so by 1044 including the domain part but not the Local-part of the 1045 identity. 1047 INFORMATIVE DISCUSSION: This specification does not require the 1048 value of the "i=" tag to match the identity in any message 1049 header fields. This is considered to be a verifier policy 1050 issue. Constraints between the value of the "i=" tag and other 1051 identities in other header fields seek to apply basic 1052 authentication into the semantics of trust associated with a 1053 role such as content author. Trust is a broad and complex 1054 topic and trust mechanisms are subject to highly creative 1055 attacks. The real-world efficacy of any but the most basic 1056 bindings between the "i=" value and other identities is not 1057 well established, nor is its vulnerability to subversion by an 1058 attacker. Hence reliance on the use of these options should be 1059 strictly limited. In particular, it is not at all clear to 1060 what extent a typical end-user recipient can rely on any 1061 assurances that might be made by successful use of the "i=" 1062 options. 1064 l= Body length count (plain-text unsigned decimal integer; OPTIONAL, 1065 default is entire body). This tag informs the verifier of the 1066 number of octets in the body of the email after canonicalization 1067 included in the cryptographic hash, starting from 0 immediately 1068 following the CRLF preceding the body. This value MUST NOT be 1069 larger than the actual number of octets in the canonicalized 1070 message body. 1072 INFORMATIVE IMPLEMENTATION WARNING: Use of the "l=" tag might 1073 allow display of fraudulent content without appropriate warning 1074 to end users. The "l=" tag is intended for increasing 1075 signature robustness when sending to mailing lists that both 1076 modify their content and do not sign their messages. However, 1077 using the "l=" tag enables attacks in which an intermediary 1078 with malicious intent modifies a message to include content 1079 that solely benefits the attacker. It is possible for the 1080 appended content to completely replace the original content in 1081 the end recipient's eyes and to defeat duplicate message 1082 detection algorithms. Examples are described in Security 1083 Considerations Section 9. To avoid this attack, signers should 1084 be extremely wary of using this tag, and verifiers might wish 1085 to ignore the tag. {DKIM 2} 1086 INFORMATIVE NOTE: The value of the "l=" tag is constrained to 1087 76 decimal digits. This constraint is not intended to predict 1088 the size of future messages or to require implementations to 1089 use an integer representation large enough to represent the 1090 maximum possible value, but is intended to remind the 1091 implementer to check the length of this and all other tags 1092 during verification and to test for integer overflow when 1093 decoding the value. Implementers may need to limit the actual 1094 value expressed to a value smaller than 10^76, e.g., to allow a 1095 message to fit within the available storage space. 1097 ABNF: 1098 sig-l-tag = %x6c [FWS] "=" [FWS] 1099 1*76DIGIT 1101 q= A colon-separated list of query methods used to retrieve the 1102 public key (plain-text; OPTIONAL, default is "dns/txt"). Each 1103 query method is of the form "type[/options]", where the syntax and 1104 semantics of the options depend on the type and specified options. 1105 If there are multiple query mechanisms listed, the choice of query 1106 mechanism MUST NOT change the interpretation of the signature. 1107 Implementations MUST use the recognized query mechanisms in the 1108 order presented. Unrecognized query mechanisms MUST be ignored. 1110 Currently, the only valid value is "dns/txt", which defines the 1111 DNS TXT record lookup algorithm described elsewhere in this 1112 document. The only option defined for the "dns" query type is 1113 "txt", which MUST be included. Verifiers and signers MUST support 1114 "dns/txt". 1116 ABNF: 1117 sig-q-tag = %x71 [FWS] "=" [FWS] sig-q-tag-method 1118 *([FWS] ":" [FWS] sig-q-tag-method) 1119 sig-q-tag-method = "dns/txt" / x-sig-q-tag-type 1120 ["/" x-sig-q-tag-args] 1121 x-sig-q-tag-type = hyphenated-word ; for future extension 1122 x-sig-q-tag-args = qp-hdr-value 1123 s= The selector subdividing the namespace for the "d=" (domain) tag 1124 (plain-text; REQUIRED). 1126 ABNF: 1127 sig-s-tag = %x73 [FWS] "=" [FWS] selector 1129 t= Signature Timestamp (plain-text unsigned decimal integer; 1130 RECOMMENDED, default is an unknown creation time). The time that 1131 this signature was created. The format is the number of seconds 1132 since 00:00:00 on January 1, 1970 in the UTC time zone. The value 1133 is expressed as an unsigned integer in decimal ASCII. This value 1134 is not constrained to fit into a 31- or 32-bit integer. 1135 Implementations SHOULD be prepared to handle values up to at least 1136 10^12 (until approximately AD 200,000; this fits into 40 bits). 1137 To avoid denial-of-service attacks, implementations MAY consider 1138 any value longer than 12 digits to be infinite. Leap seconds are 1139 not counted. Implementations MAY ignore signatures that have a 1140 timestamp in the future. 1142 ABNF: 1143 sig-t-tag = %x74 [FWS] "=" [FWS] 1*12DIGIT 1145 x= Signature Expiration (plain-text unsigned decimal integer; 1146 RECOMMENDED, default is no expiration). The format is the same as 1147 in the "t=" tag, represented as an absolute date, not as a time 1148 delta from the signing timestamp. The value is expressed as an 1149 unsigned integer in decimal ASCII, with the same constraints on 1150 the value in the "t=" tag. Signatures MAY be considered invalid 1151 if the verification time at the verifier is past the expiration 1152 date. The verification time should be the time that the message 1153 was first received at the administrative domain of the verifier if 1154 that time is reliably available; otherwise the current time should 1155 be used. The value of the "x=" tag MUST be greater than the value 1156 of the "t=" tag if both are present. 1158 INFORMATIVE NOTE: The "x=" tag is not intended as an anti- 1159 replay defense. 1161 INFORMATIVE NOTE: Due to clock drift, the receiver's notion of 1162 when to consider the signature expired may not match exactly 1163 when the sender is expecting. Receivers MAY add a 'fudge 1164 factor' to allow for such possible drift. 1166 ABNF: 1167 sig-x-tag = %x78 [FWS] "=" [FWS] 1168 1*12DIGIT 1170 z= Copied header fields (dkim-quoted-printable, but see description; 1171 OPTIONAL, default is null). A vertical-bar-separated list of 1172 selected header fields present when the message was signed, 1173 including both the field name and value. It is not required to 1174 include all header fields present at the time of signing. This 1175 field need not contain the same header fields listed in the "h=" 1176 tag. The header field text itself must encode the vertical bar 1177 ("|", %x7C) character (i.e., vertical bars in the "z=" text are 1178 meta-characters, and any actual vertical bar characters in a 1179 copied header field must be encoded). Note that all whitespace 1180 must be encoded, including whitespace between the colon and the 1181 header field value. After encoding, FWS MAY be added at arbitrary 1182 locations in order to avoid excessively long lines; such 1183 whitespace is NOT part of the value of the header field, and MUST 1184 be removed before decoding. 1186 The header fields referenced by the "h=" tag refer to the fields 1187 in the [RFC5322] header of the message, not to any copied fields 1188 in the "z=" tag. Copied header field values are for diagnostic 1189 use. 1191 ABNF: 1192 sig-z-tag = %x7A [FWS] "=" [FWS] sig-z-tag-copy 1193 *( "|" [FWS] sig-z-tag-copy ) 1194 sig-z-tag-copy = hdr-name [FWS] ":" qp-hdr-value 1195 INFORMATIVE EXAMPLE of a signature header field spread across 1196 multiple continuation lines: 1197 DKIM-Signature: v=1; a=rsa-sha256; d=example.net; s=brisbane; 1198 c=simple; q=dns/txt; i=@eng.example.net; 1199 t=1117574938; x=1118006938; 1200 h=from:to:subject:date; 1201 z=From:foo@eng.example.net|To:joe@example.com| 1202 Subject:demo=20run|Date:July=205,=202005=203:44:08=20PM=20-0700; 1203 bh=MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=; 1204 b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZVoG4ZHRNiYzR 1206 4.6. Key Management and Representation 1208 Signature applications require some level of assurance that the 1209 verification public key is associated with the claimed signer. Many 1210 applications achieve this by using public key certificates issued by 1211 a trusted third party. However, DKIM can achieve a sufficient level 1212 of security, with significantly enhanced scalability, by simply 1213 having the verifier query the purported signer's DNS entry (or some 1214 security-equivalent) in order to retrieve the public key. 1216 DKIM keys can potentially be stored in multiple types of key servers 1217 and in multiple formats. The storage and format of keys are 1218 irrelevant to the remainder of the DKIM algorithm. 1220 Parameters to the key lookup algorithm are the type of the lookup 1221 (the "q=" tag), the domain of the signer (the "d=" tag of the DKIM- 1222 Signature header field), and the selector (the "s=" tag). 1223 public_key = dkim_find_key(q_val, d_val, s_val) 1225 This document defines a single binding, using DNS TXT records to 1226 distribute the keys. Other bindings may be defined in the future. 1228 4.6.1. Textual Representation 1230 It is expected that many key servers will choose to present the keys 1231 in an otherwise unstructured text format (for example, an XML form 1232 would not be considered to be unstructured text for this purpose). 1233 The following definition MUST be used for any DKIM key represented in 1234 an otherwise unstructured textual form. 1236 The overall syntax is a tag-list as described in Section 4.2. The 1237 current valid tags are described below. Other tags MAY be present 1238 and MUST be ignored by any implementation that does not understand 1239 them. 1241 v= Version of the DKIM key record (plain-text; RECOMMENDED, default 1242 is "DKIM1"). If specified, this tag MUST be set to "DKIM1" 1243 (without the quotes). This tag MUST be the first tag in the 1244 record. Records beginning with a "v=" tag with any other value 1245 MUST be discarded. Note that verifiers must do a string 1246 comparison on this value; for example, "DKIM1" is not the same as 1247 "DKIM1.0". 1249 ABNF: 1250 key-v-tag = %x76 [FWS] "=" [FWS] %x44 %x4B %x49 %x4D %x31 1252 h= Acceptable hash algorithms (plain-text; OPTIONAL, defaults to 1253 allowing all algorithms). A colon-separated list of hash 1254 algorithms that might be used. Unrecognized algorithms MUST be 1255 ignored. Refer to Section 4.3 for a discussion of the hash 1256 algorithms implemented by Signers and Verifiers. The set of 1257 algorithms listed in this tag in each record is an operational 1258 choice made by the Signer. 1260 ABNF: 1261 key-h-tag = %x68 [FWS] "=" [FWS] key-h-tag-alg 1262 0*( [FWS] ":" [FWS] key-h-tag-alg ) 1263 key-h-tag-alg = "sha1" / "sha256" / x-key-h-tag-alg 1264 x-key-h-tag-alg = hyphenated-word ; for future extension 1266 k= Key type (plain-text; OPTIONAL, default is "rsa"). Signers and 1267 verifiers MUST support the "rsa" key type. The "rsa" key type 1268 indicates that an ASN.1 DER-encoded [ITU-X660-1997] RSAPublicKey 1269 [RFC3447] (see Sections Section 4.1 and A.1.1) is being used in 1270 the "p=" tag. (Note: the "p=" tag further encodes the value using 1271 the base64 algorithm.) Unrecognized key types MUST be ignored. 1273 ABNF: 1274 key-k-tag = %x76 [FWS] "=" [FWS] key-k-tag-type 1275 key-k-tag-type = "rsa" / x-key-k-tag-type 1276 x-key-k-tag-type = hyphenated-word ; for future extension 1277 n= Notes that might be of interest to a human (qp-section; OPTIONAL, 1278 default is empty). No interpretation is made by any program. 1279 This tag should be used sparingly in any key server mechanism that 1280 has space limitations (notably DNS). This is intended for use by 1281 administrators, not end users. 1283 ABNF: 1284 key-n-tag = %x6e [FWS] "=" [FWS] qp-section 1286 p= Public-key data (base64; REQUIRED). An empty value means that 1287 this public key has been revoked. The syntax and semantics of 1288 this tag value before being encoded in base64 are defined by the 1289 "k=" tag. 1291 INFORMATIVE RATIONALE: If a private key has been compromised or 1292 otherwise disabled (e.g., an outsourcing contract has been 1293 terminated), a signer might want to explicitly state that it 1294 knows about the selector, but all messages using that selector 1295 should fail verification. Verifiers should ignore any DKIM- 1296 Signature header fields with a selector referencing a revoked 1297 key. 1299 ABNF: 1300 key-p-tag = %x70 [FWS] "=" [ [FWS] base64string] 1302 INFORMATIVE NOTE: A base64string is permitted to include white 1303 space (FWS) at arbitrary places; however, any CRLFs must be 1304 followed by at least one WSP character. Implementors and 1305 administrators are cautioned to ensure that selector TXT 1306 records conform to this specification. 1308 s= Service Type (plain-text; OPTIONAL; default is "*"). A colon- 1309 separated list of service types to which this record applies. 1310 Verifiers for a given service type MUST ignore this record if the 1311 appropriate type is not listed. Unrecognized service types MUST 1312 be ignored. Currently defined service types are as follows: 1314 * matches all service types 1316 email electronic mail (not necessarily limited to SMTP) 1318 This tag is intended to constrain the use of keys for other 1319 purposes, should use of DKIM be defined by other services in the 1320 future. 1322 ABNF: 1323 key-s-tag = %x73 [FWS] "=" [FWS] key-s-tag-type 1324 0*( [FWS] ":" [FWS] key-s-tag-type ) 1325 key-s-tag-type = "email" / "*" / x-key-s-tag-type 1326 x-key-s-tag-type = hyphenated-word ; for future extension 1328 t= Flags, represented as a colon-separated list of names (plain- 1329 text; OPTIONAL, default is no flags set). Unrecognized flags MUST 1330 be ignored. The defined flags are as follows: 1332 y This domain is testing DKIM. Verifiers MUST NOT treat messages 1333 from signers in testing mode differently from unsigned email, even 1334 should the signature fail to verify. Verifiers MAY wish to track 1335 testing mode results to assist the signer. 1337 s Any DKIM-Signature header fields using the "i=" tag MUST have the 1338 same domain value on the right-hand side of the "@" in the "i=" 1339 tag and the value of the "d=" tag. That is, the "i=" domain MUST 1340 NOT be a subdomain of "d=". Use of this flag is RECOMMENDED 1341 unless subdomaining is required. 1343 ABNF: 1344 key-t-tag = %x74 [FWS] "=" [FWS] key-t-tag-flag 1345 0*( [FWS] ":" [FWS] key-t-tag-flag ) 1346 key-t-tag-flag = "y" / "s" / x-key-t-tag-flag 1347 x-key-t-tag-flag = hyphenated-word ; for future extension 1348 Unrecognized flags MUST be ignored. 1350 4.6.2. DNS Binding 1352 A binding using DNS TXT records as a key service is hereby defined. 1353 All implementations MUST support this binding. 1355 4.6.2.1. Namespace 1357 All DKIM keys are stored in a subdomain named "_domainkey". Given a 1358 DKIM-Signature field with a "d=" tag of "example.com" and an "s=" tag 1359 of "foo.bar", the DNS query will be for 1360 "foo.bar._domainkey.example.com". 1362 4.6.2.2. Resource Record Types for Key Storage 1364 The DNS Resource Record type used is specified by an option to the 1365 query-type ("q=") tag. The only option defined in this base 1366 specification is "txt", indicating the use of a TXT Resource Record 1367 (RR). A later extension of this standard may define another RR type. 1369 Strings in a TXT RR MUST be concatenated together before use with no 1370 intervening whitespace. TXT RRs MUST be unique for a particular 1371 selector name; that is, if there are multiple records in an RRset, 1372 the results are undefined. 1374 TXT RRs are encoded as described in Section 4.6.1 1376 4.7. Computing the Message Hashes 1378 Both signing and verifying message signatures start with a step of 1379 computing two cryptographic hashes over the message. Signers will 1380 choose the parameters of the signature as described in Signer Actions 1381 Section 6; verifiers will use the parameters specified in the DKIM- 1382 Signature header field being verified. In the following discussion, 1383 the names of the tags in the DKIM-Signature header field that either 1384 exists (when verifying) or will be created (when signing) are used. 1385 Note that canonicalization (Section 4.4) is only used to prepare the 1386 email for signing or verifying; it does not affect the transmitted 1387 email in any way. 1389 The signer/verifier MUST compute two hashes, one over the body of the 1390 message and one over the selected header fields of the message. 1392 Signers MUST compute them in the order shown. Verifiers MAY compute 1393 them in any order convenient to the verifier, provided that the 1394 result is semantically identical to the semantics that would be the 1395 case had they been computed in this order. 1397 In hash step 1, the signer/verifier MUST hash the message body, 1398 canonicalized using the body canonicalization algorithm specified in 1399 the "c=" tag and then truncated to the length specified in the "l=" 1400 tag. That hash value is then converted to base64 form and inserted 1401 into (signers) or compared to (verifiers) the "bh=" tag of the DKIM- 1402 Signature header field. 1404 In hash step 2, the signer/verifier MUST pass the following to the 1405 hash algorithm in the indicated order. 1407 1. The header fields specified by the "h=" tag, in the order 1408 specified in that tag, and canonicalized using the header 1409 canonicalization algorithm specified in the "c=" tag. Each 1410 header field MUST be terminated with a single CRLF. 1412 2. The DKIM-Signature header field that exists (verifying) or will 1413 be inserted (signing) in the message, with the value of the "b=" 1414 tag (including all surrounding whitespace) deleted (i.e., treated 1415 as the empty string), canonicalized using the header 1416 canonicalization algorithm specified in the "c=" tag, and without 1417 a trailing CRLF. 1419 All tags and their values in the DKIM-Signature header field are 1420 included in the cryptographic hash with the sole exception of the 1421 value portion of the "b=" (signature) tag, which MUST be treated as 1422 the null string. All tags MUST be included even if they might not be 1423 understood by the verifier. The header field MUST be presented to 1424 the hash algorithm after the body of the message rather than with the 1425 rest of the header fields and MUST be canonicalized as specified in 1426 the "c=" (canonicalization) tag. The DKIM-Signature header field 1427 MUST NOT be included in its own h= tag, although other DKIM-Signature 1428 header fields MAY be signed (see Section 5). 1430 When calculating the hash on messages that will be transmitted using 1431 base64 or quoted-printable encoding, signers MUST compute the hash 1432 after the encoding. Likewise, the verifier MUST incorporate the 1433 values into the hash before decoding the base64 or quoted-printable 1434 text. However, the hash MUST be computed before transport level 1435 encodings such as SMTP "dot-stuffing" (the modification of lines 1436 beginning with a "." to avoid confusion with the SMTP end-of-message 1437 marker, as specified in [RFC5321]). 1439 With the exception of the canonicalization procedure described in 1440 Section 4.4, the DKIM signing process treats the body of messages as 1441 simply a string of octets. DKIM messages MAY be either in plain-text 1442 or in MIME format; no special treatment is afforded to MIME content. 1443 Message attachments in MIME format MUST be included in the content 1444 that is signed. 1446 More formally, pseudo-code for the signature algorithm is: 1447 body-hash = hash-alg (canon-body, l-param) 1448 data-hash = hash-alg (h-headers, D-SIG, content-hash) 1449 signature = sig-alg (d-domain, selector, data-hash) 1451 where: 1453 body-hash: is the output from hashing the body, using hash-alg. 1455 hash-alg: is the hashing algorithm specified in the "a" 1456 parameter. 1458 canon-body: is a canonicalized representation of the body, 1459 produced by using the body algorithm specified in the "c" 1460 parameter, as defined in Section 4.4 and excluding the 1461 DKIM-Signature field. 1463 l-param: is the length-of-body value of the "l" parameter. 1465 data-hash: is the output from using the hash-alg algorithm, to 1466 hash the header including the DKIM-Signature header, and the 1467 body hash. 1469 h-headers: is the list of headers to be signed, as specified in 1470 the "h" parameter. 1472 D-SIG: is the canonicalized DKIM-Signature field without the 1473 signature value portion of the parameter, itself; that is, an 1474 empty parameter value. 1476 signature: is the signature value produced by the signing 1477 algorithm. 1479 sig-alg: is the signature algorithm specified by the "a" 1480 parameter. 1482 d-domain: is the domain name specified in the "d" parameter. 1484 selector: is the selector value specified in the "s" parameter. 1486 NOTE: Many digital signature APIs provide both hashing and 1487 application of the RSA private key using a single "sign()" 1488 primitive. When using such an API, the last two steps in the 1489 algorithm would probably be combined into a single call that would 1490 perform both the "a-hash-alg" and the "sig-alg". 1492 4.8. Input Requirements 1494 DKIM's design is predicated on valid input. Therefore, signers and 1495 verifiers SHOULD take reasonable steps to ensure that the messages 1496 they are processing are valid according to [RFC5322], [RFC2045], and 1497 any other relevant message format standards. See Section 9.15 for 1498 additional discussion and references. 1500 4.9. Signing by Parent Domains 1502 In some circumstances, it is desirable for a domain to apply a 1503 signature on behalf of any of its subdomains without the need to 1504 maintain separate selectors (key records) in each subdomain. By 1505 default, private keys corresponding to key records can be used to 1506 sign messages for any subdomain of the domain in which they reside; 1507 for example, a key record for the domain example.com can be used to 1508 verify messages where the AUID ("i=" tag of the signature) is 1509 sub.example.com, or even sub1.sub2.example.com. In order to limit 1510 the capability of such keys when this is not intended, the "s" flag 1511 MAY be set in the "t=" tag of the key record, to constrain the 1512 validity of the domain of the AUID. If the referenced key record 1513 contains the "s" flag as part of the "t=" tag, the domain of the AUID 1514 ("i=" flag) MUST be the same as that of the SDID (d=) domain. If 1515 this flag is absent, the domain of the AUID MUST be the same as, or a 1516 subdomain of, the SDID. 1518 4.10. Relationship between SDID and AUID 1520 DKIM's primary task is to communicate from the Signer to a recipient- 1521 side Identity Assessor a single Signing Domain Identifier (SDID) that 1522 refers to a responsible identity. DKIM MAY optionally provide a 1523 single responsible Agent or User Identifier (AUID). 1525 Hence, DKIM's mandatory output to a receive-side Identity Assessor is 1526 a single domain name. Within the scope of its use as DKIM output, 1527 the name has only basic domain name semantics; any possible owner- 1528 specific semantics are outside the scope of DKIM. That is, within 1529 its role as a DKIM identifier, additional semantics cannot be assumed 1530 by an Identity Assessor. 1532 Upon successfully verifying the signature, a receive-side DKIM 1533 verifier MUST communicate the Signing Domain Identifier (d=) to a 1534 consuming Identity Assessor module and MAY communicate the Agent or 1535 User Identifier (i=) if present. 1537 To the extent that a receiver attempts to intuit any structured 1538 semantics for either of the identifiers, this is a heuristic function 1539 that is outside the scope of DKIM's specification and semantics. 1541 Hence, it is relegated to a higher-level service, such as a delivery 1542 handling filter that integrates a variety of inputs and performs 1543 heuristic analysis of them. 1545 INFORMATIVE DISCUSSION: This document does not require the value 1546 of the SDID or AUID to match an identifier in any other message 1547 header field. This requirement is, instead, an assessor policy 1548 issue. The purpose of such a linkage would be to authenticate the 1549 value in that other header field. This, in turn, is the basis for 1550 applying a trust assessment based on the identifier value. Trust 1551 is a broad and complex topic and trust mechanisms are subject to 1552 highly creative attacks. The real-world efficacy of any but the 1553 most basic bindings between the SDID or AUID and other identities 1554 is not well established, nor is its vulnerability to subversion by 1555 an attacker. Hence, reliance on the use of such bindings should 1556 be strictly limited. In particular, it is not at all clear to 1557 what extent a typical end-user recipient can rely on any 1558 assurances that might be made by successful use of the SDID or 1559 AUID. 1561 5. Semantics of Multiple Signatures 1563 5.1. Example Scenarios 1565 There are many reasons why a message might have multiple signatures. 1566 For example, a given signer might sign multiple times, perhaps with 1567 different hashing or signing algorithms during a transition phase. 1569 INFORMATIVE EXAMPLE: Suppose SHA-256 is in the future found to be 1570 insufficiently strong, and DKIM usage transitions to SHA-1024. A 1571 signer might immediately sign using the newer algorithm, but 1572 continue to sign using the older algorithm for interoperability 1573 with verifiers that had not yet upgraded. The signer would do 1574 this by adding two DKIM-Signature header fields, one using each 1575 algorithm. Older verifiers that did not recognize SHA-1024 as an 1576 acceptable algorithm would skip that signature and use the older 1577 algorithm; newer verifiers could use either signature at their 1578 option, and all other things being equal might not even attempt to 1579 verify the other signature. 1581 Similarly, a signer might sign a message including all headers and no 1582 "l=" tag (to satisfy strict verifiers) and a second time with a 1583 limited set of headers and an "l=" tag (in anticipation of possible 1584 message modifications in route to other verifiers). Verifiers could 1585 then choose which signature they preferred. 1587 INFORMATIVE EXAMPLE: A verifier might receive a message with two 1588 signatures, one covering more of the message than the other. If 1589 the signature covering more of the message verified, then the 1590 verifier could make one set of policy decisions; if that signature 1591 failed but the signature covering less of the message verified, 1592 the verifier might make a different set of policy decisions. 1594 Of course, a message might also have multiple signatures because it 1595 passed through multiple signers. A common case is expected to be 1596 that of a signed message that passes through a mailing list that also 1597 signs all messages. Assuming both of those signatures verify, a 1598 recipient might choose to accept the message if either of those 1599 signatures were known to come from trusted sources. 1601 INFORMATIVE EXAMPLE: Recipients might choose to whitelist mailing 1602 lists to which they have subscribed and that have acceptable anti- 1603 abuse policies so as to accept messages sent to that list even 1604 from unknown authors. They might also subscribe to less trusted 1605 mailing lists (e.g., those without anti-abuse protection) and be 1606 willing to accept all messages from specific authors, but insist 1607 on doing additional abuse scanning for other messages. 1609 Another related example of multiple signers might be forwarding 1610 services, such as those commonly associated with academic alumni 1611 sites. 1613 INFORMATIVE EXAMPLE: A recipient might have an address at 1614 members.example.org, a site that has anti-abuse protection that is 1615 somewhat less effective than the recipient would prefer. Such a 1616 recipient might have specific authors whose messages would be 1617 trusted absolutely, but messages from unknown authors that had 1618 passed the forwarder's scrutiny would have only medium trust. 1620 5.2. Interpretation 1622 A signer that is adding a signature to a message merely creates a new 1623 DKIM-Signature header, using the usual semantics of the h= option. A 1624 signer MAY sign previously existing DKIM-Signature header fields 1625 using the method described in Section 6.4 to sign trace header 1626 fields. 1628 INFORMATIVE NOTE: Signers should be cognizant that signing DKIM- 1629 Signature header fields may result in signature failures with 1630 intermediaries that do not recognize that DKIM-Signature header 1631 fields are trace header fields and unwittingly reorder them, thus 1632 breaking such signatures. For this reason, signing existing DKIM- 1633 Signature header fields is unadvised, albeit legal. 1635 INFORMATIVE NOTE: If a header field with multiple instances is 1636 signed, those header fields are always signed from the bottom up. 1637 Thus, it is not possible to sign only specific DKIM-Signature 1638 header fields. For example, if the message being signed already 1639 contains three DKIM-Signature header fields A, B, and C, it is 1640 possible to sign all of them, B and C only, or C only, but not A 1641 only, B only, A and B only, or A and C only. 1643 A signer MAY add more than one DKIM-Signature header field using 1644 different parameters. For example, during a transition period a 1645 signer might want to produce signatures using two different hash 1646 algorithms. 1648 Signers SHOULD NOT remove any DKIM-Signature header fields from 1649 messages they are signing, even if they know that the signatures 1650 cannot be verified. 1652 When evaluating a message with multiple signatures, a verifier SHOULD 1653 evaluate signatures independently and on their own merits. For 1654 example, a verifier that by policy chooses not to accept signatures 1655 with deprecated cryptographic algorithms would consider such 1656 signatures invalid. Verifiers MAY process signatures in any order of 1657 their choice; for example, some verifiers might choose to process 1658 signatures corresponding to the From field in the message header 1659 before other signatures. See Section 7.1 for more information about 1660 signature choices. 1662 INFORMATIVE IMPLEMENTATION NOTE: Verifier attempts to correlate 1663 valid signatures with invalid signatures in an attempt to guess 1664 why a signature failed are ill-advised. In particular, there is 1665 no general way that a verifier can determine that an invalid 1666 signature was ever valid. 1668 Verifiers SHOULD ignore failed signatures as though they were not 1669 present in the message. Verifiers SHOULD continue to check 1670 signatures until a signature successfully verifies to the 1671 satisfaction of the verifier. To limit potential denial-of-service 1672 attacks, verifiers MAY limit the total number of signatures they will 1673 attempt to verify. 1675 6. Signer Actions 1677 The following steps are performed in order by signers. 1679 6.1. Determine Whether the Email Should Be Signed and by Whom 1681 A signer can obviously only sign email for domains for which it has a 1682 private key and the necessary knowledge of the corresponding public 1683 key and selector information. However, there are a number of other 1684 reasons beyond the lack of a private key why a signer could choose 1685 not to sign an email. 1687 INFORMATIVE NOTE: Signing modules may be incorporated into any 1688 portion of the mail system as deemed appropriate, including an 1689 MUA, a SUBMISSION server, or an MTA. Wherever implemented, 1690 signers should beware of signing (and thereby asserting 1691 responsibility for) messages that may be problematic. In 1692 particular, within a trusted enclave the signing address might be 1693 derived from the header according to local policy; SUBMISSION 1694 servers might only sign messages from users that are properly 1695 authenticated and authorized. 1697 INFORMATIVE IMPLEMENTER ADVICE: SUBMISSION servers should not sign 1698 Received header fields if the outgoing gateway MTA obfuscates 1699 Received header fields, for example, to hide the details of 1700 internal topology. 1702 If an email cannot be signed for some reason, it is a local policy 1703 decision as to what to do with that email. 1705 6.2. Select a Private Key and Corresponding Selector Information 1707 This specification does not define the basis by which a signer should 1708 choose which private key and selector information to use. Currently, 1709 all selectors are equal as far as this specification is concerned, so 1710 the decision should largely be a matter of administrative 1711 convenience. Distribution and management of private keys is also 1712 outside the scope of this document. 1714 INFORMATIVE OPERATIONS ADVICE: A signer should not sign with a 1715 private key when the selector containing the corresponding public 1716 key is expected to be revoked or removed before the verifier has 1717 an opportunity to validate the signature. The signer should 1718 anticipate that verifiers may choose to defer validation, perhaps 1719 until the message is actually read by the final recipient. In 1720 particular, when rotating to a new key pair, signing should 1721 immediately commence with the new private key and the old public 1722 key should be retained for a reasonable validation interval before 1723 being removed from the key server. 1725 6.3. Normalize the Message to Prevent Transport Conversions 1727 Some messages, particularly those using 8-bit characters, are subject 1728 to modification during transit, notably conversion to 7-bit form. 1729 Such conversions will break DKIM signatures. In order to minimize 1730 the chances of such breakage, signers SHOULD convert the message to a 1731 suitable MIME content transfer encoding such as quoted-printable or 1732 base64 as described in [RFC2045] before signing. Such conversion is 1733 outside the scope of DKIM; the actual message SHOULD be converted to 1734 7-bit MIME by an MUA or MSA prior to presentation to the DKIM 1735 algorithm. 1737 Similarly, a message that is not compliant with RFC5322, RFC2045 and 1738 RFC2047 can be subject to attempts by intermediaries to correct or 1739 interpret such content. See Section 8 of [RFC4409] for examples of 1740 changes that are commonly made. Such "corrections" may break DKIM 1741 signatures or have other undesirable effects. Therefore, a verifier 1742 SHOULD NOT validate a message that is not compliant with those 1743 specifications. 1745 If the message is submitted to the signer with any local encoding 1746 that will be modified before transmission, that modification to 1747 canonical [RFC5322] form MUST be done before signing. In particular, 1748 bare CR or LF characters (used by some systems as a local line 1749 separator convention) MUST be converted to the SMTP-standard CRLF 1750 sequence before the message is signed. Any conversion of this sort 1751 SHOULD be applied to the message actually sent to the recipient(s), 1752 not just to the version presented to the signing algorithm. 1754 More generally, the signer MUST sign the message as it is expected to 1755 be received by the verifier rather than in some local or internal 1756 form. 1758 6.4. Determine the Header Fields to Sign 1760 The From header field MUST be signed (that is, included in the "h=" 1761 tag of the resulting DKIM-Signature header field). Signers SHOULD 1762 NOT sign an existing header field likely to be legitimately modified 1763 or removed in transit. In particular, [RFC5321] explicitly permits 1764 modification or removal of the Return-Path header field in transit. 1765 Signers MAY include any other header fields present at the time of 1766 signing at the discretion of the signer. 1768 INFORMATIVE OPERATIONS NOTE: The choice of which header fields to 1769 sign is non-obvious. One strategy is to sign all existing, non- 1770 repeatable header fields. An alternative strategy is to sign only 1771 header fields that are likely to be displayed to or otherwise be 1772 likely to affect the processing of the message at the receiver. A 1773 third strategy is to sign only "well known" headers. Note that 1774 verifiers may treat unsigned header fields with extreme 1775 skepticism, including refusing to display them to the end user or 1776 even ignoring the signature if it does not cover certain header 1777 fields. For this reason, signing fields present in the message 1778 such as Date, Subject, Reply-To, Sender, and all MIME header 1779 fields are highly advised. 1781 The DKIM-Signature header field is always implicitly signed and MUST 1782 NOT be included in the "h=" tag except to indicate that other 1783 preexisting signatures are also signed. 1785 Signers MAY claim to have signed header fields that do not exist 1786 (that is, signers MAY include the header field name in the "h=" tag 1787 even if that header field does not exist in the message). When 1788 computing the signature, the non-existing header field MUST be 1789 treated as the null string (including the header field name, header 1790 field value, all punctuation, and the trailing CRLF). 1792 INFORMATIVE RATIONALE: This allows signers to explicitly assert 1793 the absence of a header field; if that header field is added later 1794 the signature will fail. 1796 INFORMATIVE NOTE: A header field name need only be listed once 1797 more than the actual number of that header field in a message at 1798 the time of signing in order to prevent any further additions. 1799 For example, if there is a single Comments header field at the 1800 time of signing, listing Comments twice in the "h=" tag is 1801 sufficient to prevent any number of Comments header fields from 1802 being appended; it is not necessary (but is legal) to list 1803 Comments three or more times in the "h=" tag. 1805 Signers choosing to sign an existing header field that occurs more 1806 than once in the message (such as Received) MUST sign the physically 1807 last instance of that header field in the header block. Signers 1808 wishing to sign multiple instances of such a header field MUST 1809 include the header field name multiple times in the h= tag of the 1810 DKIM-Signature header field, and MUST sign such header fields in 1811 order from the bottom of the header field block to the top. The 1812 signer MAY include more instances of a header field name in h= than 1813 there are actual corresponding header fields to indicate that 1814 additional header fields of that name SHOULD NOT be added. 1816 INFORMATIVE EXAMPLE: 1818 If the signer wishes to sign two existing Received header fields, 1819 and the existing header contains: 1821 Received: 1822 Received: 1823 Received: 1825 then the resulting DKIM-Signature header field should read: 1827 DKIM-Signature: ... h=Received : Received :... 1828 and Received header fields and will be signed in that 1829 order. 1831 Signers should be careful of signing header fields that might have 1832 additional instances added later in the delivery process, since such 1833 header fields might be inserted after the signed instance or 1834 otherwise reordered. Trace header fields (such as Received) and 1835 Resent-* blocks are the only fields prohibited by [RFC5322] from 1836 being reordered. In particular, since DKIM-Signature header fields 1837 may be reordered by some intermediate MTAs, signing existing DKIM- 1838 Signature header fields is error-prone. 1840 INFORMATIVE ADMONITION: Despite the fact that [RFC5322] permits 1841 header fields to be reordered (with the exception of Received 1842 header fields), reordering of signed header fields with multiple 1843 instances by intermediate MTAs will cause DKIM signatures to be 1844 broken; such anti-social behavior should be avoided. 1846 INFORMATIVE IMPLEMENTER'S NOTE: Although not required by this 1847 specification, all end-user visible header fields should be signed 1848 to avoid possible "indirect spamming". For example, if the 1849 Subject header field is not signed, a spammer can resend a 1850 previously signed mail, replacing the legitimate subject with a 1851 one-line spam. 1853 6.5. Recommended Signature Content 1855 In order to maximize compatibility with a variety of verifiers, it is 1856 recommended that signers follow the practices outlined in this 1857 section when signing a message. However, these are generic 1858 recommendations applying to the general case; specific senders may 1859 wish to modify these guidelines as required by their unique 1860 situations. Verifiers MUST be capable of verifying signatures even 1861 if one or more of the recommended header fields is not signed (with 1862 the exception of From, which must always be signed) or if one or more 1863 of the dis-recommended header fields is signed. Note that verifiers 1864 do have the option of ignoring signatures that do not cover a 1865 sufficient portion of the header or body, just as they may ignore 1866 signatures from an identity they do not trust. 1868 The following header fields SHOULD be included in the signature, if 1869 they are present in the message being signed: 1871 o From (REQUIRED in all signatures) 1873 o Sender, Reply-To 1875 o Subject 1877 o Date, Message-ID 1879 o To, Cc 1881 o MIME-Version 1883 o Content-Type, Content-Transfer-Encoding, Content-ID, Content- 1884 Description 1886 o Resent-Date, Resent-From, Resent-Sender, Resent-To, Resent-Cc, 1887 Resent-Message-ID 1889 o In-Reply-To, References 1891 o List-Id, List-Help, List-Unsubscribe, List-Subscribe, List-Post, 1892 List-Owner, List-Archive 1894 The following header fields SHOULD NOT be included in the signature: 1896 o Return-Path 1898 o Received 1900 o Comments, Keywords 1902 o Bcc, Resent-Bcc 1904 o DKIM-Signature 1906 Optional header fields (those not mentioned above) normally SHOULD 1907 NOT be included in the signature, because of the potential for 1908 additional header fields of the same name to be legitimately added or 1909 reordered prior to verification. There are likely to be legitimate 1910 exceptions to this rule, because of the wide variety of application- 1911 specific header fields that may be applied to a message, some of 1912 which are unlikely to be duplicated, modified, or reordered. 1914 Signers SHOULD choose canonicalization algorithms based on the types 1915 of messages they process and their aversion to risk. For example, 1916 e-commerce sites sending primarily purchase receipts, which are not 1917 expected to be processed by mailing lists or other software likely to 1918 modify messages, will generally prefer "simple" canonicalization. 1919 Sites sending primarily person-to-person email will likely prefer to 1920 be more resilient to modification during transport by using "relaxed" 1921 canonicalization. 1923 Signers SHOULD NOT use "l=" unless they intend to accommodate 1924 intermediate mail processors that append text to a message. For 1925 example, many mailing list processors append "unsubscribe" 1926 information to message bodies. If signers use "l=", they SHOULD 1927 include the entire message body existing at the time of signing in 1928 computing the count. In particular, signers SHOULD NOT specify a 1929 body length of 0 since this may be interpreted as a meaningless 1930 signature by some verifiers. 1932 6.6. Compute the Message Hash and Signature 1934 The signer MUST compute the message hash as described in Section 4.7 1935 and then sign it using the selected public-key algorithm. This will 1936 result in a DKIM-Signature header field that will include the body 1937 hash and a signature of the header hash, where that header includes 1938 the DKIM-Signature header field itself. 1940 Entities such as mailing list managers that implement DKIM and that 1941 modify the message or a header field (for example, inserting 1942 unsubscribe information) before retransmitting the message SHOULD 1943 check any existing signature on input and MUST make such 1944 modifications before re-signing the message. 1946 The signer MAY elect to limit the number of bytes of the body that 1947 will be included in the hash and hence signed. The length actually 1948 hashed should be inserted in the "l=" tag of the DKIM-Signature 1949 header field. 1951 6.7. Insert the DKIM-Signature Header Field 1953 Finally, the signer MUST insert the DKIM-Signature header field 1954 created in the previous step prior to transmitting the email. The 1955 DKIM-Signature header field MUST be the same as used to compute the 1956 hash as described above, except that the value of the "b=" tag MUST 1957 be the appropriately signed hash computed in the previous step, 1958 signed using the algorithm specified in the "a=" tag of the DKIM- 1959 Signature header field and using the private key corresponding to the 1960 selector given in the "s=" tag of the DKIM-Signature header field, as 1961 chosen above in Section 6.2 1963 The DKIM-Signature header field MUST be inserted before any other 1964 DKIM-Signature fields in the header block. 1966 INFORMATIVE IMPLEMENTATION NOTE: The easiest way to achieve this 1967 is to insert the DKIM-Signature header field at the beginning of 1968 the header block. In particular, it may be placed before any 1969 existing Received header fields. This is consistent with treating 1970 DKIM-Signature as a trace header field. 1972 7. Verifier Actions 1974 Since a signer MAY remove or revoke a public key at any time, it is 1975 recommended that verification occur in a timely manner. In many 1976 configurations, the most timely place is during acceptance by the 1977 border MTA or shortly thereafter. In particular, deferring 1978 verification until the message is accessed by the end user is 1979 discouraged. 1981 A border or intermediate MTA MAY verify the message signature(s). An 1982 MTA who has performed verification MAY communicate the result of that 1983 verification by adding a verification header field to incoming 1984 messages. This considerably simplifies things for the user, who can 1985 now use an existing mail user agent. Most MUAs have the ability to 1986 filter messages based on message header fields or content; these 1987 filters would be used to implement whatever policy the user wishes 1988 with respect to unsigned mail. 1990 A verifying MTA MAY implement a policy with respect to unverifiable 1991 mail, regardless of whether or not it applies the verification header 1992 field to signed messages. 1994 Verifiers MUST produce a result that is semantically equivalent to 1995 applying the following steps in the order listed. In practice, 1996 several of these steps can be performed in parallel in order to 1997 improve performance. 1999 7.1. Extract Signatures from the Message 2001 The order in which verifiers try DKIM-Signature header fields is not 2002 defined; verifiers MAY try signatures in any order they like. For 2003 example, one implementation might try the signatures in textual 2004 order, whereas another might try signatures by identities that match 2005 the contents of the From header field before trying other signatures. 2006 Verifiers MUST NOT attribute ultimate meaning to the order of 2007 multiple DKIM-Signature header fields. In particular, there is 2008 reason to believe that some relays will reorder the header fields in 2009 potentially arbitrary ways. 2011 INFORMATIVE IMPLEMENTATION NOTE: Verifiers might use the order as 2012 a clue to signing order in the absence of any other information. 2014 However, other clues as to the semantics of multiple signatures 2015 (such as correlating the signing host with Received header fields) 2016 may also be considered. 2018 A verifier SHOULD NOT treat a message that has one or more bad 2019 signatures and no good signatures differently from a message with no 2020 signature at all; such treatment is a matter of local policy and is 2021 beyond the scope of this document. 2023 When a signature successfully verifies, a verifier will either stop 2024 processing or attempt to verify any other signatures, at the 2025 discretion of the implementation. A verifier MAY limit the number of 2026 signatures it tries to avoid denial-of-service attacks. 2028 INFORMATIVE NOTE: An attacker could send messages with large 2029 numbers of faulty signatures, each of which would require a DNS 2030 lookup and corresponding CPU time to verify the message. This 2031 could be an attack on the domain that receives the message, by 2032 slowing down the verifier by requiring it to do a large number of 2033 DNS lookups and/or signature verifications. It could also be an 2034 attack against the domains listed in the signatures, essentially 2035 by enlisting innocent verifiers in launching an attack against the 2036 DNS servers of the actual victim. 2038 In the following description, text reading "return status 2039 (explanation)" (where "status" is one of "PERMFAIL" or "TEMPFAIL") 2040 means that the verifier MUST immediately cease processing that 2041 signature. The verifier SHOULD proceed to the next signature, if any 2042 is present, and completely ignore the bad signature. If the status 2043 is "PERMFAIL", the signature failed and should not be reconsidered. 2044 If the status is "TEMPFAIL", the signature could not be verified at 2045 this time but may be tried again later. A verifier MAY either defer 2046 the message for later processing, perhaps by queueing it locally or 2047 issuing a 451/4.7.5 SMTP reply, or try another signature; if no good 2048 signature is found and any of the signatures resulted in a TEMPFAIL 2049 status, the verifier MAY save the message for later processing. The 2050 "(explanation)" is not normative text; it is provided solely for 2051 clarification. 2053 Verifiers SHOULD ignore any DKIM-Signature header fields where the 2054 signature does not validate. Verifiers that are prepared to validate 2055 multiple signature header fields SHOULD proceed to the next signature 2056 header field, should it exist. However, verifiers MAY make note of 2057 the fact that an invalid signature was present for consideration at a 2058 later step. 2060 INFORMATIVE NOTE: The rationale of this requirement is to permit 2061 messages that have invalid signatures but also a valid signature 2062 to work. For example, a mailing list exploder might opt to leave 2063 the original submitter signature in place even though the exploder 2064 knows that it is modifying the message in some way that will break 2065 that signature, and the exploder inserts its own signature. In 2066 this case, the message should succeed even in the presence of the 2067 known-broken signature. 2069 For each signature to be validated, the following steps should be 2070 performed in such a manner as to produce a result that is 2071 semantically equivalent to performing them in the indicated order. 2073 7.1.1. Validate the Signature Header Field 2075 Implementers MUST meticulously validate the format and values in the 2076 DKIM-Signature header field; any inconsistency or unexpected values 2077 MUST cause the header field to be completely ignored and the verifier 2078 to return PERMFAIL (signature syntax error). Being "liberal in what 2079 you accept" is definitely a bad strategy in this security context. 2080 Note however that this does not include the existence of unknown tags 2081 in a DKIM-Signature header field, which are explicitly permitted. 2082 Verifiers MUST ignore DKIM-Signature header fields with a "v=" tag 2083 that is inconsistent with this specification and return PERMFAIL 2084 (incompatible version). 2086 INFORMATIVE IMPLEMENTATION NOTE: An implementation may, of course, 2087 choose to also verify signatures generated by older versions of 2088 this specification. 2090 If any tag listed as "required" in Section 4.5 is omitted from the 2091 DKIM-Signature header field, the verifier MUST ignore the DKIM- 2092 Signature header field and return PERMFAIL (signature missing 2093 required tag). 2095 INFORMATIONAL NOTE: The tags listed as required in Section 4.5 are 2096 "v=", "a=", "b=", "bh=", "d=", "h=", and "s=". Should there be a 2097 conflict between this note and Section 4.5, Section 4.5 is 2098 normative. 2100 If the DKIM-Signature header field does not contain the "i=" tag, the 2101 verifier MUST behave as though the value of that tag were "@d", where 2102 "d" is the value from the "d=" tag. 2104 Verifiers MUST confirm that the domain specified in the "d=" tag is 2105 the same as or a parent domain of the domain part of the "i=" tag. 2106 If not, the DKIM-Signature header field MUST be ignored and the 2107 verifier should return PERMFAIL (domain mismatch). 2109 If the "h=" tag does not include the From header field, the verifier 2110 MUST ignore the DKIM-Signature header field and return PERMFAIL (From 2111 field not signed). 2113 Verifiers MAY ignore the DKIM-Signature header field and return 2114 PERMFAIL (signature expired) if it contains an "x=" tag and the 2115 signature has expired. 2117 Verifiers MAY ignore the DKIM-Signature header field if the domain 2118 used by the signer in the "d=" tag is not associated with a valid 2119 signing entity. For example, signatures with "d=" values such as 2120 "com" and "co.uk" may be ignored. The list of unacceptable domains 2121 SHOULD be configurable. 2123 Verifiers MAY ignore the DKIM-Signature header field and return 2124 PERMFAIL (unacceptable signature header) for any other reason, for 2125 example, if the signature does not sign header fields that the 2126 verifier views to be essential. As a case in point, if MIME header 2127 fields are not signed, certain attacks may be possible that the 2128 verifier would prefer to avoid. 2130 7.1.2. Get the Public Key 2132 The public key for a signature is needed to complete the verification 2133 process. The process of retrieving the public key depends on the 2134 query type as defined by the "q=" tag in the DKIM-Signature header 2135 field. Obviously, a public key need only be retrieved if the process 2136 of extracting the signature information is completely successful. 2137 Details of key management and representation are described in 2138 Section 4.6. The verifier MUST validate the key record and MUST 2139 ignore any public key records that are malformed. 2141 NOTE: The use of a wildcard TXT record that covers a queried DKIM 2142 domain name will produce a response to a DKIM query that is 2143 unlikely to be valid DKIM key record. This problem is not 2144 specific to DKIM and applies to many other types of queries. 2145 Client software that processes DNS responses needs to take this 2146 problem into account. 2148 When validating a message, a verifier MUST perform the following 2149 steps in a manner that is semantically the same as performing them in 2150 the order indicated -- in some cases the implementation may 2151 parallelize or reorder these steps, as long as the semantics remain 2152 unchanged: 2154 1. Retrieve the public key as described in Section 4.6 using the 2155 algorithm in the "q=" tag, the domain from the "d=" tag, and the 2156 selector from the "s=" tag. 2158 2. If the query for the public key fails to respond, the verifier 2159 MAY defer acceptance of this email and return TEMPFAIL (key 2160 unavailable). If verification is occurring during the incoming 2161 SMTP session, this MAY be achieved with a 451/4.7.5 SMTP reply 2162 code. Alternatively, the verifier MAY store the message in the 2163 local queue for later trial or ignore the signature. Note that 2164 storing a message in the local queue is subject to denial-of- 2165 service attacks. 2167 3. If the query for the public key fails because the corresponding 2168 key record does not exist, the verifier MUST immediately return 2169 PERMFAIL (no key for signature). 2171 4. If the query for the public key returns multiple key records, the 2172 verifier may choose one of the key records or may cycle through 2173 the key records performing the remainder of these steps on each 2174 record at the discretion of the implementer. The order of the 2175 key records is unspecified. If the verifier chooses to cycle 2176 through the key records, then the "return ..." wording in the 2177 remainder of this section means "try the next key record, if any; 2178 if none, return to try another signature in the usual way". 2180 5. If the result returned from the query does not adhere to the 2181 format defined in this specification, the verifier MUST ignore 2182 the key record and return PERMFAIL (key syntax error). Verifiers 2183 are urged to validate the syntax of key records carefully to 2184 avoid attempted attacks. In particular, the verifier MUST ignore 2185 keys with a version code ("v=" tag) that they do not implement. 2187 6. If the "h=" tag exists in the public key record and the hash 2188 algorithm implied by the "a=" tag in the DKIM-Signature header 2189 field is not included in the contents of the "h=" tag, the 2190 verifier MUST ignore the key record and return PERMFAIL 2191 (inappropriate hash algorithm). 2193 7. If the public key data (the "p=" tag) is empty, then this key has 2194 been revoked and the verifier MUST treat this as a failed 2195 signature check and return PERMFAIL (key revoked). There is no 2196 defined semantic difference between a key that has been revoked 2197 and a key record that has been removed. 2199 8. If the public key data is not suitable for use with the algorithm 2200 and key types defined by the "a=" and "k=" tags in the DKIM- 2201 Signature header field, the verifier MUST immediately return 2202 PERMFAIL (inappropriate key algorithm). 2204 7.1.3. Compute the Verification 2206 Given a signer and a public key, verifying a signature consists of 2207 actions semantically equivalent to the following steps. 2209 1. Based on the algorithm defined in the "c=" tag, the body length 2210 specified in the "l=" tag, and the header field names in the "h=" 2211 tag, prepare a canonicalized version of the message as is 2212 described in Section 4.7 (note that this version does not 2213 actually need to be instantiated). When matching header field 2214 names in the "h=" tag against the actual message header field, 2215 comparisons MUST be case-insensitive. 2217 2. Based on the algorithm indicated in the "a=" tag, compute the 2218 message hashes from the canonical copy as described in 2219 Section 4.7. 2221 3. Verify that the hash of the canonicalized message body computed 2222 in the previous step matches the hash value conveyed in the "bh=" 2223 tag. If the hash does not match, the verifier SHOULD ignore the 2224 signature and return PERMFAIL (body hash did not verify). 2226 4. Using the signature conveyed in the "b=" tag, verify the 2227 signature against the header hash using the mechanism appropriate 2228 for the public key algorithm described in the "a=" tag. If the 2229 signature does not validate, the verifier SHOULD ignore the 2230 signature and return PERMFAIL (signature did not verify). 2232 5. Otherwise, the signature has correctly verified. 2234 INFORMATIVE IMPLEMENTER'S NOTE: Implementations might wish to 2235 initiate the public-key query in parallel with calculating the 2236 hash as the public key is not needed until the final decryption is 2237 calculated. Implementations may also verify the signature on the 2238 message header before validating that the message hash listed in 2239 the "bh=" tag in the DKIM-Signature header field matches that of 2240 the actual message body; however, if the body hash does not match, 2241 the entire signature must be considered to have failed. 2243 A body length specified in the "l=" tag of the signature limits the 2244 number of bytes of the body passed to the verification algorithm. 2245 All data beyond that limit is not validated by DKIM. Hence, 2246 verifiers might treat a message that contains bytes beyond the 2247 indicated body length with suspicion, such as by declaring the 2248 signature invalid (e.g., by returning PERMFAIL (unsigned content)), 2249 or conveying the partial verification to the policy module. {DKIM 2} 2251 7.2. Communicate Verification Results 2253 Verifiers wishing to communicate the results of verification to other 2254 parts of the mail system may do so in whatever manner they see fit. 2255 For example, implementations might choose to add an email header 2256 field to the message before passing it on. Any such header field 2257 SHOULD be inserted before any existing DKIM-Signature or preexisting 2258 authentication status header fields in the header field block. The 2259 Authentication-Results: header field ([RFC5451]) MAY be used for this 2260 purpose. 2262 INFORMATIVE ADVICE to MUA filter writers: Patterns intended to 2263 search for results header fields to visibly mark authenticated 2264 mail for end users should verify that such header field was added 2265 by the appropriate verifying domain and that the verified identity 2266 matches the author identity that will be displayed by the MUA. In 2267 particular, MUA filters should not be influenced by bogus results 2268 header fields added by attackers. To circumvent this attack, 2269 verifiers may wish to delete existing results header fields after 2270 verification and before adding a new header field. 2272 7.3. Interpret Results/Apply Local Policy 2274 It is beyond the scope of this specification to describe what actions 2275 an Identity Assessor can make, but mail carrying a validated SDID 2276 presents an opportunity to an Identity Assessor that unauthenticated 2277 email does not. Specifically, an authenticated email creates a 2278 predictable identifier by which other decisions can reliably be 2279 managed, such as trust and reputation. Conversely, unauthenticated 2280 email lacks a reliable identifier that can be used to assign trust 2281 and reputation. It is reasonable to treat unauthenticated email as 2282 lacking any trust and having no positive reputation. 2284 In general, verifiers SHOULD NOT reject messages solely on the basis 2285 of a lack of signature or an unverifiable signature; such rejection 2286 would cause severe interoperability problems. However, if the 2287 verifier does opt to reject such messages (for example, when 2288 communicating with a peer who, by prior agreement, agrees to only 2289 send signed messages), and the verifier runs synchronously with the 2290 SMTP session and a signature is missing or does not verify, the MTA 2291 SHOULD use a 550/5.7.x reply code. 2293 If it is not possible to fetch the public key, perhaps because the 2294 key server is not available, a temporary failure message MAY be 2295 generated using a 451/4.7.5 reply code, such as: 2296 451 4.7.5 Unable to verify signature - key server unavailable 2298 Temporary failures such as inability to access the key server or 2299 other external service are the only conditions that SHOULD use a 4xx 2300 SMTP reply code. In particular, cryptographic signature verification 2301 failures MUST NOT return 4xx SMTP replies. 2303 Once the signature has been verified, that information MUST be 2304 conveyed to the Identity Assessor (such as an explicit allow/ 2305 whitelist and reputation system) and/or to the end user. If the SDID 2306 is not the same as the address in the From: header field, the mail 2307 system SHOULD take pains to ensure that the actual SDID is clear to 2308 the reader. 2310 While the symptoms of a failed verification are obvious -- the 2311 signature doesn't verify -- establishing the exact cause can be more 2312 difficult. If a selector cannot be found, is that because the 2313 selector has been removed, or was the value changed somehow in 2314 transit? If the signature line is missing, is that because it was 2315 never there, or was it removed by an overzealous filter? For 2316 diagnostic purposes, the exact reason why the verification fails 2317 SHOULD be made available to the policy module and possibly recorded 2318 in the system logs. If the email cannot be verified, then it SHOULD 2319 be treated {DKIM 2} the same as all unverified email regardless of 2320 whether or not it looks like it was signed. 2322 8. IANA Considerations 2324 DKIM has registered namespaces with IANA. In all cases, new values 2325 are assigned only for values that have been documented in a published 2326 RFC that has IETF Consensus [RFC5226]. 2328 This memo updates these registries as described below. Of note is 2329 the addition of a new "status" column. All registrations into these 2330 namespaces MUST include the name being registered, the document in 2331 which it was registered or updated, and an indication of its current 2332 status which MUST be one of "active" (in current use) or "historic" 2333 (no longer in current use). 2335 8.1. DKIM-Signature Tag Specifications 2337 A DKIM-Signature provides for a list of tag specifications. IANA has 2338 established the DKIM-Signature Tag Specification Registry for tag 2339 specifications that can be used in DKIM-Signature fields. 2341 The updated entries in the registry comprise: 2343 +------+-----------------+--------+ 2344 | TYPE | REFERENCE | STATUS | 2345 +------+-----------------+--------+ 2346 | v | (this document) | active | 2347 | a | (this document) | active | 2348 | b | (this document) | active | 2349 | bh | (this document) | active | 2350 | c | (this document) | active | 2351 | d | (this document) | active | 2352 | h | (this document) | active | 2353 | i | (this document) | active | 2354 | l | (this document) | active | 2355 | q | (this document) | active | 2356 | s | (this document) | active | 2357 | t | (this document) | active | 2358 | x | (this document) | active | 2359 | z | (this document) | active | 2360 +------+-----------------+--------+ 2362 Table 1: DKIM-Signature Tag Specification Registry Updated Values 2364 8.2. DKIM-Signature Query Method Registry 2366 The "q=" tag-spec (specified in Section 4.5) provides for a list of 2367 query methods. 2369 IANA has established the DKIM-Signature Query Method Registry for 2370 mechanisms that can be used to retrieve the key that will permit 2371 validation processing of a message signed using DKIM. 2373 The updated entry in the registry comprises: 2375 +------+--------+-----------------+--------+ 2376 | TYPE | OPTION | REFERENCE | STATUS | 2377 +------+--------+-----------------+--------+ 2378 | dns | txt | (this document) | active | 2379 +------+--------+-----------------+--------+ 2381 DKIM-Signature Query Method Registry Updated Values 2383 8.3. DKIM-Signature Canonicalization Registry 2385 The "c=" tag-spec (specified in Section 4.5) provides for a specifier 2386 for canonicalization algorithms for the header and body of the 2387 message. 2389 IANA has established the DKIM-Signature Canonicalization Algorithm 2390 Registry for algorithms for converting a message into a canonical 2391 form before signing or verifying using DKIM. 2393 The updated entries in the header registry comprise: 2395 +---------+-----------------+--------+ 2396 | TYPE | REFERENCE | STATUS | 2397 +---------+-----------------+--------+ 2398 | simple | (this document) | active | 2399 | relaxed | (this document) | active | 2400 +---------+-----------------+--------+ 2402 DKIM-Signature Header Canonicalization Algorithm Registry 2403 Updated Values 2405 The updated entries in the body registry comprise: 2407 +---------+-----------------+--------+ 2408 | TYPE | REFERENCE | STATUS | 2409 +---------+-----------------+--------+ 2410 | simple | (this document) | active | 2411 | relaxed | (this document) | active | 2412 +---------+-----------------+--------+ 2414 DKIM-Signature Body Canonicalization Algorithm Registry 2415 Updated Values 2417 8.4. _domainkey DNS TXT Record Tag Specifications 2419 A _domainkey DNS TXT record provides for a list of tag 2420 specifications. IANA has established the DKIM _domainkey DNS TXT Tag 2421 Specification Registry for tag specifications that can be used in DNS 2422 TXT Records. 2424 The updated entries in the registry comprise: 2426 +------+-----------------+----------+ 2427 | TYPE | REFERENCE | STATUS | 2428 +------+-----------------+----------+ 2429 | v | (this document) | active | 2430 | g | [RFC4871] | historic | 2431 | h | (this document) | active | 2432 | k | (this document) | active | 2433 | n | (this document) | active | 2434 | p | (this document) | active | 2435 | s | (this document) | active | 2436 | t | (this document) | active | 2437 +------+-----------------+----------+ 2439 DKIM _domainkey DNS TXT Record Tag Specification Registry 2440 Updated Values 2442 8.5. DKIM Key Type Registry 2444 The "k=" (specified in Section 4.6.1) and the "a=" (specified in Section 4.5) tags provide for a list of 2446 mechanisms that can be used to decode a DKIM signature. 2448 IANA has established the DKIM Key Type Registry for such mechanisms. 2450 The updated entry in the registry comprises: 2452 +------+-----------+--------+ 2453 | TYPE | REFERENCE | STATUS | 2454 +------+-----------+--------+ 2455 | rsa | [RFC3447] | active | 2456 +------+-----------+--------+ 2458 DKIM Key Type Updated Values 2460 8.6. DKIM Hash Algorithms Registry 2462 The "h=" (specified in Section 4.6.1) and the "a=" (specified in Section 4.5) tags provide for a list of 2464 mechanisms that can be used to produce a digest of message data. 2466 IANA has established the DKIM Hash Algorithms Registry for such 2467 mechanisms. 2469 The updated entries in the registry comprise: 2471 +--------+-------------------+--------+ 2472 | TYPE | REFERENCE | STATUS | 2473 +--------+-------------------+--------+ 2474 | sha1 | [FIPS-180-2-2002] | active | 2475 | sha256 | [FIPS-180-2-2002] | active | 2476 +--------+-------------------+--------+ 2478 DKIM Hash Algorithms Updated Values 2480 8.7. DKIM Service Types Registry 2482 The "s=" tag (specified in Section 4.6.1) provides for a 2483 list of service types to which this selector may apply. 2485 IANA has established the DKIM Service Types Registry for service 2486 types. 2488 The updated entries in the registry comprise: 2490 +-------+-----------------+--------+ 2491 | TYPE | REFERENCE | STATUS | 2492 +-------+-----------------+--------+ 2493 | email | (this document) | active | 2494 | * | (this document) | active | 2495 +-------+-----------------+--------+ 2497 DKIM Service Types Registry Updated Values 2499 8.8. DKIM Selector Flags Registry 2501 The "t=" tag (specified in Section 4.6.1) provides for a 2502 list of flags to modify interpretation of the selector. 2504 IANA has established the DKIM Selector Flags Registry for additional 2505 flags. 2507 The updated entries in the registry comprise: 2509 +------+-----------------+--------+ 2510 | TYPE | REFERENCE | STATUS | 2511 +------+-----------------+--------+ 2512 | y | (this document) | active | 2513 | s | (this document) | active | 2514 +------+-----------------+--------+ 2516 DKIM Selector Flags Registry Updated Values 2518 8.9. DKIM-Signature Header Field 2520 IANA has added DKIM-Signature to the "Permanent Message Header 2521 Fields" registry (see [RFC3864]) for the "mail" protocol, using this 2522 document as the reference. 2524 9. Security Considerations 2526 It has been observed that any mechanism that is introduced that 2527 attempts to stem the flow of spam is subject to intensive attack. 2528 DKIM needs to be carefully scrutinized to identify potential attack 2529 vectors and the vulnerability to each. See also [RFC4686]. 2531 9.1. Misuse of Body Length Limits ("l=" Tag) 2533 Body length limits (in the form of the "l=" tag) are subject to 2534 several potential attacks. 2536 9.1.1. Addition of New MIME Parts to Multipart/* 2538 If the body length limit does not cover a closing MIME multipart 2539 section (including the trailing "--CRLF" portion), then it is 2540 possible for an attacker to intercept a properly signed multipart 2541 message and add a new body part. Depending on the details of the 2542 MIME type and the implementation of the verifying MTA and the 2543 receiving MUA, this could allow an attacker to change the information 2544 displayed to an end user from an apparently trusted source. 2546 For example, if attackers can append information to a "text/html" 2547 body part, they may be able to exploit a bug in some MUAs that 2548 continue to read after a "" marker, and thus display HTML text 2549 on top of already displayed text. If a message has a "multipart/ 2550 alternative" body part, they might be able to add a new body part 2551 that is preferred by the displaying MUA. 2553 9.1.2. Addition of new HTML content to existing content 2555 Several receiving MUA implementations do not cease display after a 2556 """" tag. In particular, this allows attacks involving 2557 overlaying images on top of existing text. 2559 INFORMATIVE EXAMPLE: Appending the following text to an existing, 2560 properly closed message will in many MUAs result in inappropriate 2561 data being rendered on top of existing, correct data: 2563
2564
2567 9.2. Misappropriated Private Key 2569 If the private key for a user is resident on their computer and is 2570 not protected by an appropriately secure mechanism, it is possible 2571 for malware to send mail as that user and any other user sharing the 2572 same private key. The malware would not, however, be able to 2573 generate signed spoofs of other signers' addresses, which would aid 2574 in identification of the infected user and would limit the 2575 possibilities for certain types of attacks involving socially 2576 engineered messages. This threat applies mainly to MUA-based 2577 implementations; protection of private keys on servers can be easily 2578 achieved through the use of specialized cryptographic hardware. 2580 A larger problem occurs if malware on many users' computers obtains 2581 the private keys for those users and transmits them via a covert 2582 channel to a site where they can be shared. The compromised users 2583 would likely not know of the misappropriation until they receive 2584 "bounce" messages from messages they are purported to have sent. 2585 Many users might not understand the significance of these bounce 2586 messages and would not take action. 2588 One countermeasure is to use a user-entered passphrase to encrypt the 2589 private key, although users tend to choose weak passphrases and often 2590 reuse them for different purposes, possibly allowing an attack 2591 against DKIM to be extended into other domains. Nevertheless, the 2592 decoded private key might be briefly available to compromise by 2593 malware when it is entered, or might be discovered via keystroke 2594 logging. The added complexity of entering a passphrase each time one 2595 sends a message would also tend to discourage the use of a secure 2596 passphrase. 2598 A somewhat more effective countermeasure is to send messages through 2599 an outgoing MTA that can authenticate the submitter using existing 2600 techniques (e.g., SMTP Authentication), possibly validate the message 2601 itself (e.g., verify that the header is legitimate and that the 2602 content passes a spam content check), and sign the message using a 2603 key appropriate for the submitter address. Such an MTA can also 2604 apply controls on the volume of outgoing mail each user is permitted 2605 to originate in order to further limit the ability of malware to 2606 generate bulk email. 2608 9.3. Key Server Denial-of-Service Attacks 2610 Since the key servers are distributed (potentially separate for each 2611 domain), the number of servers that would need to be attacked to 2612 defeat this mechanism on an Internet-wide basis is very large. 2613 Nevertheless, key servers for individual domains could be attacked, 2614 impeding the verification of messages from that domain. This is not 2615 significantly different from the ability of an attacker to deny 2616 service to the mail exchangers for a given domain, although it 2617 affects outgoing, not incoming, mail. 2619 A variation on this attack is that if a very large amount of mail 2620 were to be sent using spoofed addresses from a given domain, the key 2621 servers for that domain could be overwhelmed with requests. However, 2622 given the low overhead of verification compared with handling of the 2623 email message itself, such an attack would be difficult to mount. 2625 9.4. Attacks Against the DNS 2627 Since the DNS is a required binding for key services, specific 2628 attacks against the DNS must be considered. 2630 While the DNS is currently insecure [RFC3833], these security 2631 problems are the motivation behind DNS Security (DNSSEC) [RFC4033], 2632 and all users of the DNS will reap the benefit of that work. 2634 DKIM is only intended as a "sufficient" method of proving 2635 authenticity. It is not intended to provide strong cryptographic 2636 proof about authorship or contents. Other technologies such as 2637 OpenPGP [RFC4880] and S/MIME [RFC5751] address those requirements. 2639 A second security issue related to the DNS revolves around the 2640 increased DNS traffic as a consequence of fetching selector-based 2641 data as well as fetching signing domain policy. Widespread 2642 deployment of DKIM will result in a significant increase in DNS 2643 queries to the claimed signing domain. In the case of forgeries on a 2644 large scale, DNS servers could see a substantial increase in queries. 2646 A specific DNS security issue that should be considered by DKIM 2647 verifiers is the name chaining attack described in Section 2.3 of 2648 [RFC3833]. A DKIM verifier, while verifying a DKIM-Signature header 2649 field, could be prompted to retrieve a key record of an attacker's 2650 choosing. This threat can be minimized by ensuring that name 2651 servers, including recursive name servers, used by the verifier 2652 enforce strict checking of "glue" and other additional information in 2653 DNS responses and are therefore not vulnerable to this attack. 2655 9.5. Replay Attacks 2657 In this attack, a spammer sends a message to be spammed to an 2658 accomplice, which results in the message being signed by the 2659 originating MTA. The accomplice resends the message, including the 2660 original signature, to a large number of recipients, possibly by 2661 sending the message to many compromised machines that act as MTAs. 2662 The messages, not having been modified by the accomplice, have valid 2663 signatures. 2665 Partial solutions to this problem involve the use of reputation 2666 services to convey the fact that the specific email address is being 2667 used for spam and that messages from that signer are likely to be 2668 spam. This requires a real-time detection mechanism in order to 2669 react quickly enough. However, such measures might be prone to 2670 abuse, if for example an attacker resent a large number of messages 2671 received from a victim in order to make them appear to be a spammer. 2673 Large verifiers might be able to detect unusually large volumes of 2674 mails with the same signature in a short time period. Smaller 2675 verifiers can get substantially the same volume of information via 2676 existing collaborative systems. 2678 9.6. Limits on Revoking Keys 2680 When a large domain detects undesirable behavior on the part of one 2681 of its users, it might wish to revoke the key used to sign that 2682 user's messages in order to disavow responsibility for messages that 2683 have not yet been verified or that are the subject of a replay 2684 attack. However, the ability of the domain to do so can be limited 2685 if the same key, for scalability reasons, is used to sign messages 2686 for many other users. Mechanisms for explicitly revoking keys on a 2687 per-address basis have been proposed but require further study as to 2688 their utility and the DNS load they represent. 2690 9.7. Intentionally Malformed Key Records 2692 It is possible for an attacker to publish key records in DNS that are 2693 intentionally malformed, with the intent of causing a denial-of- 2694 service attack on a non-robust verifier implementation. The attacker 2695 could then cause a verifier to read the malformed key record by 2696 sending a message to one of its users referencing the malformed 2697 record in a (not necessarily valid) signature. Verifiers MUST 2698 thoroughly verify all key records retrieved from the DNS and be 2699 robust against intentionally as well as unintentionally malformed key 2700 records. 2702 9.8. Intentionally Malformed DKIM-Signature Header Fields 2704 Verifiers MUST be prepared to receive messages with malformed DKIM- 2705 Signature header fields, and thoroughly verify the header field 2706 before depending on any of its contents. 2708 9.9. Information Leakage 2710 An attacker could determine when a particular signature was verified 2711 by using a per-message selector and then monitoring their DNS traffic 2712 for the key lookup. This would act as the equivalent of a "web bug" 2713 for verification time rather than when the message was read. 2715 9.10. Remote Timing Attacks 2717 In some cases it may be possible to extract private keys using a 2718 remote timing attack [BONEH03]. Implementations should consider 2719 obfuscating the timing to prevent such attacks. 2721 9.11. Reordered Header Fields 2723 Existing standards allow intermediate MTAs to reorder header fields. 2724 If a signer signs two or more header fields of the same name, this 2725 can cause spurious verification errors on otherwise legitimate 2726 messages. In particular, signers that sign any existing DKIM- 2727 Signature fields run the risk of having messages incorrectly fail to 2728 verify. 2730 9.12. RSA Attacks 2732 An attacker could create a large RSA signing key with a small 2733 exponent, thus requiring that the verification key have a large 2734 exponent. This will force verifiers to use considerable computing 2735 resources to verify the signature. Verifiers might avoid this attack 2736 by refusing to verify signatures that reference selectors with public 2737 keys having unreasonable exponents. 2739 In general, an attacker might try to overwhelm a verifier by flooding 2740 it with messages requiring verification. This is similar to other 2741 MTA denial-of-service attacks and should be dealt with in a similar 2742 fashion. 2744 9.13. Inappropriate Signing by Parent Domains 2746 The trust relationship described in Section 4.9 could conceivably be 2747 used by a parent domain to sign messages with identities in a 2748 subdomain not administratively related to the parent. For example, 2749 the ".com" registry could create messages with signatures using an 2750 "i=" value in the example.com domain. There is no general solution 2751 to this problem, since the administrative cut could occur anywhere in 2752 the domain name. For example, in the domain "example.podunk.ca.us" 2753 there are three administrative cuts (podunk.ca.us, ca.us, and us), 2754 any of which could create messages with an identity in the full 2755 domain. 2757 INFORMATIVE NOTE: This is considered an acceptable risk for the 2758 same reason that it is acceptable for domain delegation. For 2759 example, in the example above any of the domains could potentially 2760 simply delegate "example.podunk.ca.us" to a server of their choice 2761 and completely replace all DNS-served information. Note that a 2762 verifier MAY ignore signatures that come from an unlikely domain 2763 such as ".com", as discussed in Section 7.1.1. 2765 9.14. Attacks Involving Addition of Header Fields 2767 Many email implementations do not enforce [RFC5322] with strictness. 2768 As discussed in Section 6.3 DKIM processing is predicated on a valid 2769 mail message as its input. However, DKIM implementers should be 2770 aware of the potential effect of having loose enforcement by email 2771 components interacting with DKIM modules. 2773 For example, a message with multiple From: header fields violates 2774 Section 3.6 of [RFC5322]. With the intent of providing a better user 2775 experience, many agents tolerate these violations and deliver the 2776 message anyway. An MUA then might elect to render to the user the 2777 value of the last, or "top", From: field. This may also be done 2778 simply out of the expectation that there is only one, where a "find 2779 first" algorithm would have the same result. Such code in an MUA can 2780 be exploited to fool the user if it is also known that the other 2781 From: field is the one checked by arriving message filters. Such is 2782 the case with DKIM; although the From: field must be signed, a 2783 malformed message bearing more than one From: field might only have 2784 the first ("bottom") one signed, in an attempt to show the message 2785 with some "DKIM passed" annotation while also rendering the From: 2786 field that was not authenticated. (This can also be taken as a 2787 demonstration that DKIM is not designed to support author 2788 validation.) 2790 To resist this specific attack the signed header field list can 2791 include an additional reference for each field that was present at 2792 signing. For example, a proper message with one From: field could be 2793 signed using "h=From:From:..." Due to the way header fields are 2794 canonicalized for input to the hash function, the extra field 2795 references will prevent instances of the cited fields from being 2796 added after signing, as doing so would render the signature invalid. 2798 The From: field is used above to illustrate this issue, but it is 2799 only one of several fields that Section 3.6 of [RFC5322] constrains 2800 in this way. In reality any agent that forgives malformations, or is 2801 careless about identifying which parts of a message were 2802 authenticated, is open to exploitation. 2804 9.15. Malformed Inputs 2806 DKIM allows additional header fields to be added to a signed message 2807 without breaking the signature. This tolerance can be abused, for 2808 example in a replay attack. The attack is accomplished by creating 2809 additional instances of header fields to an already signed message, 2810 without breaking the signature. These then might be displayed to the 2811 end user or are used as filtering input. Salient fields could 2812 include From: and Subject:, 2814 The resulting message violates section 3.6 of [RFC5322]. The way 2815 such input will be handled and displayed by an MUA is unpredictable, 2816 but in some cases it might display the newly added header fields 2817 rather than those that are part of the originally signed message 2818 alongside some "valid DKIM signature" annotation. This might allow 2819 an attacker to replay a previously sent, signed message with a 2820 different Subject:, From: or To: field. 2822 However, [RFC5322] also tolerates obsolete message syntax, which does 2823 allow things like multiple From: fields on messages. The 2824 implementation of DKIM thus potentially creates a more stringent 2825 layer of expectation regarding the meaning of an identity, while that 2826 additional meaning is either obscured from or incorrectly presented 2827 to an end user in this context. 2829 Implementers need to consider this possibility when designing their 2830 input handling functions. Outright rejection of messages that 2831 violate Section 3.6 of [RFC5322] will interfere with delivery of 2832 legacy formats. Instead, given such input, a signing module could 2833 return an error rather than generate a signature; a verifying module 2834 might return a syntax error code or arrange not to return a positive 2835 result even if the signature technically validates. 2837 Senders concerned that their messages might be particularly 2838 vulnerable to this sort of attack and who do not wish to rely on 2839 receiver filtering of invalid messages can ensure that adding 2840 additional header fields will break the DKIM signature by including 2841 two copies of the header fields about which they are concerned in the 2842 signature (e.g. "h= ... from:from:to:to:subject:subject ..."). See 2843 Sections 3.5 and 5.4 for further discussion of this mechanism. 2845 Specific validity rules for all known header fields can be gleaned 2846 from the IANA "Permanent Header Field Registry" and the reference 2847 documents it identifies. 2849 10. References 2851 10.1. Normative References 2853 [FIPS-180-2-2002] 2854 U.S. Department of Commerce, "Secure Hash Standard", FIPS 2855 PUB 180-2, August 2002. 2857 [ITU-X660-1997] 2858 "Information Technology - ASN.1 encoding rules: 2859 Specification of Basic Encoding Rules (BER), Canonical 2860 Encoding Rules (CER) and Distinguished Encoding Rules 2861 (DER)", 1997. 2863 [RFC1034] Mockapetris, P., "DOMAIN NAMES - CONCEPTS AND FACILITIES", 2864 RFC 1034, November 1987. 2866 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2867 Extensions (MIME) Part One: Format of Internet Message 2868 Bodies", RFC 2045, November 1996. 2870 [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2871 Extensions (MIME) Part Five: Conformance Criteria and 2872 Examples", RFC 2049, November 1996. 2874 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2875 Requirement Levels", BCP 14, RFC 2119, March 1997. 2877 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 2878 Standards (PKCS) #1: RSA Cryptography Specifications 2879 Version 2.1", RFC 3447, February 2003. 2881 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 2882 Specifications: ABNF", RFC 5234, January 2008. 2884 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 2885 October 2008. 2887 [RFC5322] Resnick, P., "Internet Message Format", RFC 5322, 2888 October 2008. 2890 [RFC5598] Crocker, D., "Internet Mail Architecture", RFC 5598, 2891 July 2009. 2893 [RFC5890] Klensin, J., "Internationalizing Domain Names in 2894 Applications (IDNA): Definitions and Document Framework", 2895 RFC 5890, August 2010. 2897 10.2. Informative References 2899 [BONEH03] "Remote Timing Attacks are Practical", Proceedings 12th 2900 USENIX Security Symposium, 2003. 2902 [RFC1847] Galvin, J., Murphy, S., Crocker, S., and N. Freed, 2903 "Security Multiparts for MIME: Multipart/Signed and 2904 Multipart/Encrypted", RFC 1847, October 1995. 2906 [RFC3766] Orman, H. and P. Hoffman, "Determining Strengths For 2907 Public Keys Used For Exchanging Symmetric Keys", BCP 86, 2908 RFC 3766, April 2004. 2910 [RFC3833] Atkins, D. and R. Austein, "Threat Analysis of the Domain 2911 Name System (DNS)", RFC 3833, August 2004. 2913 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 2914 Procedures for Message Header Fields", BCP 90, RFC 3864, 2915 September 2004. 2917 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. 2919 Rose, "DNS Security Introduction and Requirements", 2920 RFC 4033, March 2005. 2922 [RFC4409] Gellens, R. and J. Klensin, "Message Submission for Mail", 2923 RFC 4409, April 2006. 2925 [RFC4686] Fenton, J., "Analysis of Threats Motivating DomainKeys 2926 Identified Mail (DKIM)", RFC 4686, September 2006. 2928 [RFC4870] Delany, M., "Domain-Based Email Authentication Using 2929 Public Keys Advertised in the DNS (DomainKeys)", RFC 4870, 2930 May 2007. 2932 [RFC4871] Allman, E., Callas, J., Delany, M., Libbey, M., Fenton, 2933 J., and M. Thomas, "DomainKeys Identified Mail (DKIM) 2934 Signatures", RFC 4871, May 2007. 2936 [RFC4880] Callas, J., Donnerhacke, L., Finney, H., and R. Thayer, 2937 "OpenPGP Message Format", RFC 4880, November 2007. 2939 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2940 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2941 May 2008. 2943 [RFC5451] Kucherawy, M., "Message Header Field for Indicating 2944 Message Authentication Status", RFC 5451, April 2009. 2946 [RFC5751] Ramsdell, B., "Secure/Multipurpose Internet Mail 2947 Extensions (S/MIME) Version 3.1 Message Specification", 2948 RFC 5751, January 2010. 2950 Appendix A. Example of Use (INFORMATIVE) 2952 This section shows the complete flow of an email from submission to 2953 final delivery, demonstrating how the various components fit 2954 together. The key used in this example is shown in Appendix C. 2956 A.1. The User Composes an Email 2957 From: Joe SixPack 2958 To: Suzie Q 2959 Subject: Is dinner ready? 2960 Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) 2961 Message-ID: <;20030712040037.46341.5F8J@football.example.com> 2963 Hi. 2965 We lost the game. Are you hungry yet? 2967 Joe. 2969 Figure 1: The User Composes an Email 2971 A.2. The Email is Signed 2973 This email is signed by the example.com outbound email server and now 2974 looks like this: 2975 DKIM-Signature: v=1; a=rsa-sha256; s=brisbane; d=example.com; 2976 c=simple/simple; q=dns/txt; i=joe@football.example.com; 2977 h=Received : From : To : Subject : Date : Message-ID; 2978 bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; 2979 b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk4yAUoqOB 2980 4nujc7YopdG5dWLSdNg6xNAZpOPr+kHxt1IrE+NahM6L/LbvaHut 2981 KVdkLLkpVaVVQPzeRDI009SO2Il5Lu7rDNH6mZckBdrIx0orEtZV 2982 4bmp/YzhwvcubU4=; 2983 Received: from client1.football.example.com [192.0.2.1] 2984 by submitserver.example.com with SUBMISSION; 2985 Fri, 11 Jul 2003 21:01:54 -0700 (PDT) 2986 From: Joe SixPack 2987 To: Suzie Q 2988 Subject: Is dinner ready? 2989 Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) 2990 Message-ID: <20030712040037.46341.5F8J@football.example.com> 2992 Hi. 2994 We lost the game. Are you hungry yet? 2996 Joe. 2998 The Email is Signed 3000 The signing email server requires access to the private key 3001 associated with the "brisbane" selector to generate this signature. 3003 A.3. The Email Signature is Verified 3005 The signature is normally verified by an inbound SMTP server or 3006 possibly the final delivery agent. However, intervening MTAs can 3007 also perform this verification if they choose to do so. The 3008 verification process uses the domain "example.com" extracted from the 3009 "d=" tag and the selector "brisbane" from the "s=" tag in the DKIM- 3010 Signature header field to form the DNS DKIM query for: 3011 brisbane._domainkey.example.com 3013 Signature verification starts with the physically last Received 3014 header field, the From header field, and so forth, in the order 3015 listed in the "h=" tag. Verification follows with a single CRLF 3016 followed by the body (starting with "Hi."). The email is canonically 3017 prepared for verifying with the "simple" method. The result of the 3018 query and subsequent verification of the signature is stored (in this 3019 example) in the X-Authentication-Results header field line. After 3020 successful verification, the email looks like this: 3021 X-Authentication-Results: shopping.example.net 3022 header.from=joe@football.example.com; dkim=pass 3023 Received: from mout23.football.example.com (192.168.1.1) 3024 by shopping.example.net with SMTP; 3025 Fri, 11 Jul 2003 21:01:59 -0700 (PDT) 3026 DKIM-Signature: v=1; a=rsa-sha256; s=brisbane; d=example.com; 3027 c=simple/simple; q=dns/txt; i=joe@football.example.com; 3028 h=Received : From : To : Subject : Date : Message-ID; 3029 bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; 3030 b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk4yAUoqOB 3031 4nujc7YopdG5dWLSdNg6xNAZpOPr+kHxt1IrE+NahM6L/LbvaHut 3032 KVdkLLkpVaVVQPzeRDI009SO2Il5Lu7rDNH6mZckBdrIx0orEtZV 3033 4bmp/YzhwvcubU4=; 3034 Received: from client1.football.example.com [192.0.2.1] 3035 by submitserver.example.com with SUBMISSION; 3036 Fri, 11 Jul 2003 21:01:54 -0700 (PDT) 3037 From: Joe SixPack 3038 To: Suzie Q 3039 Subject: Is dinner ready? 3040 Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) 3041 Message-ID: <20030712040037.46341.5F8J@football.example.com> 3043 Hi. 3045 We lost the game. Are you hungry yet? 3047 Joe. 3049 Successful verification 3051 Appendix B. Usage Examples (INFORMATIVE) 3053 DKIM signing and validating can be used in different ways, for 3054 different operational scenarios. This Appendix discusses some common 3055 examples. 3057 NOTE: Descriptions in this Appendix are for informational purposes 3058 only. They describe various ways that DKIM can be used, given 3059 particular constraints and needs. In no case are these examples 3060 intended to be taken as providing explanation or guidance 3061 concerning DKIM specification details, when creating an 3062 implementation. 3064 B.1. Alternate Submission Scenarios 3066 In the most simple scenario, a user's MUA, MSA, and Internet 3067 (boundary) MTA are all within the same administrative environment, 3068 using the same domain name. Therefore, all of the components 3069 involved in submission and initial transfer are related. However, it 3070 is common for two or more of the components to be under independent 3071 administrative control. This creates challenges for choosing and 3072 administering the domain name to use for signing, and for its 3073 relationship to common email identity header fields. 3075 B.1.1. Delegated Business Functions 3077 Some organizations assign specific business functions to discrete 3078 groups, inside or outside the organization. The goal, then, is to 3079 authorize that group to sign some mail, but to constrain what 3080 signatures they can generate. DKIM selectors (the "s=" signature 3081 tag) facilitate this kind of restricted authorization. Examples of 3082 these outsourced business functions are legitimate email marketing 3083 providers and corporate benefits providers. 3085 Here, the delegated group needs to be able to send messages that are 3086 signed, using the email domain of the client company. At the same 3087 time, the client often is reluctant to register a key for the 3088 provider that grants the ability to send messages for arbitrary 3089 addresses in the domain. 3091 There are multiple ways to administer these usage scenarios. In one 3092 case, the client organization provides all of the public query 3093 service (for example, DNS) administration, and in another it uses DNS 3094 delegation to enable all ongoing administration of the DKIM key 3095 record by the delegated group. 3097 If the client organization retains responsibility for all of the DNS 3098 administration, the outsourcing company can generate a key pair, 3099 supplying the public key to the client company, which then registers 3100 it in the query service, using a unique selector. The client company 3101 retains control over the use of the delegated key because it retains 3102 the ability to revoke the key at any time. 3104 If the client wants the delegated group to do the DNS administration, 3105 it can have the domain name that is specified with the selector point 3106 to the provider's DNS server. The provider then creates and 3107 maintains all of the DKIM signature information for that selector. 3108 Hence, the client cannot provide constraints on the Local-part of 3109 addresses that get signed, but it can revoke the provider's signing 3110 rights by removing the DNS delegation record. 3112 B.1.2. PDAs and Similar Devices 3114 PDAs demonstrate the need for using multiple keys per domain. 3115 Suppose that John Doe wanted to be able to send messages using his 3116 corporate email address, jdoe@example.com, and his email device did 3117 not have the ability to make a Virtual Private Network (VPN) 3118 connection to the corporate network, either because the device is 3119 limited or because there are restrictions enforced by his Internet 3120 access provider. If the device was equipped with a private key 3121 registered for jdoe@example.com by the administrator of the 3122 example.com domain, and appropriate software to sign messages, John 3123 could sign the message on the device itself before transmission 3124 through the outgoing network of the access service provider. 3126 B.1.3. Roaming Users 3128 Roaming users often find themselves in circumstances where it is 3129 convenient or necessary to use an SMTP server other than their home 3130 server; examples are conferences and many hotels. In such 3131 circumstances, a signature that is added by the submission service 3132 will use an identity that is different from the user's home system. 3134 Ideally, roaming users would connect back to their home server using 3135 either a VPN or a SUBMISSION server running with SMTP AUTHentication 3136 on port 587. If the signing can be performed on the roaming user's 3137 laptop, then they can sign before submission, although the risk of 3138 further modification is high. If neither of these are possible, 3139 these roaming users will not be able to send mail signed using their 3140 own domain key. 3142 B.1.4. Independent (Kiosk) Message Submission 3144 Stand-alone services, such as walk-up kiosks and web-based 3145 information services, have no enduring email service relationship 3146 with the user, but users occasionally request that mail be sent on 3147 their behalf. For example, a website providing news often allows the 3148 reader to forward a copy of the article to a friend. This is 3149 typically done using the reader's own email address, to indicate who 3150 the author is. This is sometimes referred to as the "Evite problem", 3151 named after the website of the same name that allows a user to send 3152 invitations to friends. 3154 A common way this is handled is to continue to put the reader's email 3155 address in the From header field of the message, but put an address 3156 owned by the email posting site into the Sender header field. The 3157 posting site can then sign the message, using the domain that is in 3158 the Sender field. This provides useful information to the receiving 3159 email site, which is able to correlate the signing domain with the 3160 initial submission email role. 3162 Receiving sites often wish to provide their end users with 3163 information about mail that is mediated in this fashion. Although 3164 the real efficacy of different approaches is a subject for human 3165 factors usability research, one technique that is used is for the 3166 verifying system to rewrite the From header field, to indicate the 3167 address that was verified. For example: From: John Doe via 3168 news@news-site.com . (Note that such rewriting 3169 will break a signature, unless it is done after the verification pass 3170 is complete.) 3172 B.2. Alternate Delivery Scenarios 3174 Email is often received at a mailbox that has an address different 3175 from the one used during initial submission. In these cases, an 3176 intermediary mechanism operates at the address originally used and it 3177 then passes the message on to the final destination. This mediation 3178 process presents some challenges for DKIM signatures. 3180 B.2.1. Affinity Addresses 3182 "Affinity addresses" allow a user to have an email address that 3183 remains stable, even as the user moves among different email 3184 providers. They are typically associated with college alumni 3185 associations, professional organizations, and recreational 3186 organizations with which they expect to have a long-term 3187 relationship. These domains usually provide forwarding of incoming 3188 email, and they often have an associated Web application that 3189 authenticates the user and allows the forwarding address to be 3190 changed. However, these services usually depend on users sending 3191 outgoing messages through their own service providers' MTAs. Hence, 3192 mail that is signed with the domain of the affinity address is not 3193 signed by an entity that is administered by the organization owning 3194 that domain. 3196 With DKIM, affinity domains could use the Web application to allow 3197 users to register per-user keys to be used to sign messages on behalf 3198 of their affinity address. The user would take away the secret half 3199 of the key pair for signing, and the affinity domain would publish 3200 the public half in DNS for access by verifiers. 3202 This is another application that takes advantage of user-level 3203 keying, and domains used for affinity addresses would typically have 3204 a very large number of user-level keys. Alternatively, the affinity 3205 domain could handle outgoing mail, operating a mail submission agent 3206 that authenticates users before accepting and signing messages for 3207 them. This is of course dependent on the user's service provider not 3208 blocking the relevant TCP ports used for mail submission. 3210 B.2.2. Simple Address Aliasing (.forward) 3212 In some cases a recipient is allowed to configure an email address to 3213 cause automatic redirection of email messages from the original 3214 address to another, such as through the use of a Unix .forward file. 3215 In this case, messages are typically redirected by the mail handling 3216 service of the recipient's domain, without modification, except for 3217 the addition of a Received header field to the message and a change 3218 in the envelope recipient address. In this case, the recipient at 3219 the final address' mailbox is likely to be able to verify the 3220 original signature since the signed content has not changed, and DKIM 3221 is able to validate the message signature. 3223 B.2.3. Mailing Lists and Re-Posters 3225 There is a wide range of behaviors in services that take delivery of 3226 a message and then resubmit it. A primary example is with mailing 3227 lists (collectively called "forwarders" below), ranging from those 3228 that make no modification to the message itself, other than to add a 3229 Received header field and change the envelope information, to those 3230 that add header fields, change the Subject header field, add content 3231 to the body (typically at the end), or reformat the body in some 3232 manner. The simple ones produce messages that are quite similar to 3233 the automated alias services. More elaborate systems essentially 3234 create a new message. 3236 A Forwarder that does not modify the body or signed header fields of 3237 a message is likely to maintain the validity of the existing 3238 signature. It also could choose to add its own signature to the 3239 message. 3241 Forwarders which modify a message in a way that could make an 3242 existing signature invalid are particularly good candidates for 3243 adding their own signatures (e.g., mailing-list-name@example.net). 3245 Since (re-)signing is taking responsibility for the content of the 3246 message, these signing forwarders are likely to be selective, and 3247 forward or re-sign a message only if it is received with a valid 3248 signature or if they have some other basis for knowing that the 3249 message is not spoofed. 3251 A common practice among systems that are primarily redistributors of 3252 mail is to add a Sender header field to the message, to identify the 3253 address being used to sign the message. This practice will remove 3254 any preexisting Sender header field as required by [RFC5322]. The 3255 forwarder applies a new DKIM-Signature header field with the 3256 signature, public key, and related information of the forwarder. 3258 Appendix C. Creating a Public Key (INFORMATIVE) 3260 The default signature is an RSA signed SHA256 digest of the complete 3261 email. For ease of explanation, the openssl command is used to 3262 describe the mechanism by which keys and signatures are managed. One 3263 way to generate a 1024-bit, unencrypted private key suitable for DKIM 3264 is to use openssl like this: 3265 $ openssl genrsa -out rsa.private 1024 3266 For increased security, the "-passin" parameter can also be added to 3267 encrypt the private key. Use of this parameter will require entering 3268 a password for several of the following steps. Servers may prefer to 3269 use hardware cryptographic support. 3271 The "genrsa" step results in the file rsa.private containing the key 3272 information similar to this: 3273 -----BEGIN RSA PRIVATE KEY----- 3274 MIICXwIBAAKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYtIxN2SnFC 3275 jxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/RtdC2UzJ1lWT947qR+Rcac2gb 3276 to/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB 3277 AoGBALmn+XwWk7akvkUlqb+dOxyLB9i5VBVfje89Teolwc9YJT36BGN/l4e0l6QX 3278 /1//6DWUTB3KI6wFcm7TWJcxbS0tcKZX7FsJvUz1SbQnkS54DJck1EZO/BLa5ckJ 3279 gAYIaqlA9C0ZwM6i58lLlPadX/rtHb7pWzeNcZHjKrjM461ZAkEA+itss2nRlmyO 3280 n1/5yDyCluST4dQfO8kAB3toSEVc7DeFeDhnC1mZdjASZNvdHS4gbLIA1hUGEF9m 3281 3hKsGUMMPwJBAPW5v/U+AWTADFCS22t72NUurgzeAbzb1HWMqO4y4+9Hpjk5wvL/ 3282 eVYizyuce3/fGke7aRYw/ADKygMJdW8H/OcCQQDz5OQb4j2QDpPZc0Nc4QlbvMsj 3283 7p7otWRO5xRa6SzXqqV3+F0VpqvDmshEBkoCydaYwc2o6WQ5EBmExeV8124XAkEA 3284 qZzGsIxVP+sEVRWZmW6KNFSdVUpk3qzK0Tz/WjQMe5z0UunY9Ax9/4PVhp/j61bf 3285 eAYXunajbBSOLlx4D+TunwJBANkPI5S9iylsbLs6NkaMHV6k5ioHBBmgCak95JGX 3286 GMot/L2x0IYyMLAz6oLWh2hm7zwtb0CgOrPo1ke44hFYnfc= 3287 -----END RSA PRIVATE KEY----- 3288 To extract the public-key component from the private key, use openssl 3289 like this: 3290 $ openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM 3292 This results in the file rsa.public containing the key information 3293 similar to this: 3294 -----BEGIN PUBLIC KEY----- 3295 MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkM 3296 oGeLnQg1fWn7/zYtIxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/R 3297 tdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToI 3298 MmPSPDdQPNUYckcQ2QIDAQAB 3299 -----END PUBLIC KEY----- 3301 This public-key data (without the BEGIN and END tags) is placed in 3302 the DNS: 3303 brisbane IN TXT ("v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ" 3304 "KBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYt" 3305 "IxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v" 3306 "/RtdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhi" 3307 "tdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB") 3309 C.1. Compatibility with DomainKeys Key Records 3311 DKIM key records were designed to be backwards-compatible in many 3312 cases with key records used by DomainKeys [RFC4870] (sometimes 3313 referred to as "selector records" in the DomainKeys context). One 3314 area of incompatibility warrants particular attention. The "g=" tag/ 3315 value may be used in DomainKeys and [RFC4871] key records to provide 3316 finer granularity of the validity of the key record to a specific 3317 local-part. A null "g=" value in DomainKeys is valid for all 3318 addresses in the domain. This differs from the usage in the original 3319 DKIM specification, where a null "g=" value is not valid for any 3320 address. In particular, the example public key record in Section 3321 3.2.3 of [RFC4870] with DKIM. 3323 Although the "g=" tag has been deprecated in this version of the DKIM 3324 specification, signers are advised not to include the "g=" tag in key 3325 records because some [RFC4871]-compliant verifiers will be in use for 3326 a considerable period to come. 3328 Appendix D. MUA Considerations 3330 When a DKIM signature is verified, the processing system sometimes 3331 makes the result available to the recipient user's MUA. How to 3332 present this information to the user in a way that helps them is a 3333 matter of continuing human factors usability research. The tendency 3334 is to have the MUA highlight the SDID, in an attempt to show the user 3335 the identity that is claiming responsibility for the message. An MUA 3336 might do this with visual cues such as graphics, or it might include 3337 the address in an alternate view, or it might even rewrite the 3338 original From address using the verified information. Some MUAs 3339 might indicate which header fields were protected by the validated 3340 DKIM signature. This could be done with a positive indication on the 3341 signed header fields, with a negative indication on the unsigned 3342 header fields, by visually hiding the unsigned header fields, or some 3343 combination of these. If an MUA uses visual indications for signed 3344 header fields, the MUA probably needs to be careful not to display 3345 unsigned header fields in a way that might be construed by the end 3346 user as having been signed. If the message has an l= tag whose value 3347 does not extend to the end of the message, the MUA might also hide or 3348 mark the portion of the message body that was not signed. 3350 The aforementioned information is not intended to be exhaustive. The 3351 MUA may choose to highlight, accentuate, hide, or otherwise display 3352 any other information that may, in the opinion of the MUA author, be 3353 deemed important to the end user. 3355 Appendix E. Acknowledgements 3357 The previous IETF version of DKIM [RFC4871] was edited by: Eric 3358 Allman, Jon Callas, Mark Delany, Miles Libbey, Jim Fenton and Michael 3359 Thomas. 3361 That specification was the result of an extended, collaborative 3362 effort, including participation by: Russ Allbery, Edwin Aoki, Claus 3363 Assmann, Steve Atkins, Rob Austein, Fred Baker, Mark Baugher, Steve 3364 Bellovin, Nathaniel Borenstein, Dave Crocker, Michael Cudahy, Dennis 3365 Dayman, Jutta Degener, Frank Ellermann, Patrik Faeltstroem, Mark 3366 Fanto, Stephen Farrell, Duncan Findlay, Elliot Gillum, Olafur 3367 Gu[eth]mundsson, Phillip Hallam-Baker, Tony Hansen, Sam Hartman, 3368 Arvel Hathcock, Amir Herzberg, Paul Hoffman, Russ Housley, Craig 3369 Hughes, Cullen Jennings, Don Johnsen, Harry Katz, Murray S. 3370 Kucherawy, Barry Leiba, John Levine, Charles Lindsey, Simon 3371 Longsdale, David Margrave, Justin Mason, David Mayne, Thierry Moreau, 3372 Steve Murphy, Russell Nelson, Dave Oran, Doug Otis, Shamim Pirzada, 3373 Juan Altmayer Pizzorno, Sanjay Pol, Blake Ramsdell, Christian Renaud, 3374 Scott Renfro, Neil Rerup, Eric Rescorla, Dave Rossetti, Hector 3375 Santos, Jim Schaad, the Spamhaus.org team, Malte S. Stretz, Robert 3376 Sanders, Rand Wacker, Sam Weiler, and Dan Wing. 3378 The earlier DomainKeys was a primary source from which DKIM was 3379 derived. Further information about DomainKeys is at [RFC4870]. 3381 Authors' Addresses 3383 D. Crocker (editor) 3384 Brandenburg InternetWorking 3385 675 Spruce Dr. 3386 Sunnyvale 3387 USA 3389 Phone: +1.408.246.8253 3390 Email: dcrocker@bbiw.net 3391 URI: http://bbiw.net 3393 Tony Hansen (editor) 3394 AT&T Laboratories 3395 200 Laurel Ave. South 3396 Middletown, NJ 07748 3397 USA 3399 Email: tony+dkimov@maillennium.att.com 3401 M. Kucherawy (editor) 3402 Cloudmark 3403 128 King St., 2nd Floor 3404 San Francisco, CA 94107 3405 USA 3407 Email: msk@cloudmark.com