| < draft-ietf-lamps-cms-update-alg-id-protect-02.txt | draft-ietf-lamps-cms-update-alg-id-protect-03.txt > | |||
|---|---|---|---|---|
| Network Working Group R. Housley | Network Working Group R. Housley | |||
| Internet-Draft Vigil Security | Internet-Draft Vigil Security | |||
| Updates: 5652 (if approved) May 28, 2020 | Updates: 5652 (if approved) August 07, 2020 | |||
| Intended status: Standards Track | Intended status: Standards Track | |||
| Expires: November 29, 2020 | Expires: February 8, 2021 | |||
| Update to the Cryptographic Message Syntax (CMS) for Algorithm | Update to the Cryptographic Message Syntax (CMS) for Algorithm | |||
| Identifier Protection | Identifier Protection | |||
| draft-ietf-lamps-cms-update-alg-id-protect-02 | draft-ietf-lamps-cms-update-alg-id-protect-03 | |||
| Abstract | Abstract | |||
| This document updates the Cryptographic Message Syntax (CMS) | This document updates the Cryptographic Message Syntax (CMS) | |||
| specified in RFC 5652 to ensure that algorithm identifiers in signed- | specified in RFC 5652 to ensure that algorithm identifiers in signed- | |||
| data and authenticated-data content types are adequately protected. | data and authenticated-data content types are adequately protected. | |||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| skipping to change at page 1, line 34 ¶ | skipping to change at page 1, line 34 ¶ | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on November 29, 2020. | This Internet-Draft will expire on February 8, 2021. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2020 IETF Trust and the persons identified as the | Copyright (c) 2020 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
| to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
| include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
| the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
| described in the Simplified BSD License. | described in the Simplified BSD License. | |||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | |||
| 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 | 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
| 3. Require use the same hash algorithm . . . . . . . . . . . . . 3 | 3. Required use the same hash algorithm . . . . . . . . . . . . 3 | |||
| 3.1. RFC 5652, Section 5.3 . . . . . . . . . . . . . . . . . . 3 | 3.1. RFC 5652, Section 5.3 . . . . . . . . . . . . . . . . . . 3 | |||
| 3.2. RFC 5652, Section 5.4 . . . . . . . . . . . . . . . . . . 4 | 3.2. RFC 5652, Section 5.4 . . . . . . . . . . . . . . . . . . 4 | |||
| 3.3. RFC 5652, Section 5.6 . . . . . . . . . . . . . . . . . . 4 | 3.3. RFC 5652, Section 5.6 . . . . . . . . . . . . . . . . . . 4 | |||
| 3.4. Backward Compatibility Considerations . . . . . . . . . . 5 | 3.4. Backward Compatibility Considerations . . . . . . . . . . 5 | |||
| 3.5. Timestamp Compatibility Considerations . . . . . . . . . 5 | 3.5. Timestamp Compatibility Considerations . . . . . . . . . 5 | |||
| 4. Recommend inclusion of the CMSAlgorithmProtection attribute . 5 | 4. Recommend inclusion of the CMSAlgorithmProtection attribute . 5 | |||
| 4.1. RFC 5652, Section 14 . . . . . . . . . . . . . . . . . . 6 | 4.1. RFC 5652, Section 14 . . . . . . . . . . . . . . . . . . 6 | |||
| 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 | 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 | |||
| 6. Security Considerations . . . . . . . . . . . . . . . . . . . 6 | 6. Security Considerations . . . . . . . . . . . . . . . . . . . 6 | |||
| 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6 | 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 | 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 8.1. Normative References . . . . . . . . . . . . . . . . . . 6 | 8.1. Normative References . . . . . . . . . . . . . . . . . . 7 | |||
| 8.2. Informative References . . . . . . . . . . . . . . . . . 7 | 8.2. Informative References . . . . . . . . . . . . . . . . . 7 | |||
| Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 | Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 1. Introduction | 1. Introduction | |||
| This document updates the Cryptographic Message Syntax (CMS) | This document updates the Cryptographic Message Syntax (CMS) | |||
| [RFC5652] to ensure that algorithm identifiers in signed-data and | [RFC5652] to ensure that algorithm identifiers in signed-data and | |||
| authenticated-data content types are adequately protected. | authenticated-data content types are adequately protected. | |||
| The CMS signed-data Content Type [RFC5652], unlike X.509 certificates | The CMS signed-data Content Type [RFC5652], unlike X.509 certificates | |||
| skipping to change at page 3, line 34 ¶ | skipping to change at page 3, line 34 ¶ | |||
| originator include the CMSAlgorithmProtection attribute [RFC6211]. | originator include the CMSAlgorithmProtection attribute [RFC6211]. | |||
| 2. Terminology | 2. Terminology | |||
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
| "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
| "OPTIONAL" in this document are to be interpreted as described in | "OPTIONAL" in this document are to be interpreted as described in | |||
| BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all | BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all | |||
| capitals, as shown here. | capitals, as shown here. | |||
| 3. Require use the same hash algorithm | 3. Required use the same hash algorithm | |||
| This section updates [RFC5652] to require the originator to use the | This section updates [RFC5652] to require the originator to use the | |||
| same hash algorithm to compute the digest of the message content and | same hash algorithm to compute the digest of the message content and | |||
| the digest of signed attributes. | the digest of signed attributes. | |||
| 3.1. RFC 5652, Section 5.3 | 3.1. RFC 5652, Section 5.3 | |||
| Change the paragraph describing the digestAlgorithm as follows: | Change the paragraph describing the digestAlgorithm as follows: | |||
| OLD: | OLD: | |||
| skipping to change at page 4, line 14 ¶ | skipping to change at page 4, line 14 ¶ | |||
| Implementations MAY fail to validate signatures that use a digest | Implementations MAY fail to validate signatures that use a digest | |||
| algorithm that is not included in the SignedData digestAlgorithms | algorithm that is not included in the SignedData digestAlgorithms | |||
| set. | set. | |||
| NEW: | NEW: | |||
| digestAlgorithm identifies the message digest algorithm, and any | digestAlgorithm identifies the message digest algorithm, and any | |||
| associated parameters, used by the signer. The message digest is | associated parameters, used by the signer. The message digest is | |||
| computed on either the content being signed or the content | computed on either the content being signed or the content | |||
| together with the signed attributes using the process described in | together with the signedAttrs using the process described in | |||
| Section 5.4. The message digest algorithm SHOULD be among those | Section 5.4. The message digest algorithm SHOULD be among those | |||
| listed in the digestAlgorithms field of the associated SignerData. | listed in the digestAlgorithms field of the associated SignerData. | |||
| If signedAttrs are present in the SignerInfo, then the same digest | If signedAttrs field is present in the SignerInfo, then the same | |||
| algorithm MUST be used to compute the digest of the SignedData | digest algorithm MUST be used to compute both the digest of the | |||
| encapContentInfo eContent, which is carried in the message-digest | SignedData encapContentInfo eContent, which is carried in the | |||
| attribute, and to compute the digest of the DER-encoded SET OF | message-digest attribute, and the digest of the DER-encoded | |||
| signed attributes, which is passed to the signature algorithm. | signedAttrs, which is passed to the signature algorithm. | |||
| Implementations MAY fail to validate signatures that use a digest | Implementations MAY fail to validate signatures that use a digest | |||
| algorithm that is not included in the SignedData digestAlgorithms | algorithm that is not included in the SignedData digestAlgorithms | |||
| set. | set. | |||
| 3.2. RFC 5652, Section 5.4 | 3.2. RFC 5652, Section 5.4 | |||
| Add the following paragraph as the second paragraph in Section 5.4: | Add the following paragraph as the second paragraph in Section 5.4: | |||
| ADD: | ADD: | |||
| When the signedAttrs field is present, the same digest algorithm | When the signedAttrs field is present, the same digest algorithm | |||
| MUST be used to compute the digest of the the encapContentInfo | MUST be used to compute the digest of the encapContentInfo | |||
| eContent OCTET STRING, which is carried in the message-digest | eContent OCTET STRING, which is carried in the message-digest | |||
| attribute, and the collection of attributes that are signed. | attribute, and the collection of attributes that are signed. | |||
| 3.3. RFC 5652, Section 5.6 | 3.3. RFC 5652, Section 5.6 | |||
| Change the paragraph discussing the signedAttributes as follows: | Change the paragraph discussing the signed attributes as follows: | |||
| OLD: | OLD: | |||
| The recipient MUST NOT rely on any message digest values computed | The recipient MUST NOT rely on any message digest values computed | |||
| by the originator. If the SignedData signerInfo includes | by the originator. If the SignedData signerInfo includes | |||
| signedAttributes, then the content message digest MUST be | signedAttributes, then the content message digest MUST be | |||
| calculated as described in Section 5.4. For the signature to be | calculated as described in Section 5.4. For the signature to be | |||
| valid, the message digest value calculated by the recipient MUST | valid, the message digest value calculated by the recipient MUST | |||
| be the same as the value of the messageDigest attribute included | be the same as the value of the messageDigest attribute included | |||
| in the signedAttributes of the SignedData signerInfo. | in the signedAttributes of the SignedData signerInfo. | |||
| NEW: | NEW: | |||
| The recipient MUST NOT rely on any message digest values computed | The recipient MUST NOT rely on any message digest values computed | |||
| by the originator. If the SignedData signerInfo includes | by the originator. If the SignedData signerInfo includes the | |||
| signedAttributes, then the content message digest MUST be | signedAttrs field, then the content message digest MUST be | |||
| calculated as described in Section 5.4, using the same digest | calculated as described in Section 5.4, using the same digest | |||
| algorithm to compute the digest of the the encapContentInfo | algorithm to compute the digest of the encapContentInfo eContent | |||
| eContent OCTET STRING and the message-digest attribute. For the | OCTET STRING and the message-digest attribute. For the signature | |||
| signature to be valid, the message digest value calculated by the | to be valid, the message digest value calculated by the recipient | |||
| recipient MUST be the same as the value of the messageDigest | MUST be the same as the value of the messageDigest attribute | |||
| attribute included in the signedAttributes of the SignedData | included in the signedAttrs field of the SignedData signerInfo. | |||
| signerInfo. | ||||
| 3.4. Backward Compatibility Considerations | 3.4. Backward Compatibility Considerations | |||
| The new requirement introduced above might lead to compatibility with | The new requirement introduced above might lead to incompatibility | |||
| an implementation that allowed different digest algorithms to be used | with an implementation that allowed different digest algorithms to be | |||
| to compute the digest of the message content and the digest of signed | used to compute the digest of the message content and the digest of | |||
| attributes. The signatures produced by such an implementation when | signed attributes. The signatures produced by such an implementation | |||
| two different digest algorithms are used will be considered invalid | when two different digest algorithms are used will be considered | |||
| by an implementation that follows this specification. However, most, | invalid by an implementation that follows this specification. | |||
| if not all, implementations already require the originator to use the | However, most, if not all, implementations already require the | |||
| same digest algorithm for both operations. | originator to use the same digest algorithm for both operations. | |||
| 3.5. Timestamp Compatibility Considerations | 3.5. Timestamp Compatibility Considerations | |||
| The new requirement introduced above might lead to compatibility | The new requirement introduced above might lead to compatibility | |||
| issues for timestamping systems when the originator does not wish to | issues for timestamping systems when the originator does not wish to | |||
| share the message content with the Time Stamp Authority (TSA) | share the message content with the Time Stamp Authority (TSA) | |||
| [RFC3161]. In this situation, the originator sends a TimeStampReq to | [RFC3161]. In this situation, the originator sends a TimeStampReq to | |||
| the TSA that includes a MessageImprint, which consists of a digest | the TSA that includes a MessageImprint, which consists of a digest | |||
| algorithm identifier and a digest value, then the TSA uses the | algorithm identifier and a digest value, then the TSA uses the | |||
| originator-provided digest in the MessageImprint. | originator-provided digest in the MessageImprint. | |||
| skipping to change at page 6, line 28 ¶ | skipping to change at page 6, line 28 ¶ | |||
| originator of an authenticated-data content type that includes | originator of an authenticated-data content type that includes | |||
| authenticated attributes SHOULD include the CMSAlgorithmProtection | authenticated attributes SHOULD include the CMSAlgorithmProtection | |||
| attribute [RFC6211] as one of the authenticated attributes. | attribute [RFC6211] as one of the authenticated attributes. | |||
| 5. IANA Considerations | 5. IANA Considerations | |||
| This document makes no requests of the IANA. | This document makes no requests of the IANA. | |||
| 6. Security Considerations | 6. Security Considerations | |||
| The security considerations of [RFC5652] are updated ensure that | The security properties of the CMS [RFC5652] signed-data and | |||
| algorithm identifiers are adequately protected, which makes algorithm | authenticated-data content types are updated to ensure that algorithm | |||
| identifiers are adequately protected, which makes algorithm | ||||
| substitution attacks significantly more difficult. | substitution attacks significantly more difficult. | |||
| For the signed-data content type, the improvements specified in this | ||||
| document force an attacker to mount a hash algorithm substitution | ||||
| attack on the overall signature, not just on the message digest of | ||||
| the encapContentInfo eContent. | ||||
| Some digital signature algorithms have prevented hash function | ||||
| substitutions by including a digest algorithm identifier as an input | ||||
| to the signature algorithm. As discussed in [HASHID], such a | ||||
| "firewall" may not be effective or even possible with newer signature | ||||
| algorithms. For example, RSASSA-PKCS1-v1_5 [RFC8017] protects the | ||||
| digest algorithm identifier, but RSASSA-PSS [RFC8017] does not. | ||||
| Therefore, it remains important that a signer have a way to signal to | ||||
| a recipient which digest algorithms are allowed to be used in | ||||
| conjunction with the verification of an overall signature. This | ||||
| signalling can be done as part of the specification of the signature | ||||
| algorithm in an X.509v3 certificate extension [RFC5280], or some | ||||
| other means. The Digital Signature Standard (DSS) [DSS] takes the | ||||
| first approach by requiring the use of an "approved" one-way hash | ||||
| algorithm. | ||||
| For the authenticated-data content type, the improvements specified | ||||
| in this document force an attacker to mount a MAC algorithm | ||||
| substitution attack, which is difficult because the attacker does not | ||||
| know the authentication key. | ||||
| The CMSAlgorithmProtection attribute [RFC6211] offers protection for | The CMSAlgorithmProtection attribute [RFC6211] offers protection for | |||
| the algorithm identifiers used in the signed-data and authenticated- | the algorithm identifiers used in the signed-data and authenticated- | |||
| data content types. There is not currently protection mechanism for | data content types. However, no protection is provided for the | |||
| the algorithm identifiers used in the enveloped-data, digested-data, | algorithm identifiers in the enveloped-data, digested-data, or | |||
| or encrypted-data content types. Likewise there is not currently a | encrypted-data content types. Likewise, The CMSAlgorithmProtection | |||
| protection mechanism for the algorithm identifiers used in the | attribute provides no protection for the algorithm identifiers used | |||
| authenticated-enveloped-data content type defined in [RFC5083]. | in the authenticated-enveloped-data content type defined in | |||
| [RFC5083]. | ||||
| 7. Acknowledgements | 7. Acknowledgements | |||
| Many thanks to Jim Schaad and Peter Gutmann; without knowing it, they | Many thanks to Jim Schaad and Peter Gutmann; without knowing it, they | |||
| motivated me to write this document. | motivated me to write this document. Thanks to Roman Danyliw for | |||
| careful review and editorial suggestions. | ||||
| 8. References | 8. References | |||
| 8.1. Normative References | 8.1. Normative References | |||
| [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
| Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
| DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
| <https://www.rfc-editor.org/info/rfc2119>. | <https://www.rfc-editor.org/info/rfc2119>. | |||
| skipping to change at page 7, line 22 ¶ | skipping to change at page 7, line 51 ¶ | |||
| <https://www.rfc-editor.org/info/rfc6211>. | <https://www.rfc-editor.org/info/rfc6211>. | |||
| [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | |||
| 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | |||
| May 2017, <https://www.rfc-editor.org/info/rfc8174>. | May 2017, <https://www.rfc-editor.org/info/rfc8174>. | |||
| 8.2. Informative References | 8.2. Informative References | |||
| [DSS] National Institute of Standards and Technology (NIST), | [DSS] National Institute of Standards and Technology (NIST), | |||
| "Digital Signature Standard (DSS)", FIPS | "Digital Signature Standard (DSS)", FIPS | |||
| Publication 186-3, June 2009. | Publication 186-4, July 2013. | |||
| [HASHID] Kaliski, B., "On Hash Function Firewalls in Signature | ||||
| Schemes", Lecture Notes in Computer Science, Volume 2271, | ||||
| DOI 10.1007/3-540-45760-7_1, February 2002. | ||||
| [RFC3161] Adams, C., Cain, P., Pinkas, D., and R. Zuccherato, | [RFC3161] Adams, C., Cain, P., Pinkas, D., and R. Zuccherato, | |||
| "Internet X.509 Public Key Infrastructure Time-Stamp | "Internet X.509 Public Key Infrastructure Time-Stamp | |||
| Protocol (TSP)", RFC 3161, DOI 10.17487/RFC3161, August | Protocol (TSP)", RFC 3161, DOI 10.17487/RFC3161, August | |||
| 2001, <https://www.rfc-editor.org/info/rfc3161>. | 2001, <https://www.rfc-editor.org/info/rfc3161>. | |||
| [RFC5083] Housley, R., "Cryptographic Message Syntax (CMS) | [RFC5083] Housley, R., "Cryptographic Message Syntax (CMS) | |||
| Authenticated-Enveloped-Data Content Type", RFC 5083, | Authenticated-Enveloped-Data Content Type", RFC 5083, | |||
| DOI 10.17487/RFC5083, November 2007, | DOI 10.17487/RFC5083, November 2007, | |||
| <https://www.rfc-editor.org/info/rfc5083>. | <https://www.rfc-editor.org/info/rfc5083>. | |||
| skipping to change at page 7, line 45 ¶ | skipping to change at page 8, line 30 ¶ | |||
| Housley, R., and W. Polk, "Internet X.509 Public Key | Housley, R., and W. Polk, "Internet X.509 Public Key | |||
| Infrastructure Certificate and Certificate Revocation List | Infrastructure Certificate and Certificate Revocation List | |||
| (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, | (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, | |||
| <https://www.rfc-editor.org/info/rfc5280>. | <https://www.rfc-editor.org/info/rfc5280>. | |||
| [RFC6210] Schaad, J., "Experiment: Hash Functions with Parameters in | [RFC6210] Schaad, J., "Experiment: Hash Functions with Parameters in | |||
| the Cryptographic Message Syntax (CMS) and S/MIME", | the Cryptographic Message Syntax (CMS) and S/MIME", | |||
| RFC 6210, DOI 10.17487/RFC6210, April 2011, | RFC 6210, DOI 10.17487/RFC6210, April 2011, | |||
| <https://www.rfc-editor.org/info/rfc6210>. | <https://www.rfc-editor.org/info/rfc6210>. | |||
| [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, | ||||
| "PKCS #1: RSA Cryptography Specifications Version 2.2", | ||||
| RFC 8017, DOI 10.17487/RFC8017, November 2016, | ||||
| <https://www.rfc-editor.org/info/rfc8017>. | ||||
| [SHS] National Institute of Standards and Technology (NIST), | [SHS] National Institute of Standards and Technology (NIST), | |||
| "Secure Hash Standard", FIPS Publication 180-3, October | "Secure Hash Standard", FIPS Publication 180-4, August | |||
| 2008. | 2015. | |||
| Author's Address | Author's Address | |||
| Russ Housley | Russ Housley | |||
| Vigil Security, LLC | Vigil Security, LLC | |||
| 516 Dranesville Road | 516 Dranesville Road | |||
| Herndon, VA 20170 | Herndon, VA 20170 | |||
| US | US | |||
| Email: housley@vigilsec.com | Email: housley@vigilsec.com | |||
| End of changes. 21 change blocks. | ||||
| 44 lines changed or deleted | 80 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||