idnits 2.17.1 draft-ietf-lamps-cms-update-alg-id-protect-00.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 updates RFC5652, but the abstract doesn't seem to directly say this. It does mention RFC5652 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 -- The document date (January 21, 2020) is 1550 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group R. Housley 3 Internet-Draft Vigil Security 4 Updates: 5652 (if approved) January 21, 2020 5 Intended status: Standards Track 6 Expires: July 24, 2020 8 Update to the Cryptographic Message Syntax (CMS) for Algorithm 9 Identifier Protection 10 draft-ietf-lamps-cms-update-alg-id-protect-00 12 Abstract 14 This document updates the Cryptographic Message Syntax (CMS) 15 specified in RFC 5652 to ensure that algorithm identifiers are 16 adequately protected. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at https://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on July 24, 2020. 35 Copyright Notice 37 Copyright (c) 2020 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (https://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 53 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 3. Require use the same hash algorithm . . . . . . . . . . . . . 3 55 3.1. RFC 5652, Section 5.3 . . . . . . . . . . . . . . . . . . 3 56 3.2. RFC 5652, Section 5.4 . . . . . . . . . . . . . . . . . . 4 57 3.3. RFC 5652, Section 5.6 . . . . . . . . . . . . . . . . . . 4 58 3.4. Backward Compatibility Considerations . . . . . . . . . . 5 59 3.5. Timestamp Compatibility Considerations . . . . . . . . . 5 60 4. Recommend inclusion of the CMSAlgorithmProtection attribute . 5 61 4.1. RFC 5652, Section 14 . . . . . . . . . . . . . . . . . . 6 62 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 63 6. Security Considerations . . . . . . . . . . . . . . . . . . . 6 64 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6 65 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 66 8.1. Normative References . . . . . . . . . . . . . . . . . . 6 67 8.2. Informative References . . . . . . . . . . . . . . . . . 7 68 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 70 1. Introduction 72 This document updates the Cryptographic Message Syntax (CMS) 73 [RFC5652] to ensure that algorithm identifiers are adequately 74 protected. 76 The CMS Signed-data Content Type [RFC5652], unlike X.509 certificates 77 [RFC5280], can be vulnerable to algorithm substitution attacks. In 78 an algorithm substitution attack, the attacker changes either the 79 algorithm identifier or the parameters associated with the algorithm 80 identifier to change the verification process used by the recipient. 81 The X.509 certificate structure protects the algorithm identifier and 82 the associate parameters by signing them. 84 In an algorithm substitution attack, the attacker looks for a 85 different algorithm that produces the same result as the algorithm 86 used by the originator. As an example, if the signer of a message 87 used SHA-256 [SHS] as the digest algorithm to hash the message 88 content, then the attacker looks for a weaker hash algorithm that 89 produces a result that is of the same length. The attacker's goal is 90 to find a different message that results in the same hash value, 91 which is commonly called a collision. Today, there are many hash 92 functions that produce 256-bit results. One of them may be found to 93 be weak in the future. 95 Further, when a digest algorithm produces a larger result than is 96 needed by a digital signature algorithm, the digest value is reduced 97 to the size needed by the signature algorithm. This can be done both 98 by truncation and modulo operations, with the simplest being 99 straightforward truncation. In this situation, the attacker needs to 100 find a collision with the reduced digest value. As an example, if 101 the message signer uses SHA-512 [SHS] as the digest algorithm and 102 ECDSA with the P-256 curve [DSS] as the signature algorithm, then the 103 attacker needs to find a collision with the first half of the digest. 105 Similar attacks can be mounted against parameterized algorithm 106 identifiers. When looking at randomized hash functions, such as the 107 example in [RFC6210], the algorithm identifier parameter includes a 108 random value that can be manipulated by an attacker looking for 109 collisions. Some other algorithm identifiers include complex 110 parameter structures, and each value provides another opportunity for 111 manipulation by an attacker. 113 This document makes two updates to CMS to provide similar protection 114 for the algorithm identifier. First, it mandates a convention 115 followed by many implementations by requiring the originator to use 116 the same hash algorithm to compute the digest of the message content 117 and the digest of signed attributes. Second, it recommends that the 118 originator include the CMSAlgorithmProtection attribute [RFC6211]. 120 2. Terminology 122 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 123 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 124 "OPTIONAL" in this document are to be interpreted as described in 125 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 126 capitals, as shown here. 128 3. Require use the same hash algorithm 130 This section updates [RFC5652] to require the originator to use the 131 same hash algorithm to compute the digest of the message content and 132 the digest of signed attributes. 134 3.1. RFC 5652, Section 5.3 136 Change the paragraph describing the digestAlgorithm as follows: 138 OLD: 140 digestAlgorithm identifies the message digest algorithm, and any 141 associated parameters, used by the signer. The message digest is 142 computed on either the content being signed or the content 143 together with the signed attributes using the process described in 144 Section 5.4. The message digest algorithm SHOULD be among those 145 listed in the digestAlgorithms field of the associated SignerData. 147 Implementations MAY fail to validate signatures that use a digest 148 algorithm that is not included in the SignedData digestAlgorithms 149 set. 151 NEW: 153 digestAlgorithm identifies the message digest algorithm, and any 154 associated parameters, used by the signer. The message digest is 155 computed on either the content being signed or the content 156 together with the signed attributes using the process described in 157 Section 5.4. The message digest algorithm SHOULD be among those 158 listed in the digestAlgorithms field of the associated SignerData. 159 If signedAttrs are present in the SignerInfo, then the same digest 160 algorithm MUST be used to compute the digest of the SignedData 161 encapContentInfo eContent, which is carried in the message-digest 162 attribute, and to compute the digest of the DER-encoded SET OF 163 signed attributes, which is passed to the signature algorithm. 164 Implementations MAY fail to validate signatures that use a digest 165 algorithm that is not included in the SignedData digestAlgorithms 166 set. 168 3.2. RFC 5652, Section 5.4 170 Add the following paragraph as the second paragraph in Section 5.4: 172 ADD: 174 When the signedAttrs field is present, the same digest algorithm 175 MUST be used to compute the digest of the the encapContentInfo 176 eContent OCTET STRING, which is carried in the message-digest 177 attribute, and the collection of attributes that are signed. 179 3.3. RFC 5652, Section 5.6 181 Change the paragraph discussing the signedAttributes as follows: 183 OLD: 185 The recipient MUST NOT rely on any message digest values computed 186 by the originator. If the SignedData signerInfo includes 187 signedAttributes, then the content message digest MUST be 188 calculated as described in Section 5.4. For the signature to be 189 valid, the message digest value calculated by the recipient MUST 190 be the same as the value of the messageDigest attribute included 191 in the signedAttributes of the SignedData signerInfo. 193 NEW: 195 The recipient MUST NOT rely on any message digest values computed 196 by the originator. If the SignedData signerInfo includes 197 signedAttributes, then the content message digest MUST be 198 calculated as described in Section 5.4, using the same digest 199 algorithm to compute the digest of the the encapContentInfo 200 eContent OCTET STRING and the message-digest attribute. For the 201 signature to be valid, the message digest value calculated by the 202 recipient MUST be the same as the value of the messageDigest 203 attribute included in the signedAttributes of the SignedData 204 signerInfo. 206 3.4. Backward Compatibility Considerations 208 The new requirement introduced above might lead to compatibility with 209 an implementation that allowed different digest algorithms to be used 210 to compute the digest of the message content and the digest of signed 211 attributes. The signatures produced by such an implementation when 212 two different digest algorithms are used will be considered invalid 213 by an implementation that follows this specification. However, most, 214 if not all, implementations already require the originator to use the 215 same digest algorithm for both operations. 217 READER: 219 If you have an implementation that allows different digest 220 algorithms to be used to compute the digest of the message content 221 and the digest of signed attributes, please tell us on the 222 spasm@ietf.org mail list. 224 3.5. Timestamp Compatibility Considerations 226 The new requirement introduced above might lead to compatibility 227 issues for timestamping systems when the originator does not wish to 228 share the message content with the Time Stamp Authority (TSA) 229 [RFC3161]. In this situation, the originator sends a TimeStampReq to 230 the TSA that includes a MessageImprint, which consists of a digest 231 algorithm identifier and a digest value, then the TSA uses the digest 232 in the MessageImprint. As a result, the signature algorithm used by 233 the TSA needs to be compatible with the digest algorithm selected by 234 the originator for the MessageImprint. 236 4. Recommend inclusion of the CMSAlgorithmProtection attribute 238 This section updates [RFC5652] to recommend that the originator 239 include the CMSAlgorithmProtection attribute [RFC6211] whenever 240 signed attributes or authenticated attributes are present. 242 4.1. RFC 5652, Section 14 244 Add the following paragraph as the eighth paragraph in Section 14: 246 ADD: 248 While no known algorithm substitution attacks are known at this 249 time, the inclusion of the algorithm identifiers used by the 250 originator as a signed attribute or an authenticated attribute 251 makes such an attack significantly more difficult. Therefore, the 252 originator of a Signed-data content type that includes signed 253 attributes SHOULD include the CMSAlgorithmProtection attribute 254 [RFC6211] as one of the signed attributes. Likewise, the 255 originator of an Authenticated-data content type that includes 256 authenticated attributes SHOULD include the CMSAlgorithmProtection 257 attribute [RFC6211] as one of the authenticated attributes. 259 5. IANA Considerations 261 This document makes no requests of the IANA. 263 6. Security Considerations 265 The security considerations of [RFC5652] are updated ensure that 266 algorithm identifiers are adequately protected, which makes algorithm 267 substitution attacks significantly more difficult. 269 The CMSAlgorithmProtection attribute [RFC6211] offers protection the 270 algorithm identifiers used in the signed-data and authenticated-data 271 content types. There is not currently protection mechanism for the 272 algorithm identifiers used in the enveloped-data, digested-data, or 273 encrypted-data content types. Likewise there us not currently 274 protection mechanism for the algorithm identifiers used in the 275 authenticated-enveloped-data content type defined in [RFC5083]. 277 7. Acknowledgements 279 Many thanks to Jim Schaad and Peter Gutmann; without knowing it, they 280 motivated me to write this document. 282 8. References 284 8.1. Normative References 286 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 287 Requirement Levels", BCP 14, RFC 2119, 288 DOI 10.17487/RFC2119, March 1997, 289 . 291 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 292 RFC 5652, DOI 10.17487/RFC5652, September 2009, 293 . 295 [RFC6211] Schaad, J., "Cryptographic Message Syntax (CMS) Algorithm 296 Identifier Protection Attribute", RFC 6211, 297 DOI 10.17487/RFC6211, April 2011, 298 . 300 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 301 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 302 May 2017, . 304 8.2. Informative References 306 [DSS] National Institute of Standards and Technology (NIST), 307 "Digital Signature Standard (DSS)", FIPS 308 Publication 186-3, June 2009. 310 [RFC3161] Adams, C., Cain, P., Pinkas, D., and R. Zuccherato, 311 "Internet X.509 Public Key Infrastructure Time-Stamp 312 Protocol (TSP)", RFC 3161, DOI 10.17487/RFC3161, August 313 2001, . 315 [RFC5083] Housley, R., "Cryptographic Message Syntax (CMS) 316 Authenticated-Enveloped-Data Content Type", RFC 5083, 317 DOI 10.17487/RFC5083, November 2007, 318 . 320 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 321 Housley, R., and W. Polk, "Internet X.509 Public Key 322 Infrastructure Certificate and Certificate Revocation List 323 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 324 . 326 [RFC6210] Schaad, J., "Experiment: Hash Functions with Parameters in 327 the Cryptographic Message Syntax (CMS) and S/MIME", 328 RFC 6210, DOI 10.17487/RFC6210, April 2011, 329 . 331 [SHS] National Institute of Standards and Technology (NIST), 332 "Secure Hash Standard", FIPS Publication 180-3, October 333 2008. 335 Author's Address 337 Russ Housley 338 Vigil Security 339 516 Dranesville Road 340 Herndon, VA 20170 341 US 343 Email: housley@vigilsec.com