idnits 2.17.1 draft-melnikov-scram-2fa-02.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 : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 4 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 29, 2020) is 1268 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) ** Downref: Normative reference to an Informational RFC: RFC 4949 ** Downref: Normative reference to an Informational RFC: RFC 6238 Summary: 3 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Melnikov 3 Internet-Draft Isode Ltd 4 Intended status: Standards Track October 29, 2020 5 Expires: May 2, 2021 7 Extensions to Salted Challenge Response (SCRAM) for 2 factor 8 authentication 9 draft-melnikov-scram-2fa-02 11 Abstract 13 This specification describes an extension to family of Simple 14 Authentication and Security Layer (SASL; RFC 4422) authentication 15 mechanisms called the Salted Challenge Response Authentication 16 Mechanism (SCRAM), which provides support for 2 factor 17 authentication. 19 This specification also gives an example how TOTP (RFC 6238) can be 20 used as the second factor. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on May 2, 2021. 39 Copyright Notice 41 Copyright (c) 2020 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (https://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 2. Conventions Used in This Document . . . . . . . . . . . . . . 2 58 2.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . 3 59 2.2. Notation . . . . . . . . . . . . . . . . . . . . . . . . . 3 60 3. SCRAM Extension for 2FA . . . . . . . . . . . . . . . . . . . 3 61 4. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 4 62 5. Use of TOTP with SCRAM . . . . . . . . . . . . . . . . . . . 4 63 6. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 5 64 7. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 5 65 8. Security Considerations . . . . . . . . . . . . . . . . . . . 5 66 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 67 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6 68 11. Normative References . . . . . . . . . . . . . . . . . . . . 6 69 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6 71 1. Introduction 73 SCRAM [RFC5802] is a password based SASL [RFC4422] authentication 74 mechanism that provides (among other things) mutual authentication 75 and binding to an external security layer such as TLS. 77 Two-factor authentication (2FA) is a way to add additional security 78 to an authentication exchange. The first "factor" is a password. 79 The second "factor" is a verification code retrieved from an 80 application on a mobile device or computer. 2FA is conceptually 81 similar to a security token device that banks in some countries 82 require for online banking. Other names for 2FA systems include OTP 83 (one-time password) and TOTP (Time-based One-time Password algorithm, 84 such as [RFC6238]). 86 This specification describes an extension to SCRAM to provide 2 87 factor authentication. SCRAM already relies on passwords for 88 authentication. This document specifies how second "factors" can be 89 incorporated into SCRAM authentication. 91 2. Conventions Used in This Document 93 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 94 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 95 document are to be interpreted as described in [RFC2119]. 97 Formal syntax is defined by [RFC5234] including the core rules 98 defined in Appendix B of [RFC5234]. 100 Example lines prefaced by "C:" are sent by the client and ones 101 prefaced by "S:" by the server. If a single "C:" or "S:" label 102 applies to multiple lines, then the line breaks between those lines 103 are for editorial clarity only, and are not part of the actual 104 protocol exchange. 106 2.1. Terminology 108 This document uses several terms defined in [RFC4949] ("Internet 109 Security Glossary") including the following: authentication, 110 authentication exchange, authentication information, brute force, 111 challenge-response, cryptographic hash function, dictionary attack, 112 eavesdropping, hash result, keyed hash, man-in-the-middle, nonce, 113 one-way encryption function, password, replay attack and salt. 114 Readers not familiar with these terms should use that glossary as a 115 reference. Other terms defined in [RFC5802] are also used in this 116 document. 118 2.2. Notation 120 This document reuses notation defined in SCRAM. 122 3. SCRAM Extension for 2FA 124 This extension doesn't add any extra roundtrips to SCRAM 125 authentication. SCRAM was designed to be extensible, so it allows 126 for optional and mandatory attributes, which covered by MAC codes. 127 Second "factors" are conveyed in the second message sent from the 128 client to the server. 130 This extension doesn't change how the client authenticates the 131 server. 133 The server authenticates the client after receiving the second 134 message as described in Section 3 of [RFC5802] If the client included 135 "type" and "second-factor" attributes (see Section 4) and the server 136 supports the specified second factor type, the server verifies 137 content of the "second-factor" according to the "type". If the 138 second factor verification fails, the server MUST fail authentication 139 and SHOULD return "second-factor-failed" error in the "e" attribute. 140 [[It would be possible to make the extra attributes mandatory by 141 using SCRAM's "m=", but the text above doesn't do that.]] 143 4. Formal Syntax 145 This document defines the following SCRAM attributes: 147 o t: This attribute specifies the type of second factor. (Create 148 IANA registry for these?) This document defines one type: "totp". 149 If this attribute is specified, the "f" attribute MUST also be 150 specified. 152 o f: This attribute specifies the value of the second factor. For 153 "t=totp" it is 6 digit decimal number. [[Use 8 digits per Rick 154 van Rein?]] This attribute MUST be ignored unless the "t" 155 attribute is also specified. 157 The following syntax specification uses the Augmented Backus-Naur 158 Form (ABNF) notation as specified in [RFC5234]. 160 type = "t=" type-value 161 ; Complies with "attr-val" syntax. 162 type-value = "totp" / value 163 ; Type of second factor. 164 ; Should be registered with IANA. 165 second-factor = "f=" second-factor-value 166 ; Complies with "attr-val" syntax. 167 second-factor-value = 6DIGIT / value 169 server-error-value-ext = 170 "second-factor-failed" / 171 "second-factor-value-missing" 173 value = 175 5. Use of TOTP with SCRAM 177 This document defines the following SCRAM attributes: 179 o t: This attribute specifies the type of second factor. (Create 180 IANA registry for these?) This document defines one type: "totp". 181 If this attribute is specified, the "f" attribute MUST also be 182 specified. 184 o f: This attribute specifies the value of the second factor. For 185 "t=totp" it is 6 digit decimal number. This attribute MUST be 186 ignored unless the "t" attribute is also specified. 188 A TOTP URI is specified with the following ABNF: 190 totp-uri = "otpauth" "://" "totp/" label "?secret=" secret "&issuer=" issuer 191 label = issuer (":" / "%3A") identity 192 identity = 1*CHAR ; URI-encoded SASL identity 193 secret = 40 * HEXCHAR ; Base32 (hex) encoded secret with no padding. 194 issuer = 1*CHAR ; Issuer name. 196 6. Examples 198 The following example extends the example from Section 5 of 199 [RFC5802]: 201 C: n,,n=user,r=fyko+d2lbbFgONRv9qkxdawL 202 S: r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j,s=QSXCR+Q6sek8bf92, 203 i=4096 204 C: c=biws,r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j, 205 t=totp,f=776804,p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts= 206 S: v=lz59pqV8S7suAoZWja4dJRkFsKQ= 208 Please note that TOTP extension described in this document works in 209 the same way with SCRAM-SHA-256/SCRAM-SHA-256-PLUS and SCRAM-SHA-512/ 210 SCRAM-SHA-512-PLUS variants of SCRAM. 212 7. Open Issues 214 Simon Josefsson: should this be a new SASL mechanism name, e.g. 215 SCRAM-SHA-256-TOTP? 217 Simon Josefsson: cookie option for fast reauthentication? Alexey: 218 can do or just used CLIENT-KEY (draft-cridland-kitten-clientkey)? 220 Rick van Rein: specify HOTP variant as well? 222 Rick van Rein: use TOTP with 6 or 8 digits? Register both variants? 224 8. Security Considerations 226 TBD 228 9. IANA Considerations 230 TBD. Possibly create a new registry of second factor types. 232 10. Acknowledgements 234 Thank you to Stephen Farrell for motivating creation of this document 235 and to Dave Cridland for describing how TOTP can be used with XMPP in 236 XEP-400. Thank you to Rick van Rein for comments and corrections, 237 but all final errors in this document remain mine. 239 11. Normative References 241 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 242 Requirement Levels", BCP 14, RFC 2119, 243 DOI 10.17487/RFC2119, March 1997, 244 . 246 [RFC4422] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple 247 Authentication and Security Layer (SASL)", RFC 4422, 248 DOI 10.17487/RFC4422, June 2006, 249 . 251 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 252 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 253 . 255 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 256 Specifications: ABNF", STD 68, RFC 5234, 257 DOI 10.17487/RFC5234, January 2008, 258 . 260 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 261 "Salted Challenge Response Authentication Mechanism 262 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, 263 DOI 10.17487/RFC5802, July 2010, 264 . 266 [RFC6238] M'Raihi, D., Machani, S., Pei, M., and J. Rydell, "TOTP: 267 Time-Based One-Time Password Algorithm", RFC 6238, 268 DOI 10.17487/RFC6238, May 2011, 269 . 271 Author's Address 273 Alexey Melnikov 274 Isode Ltd 276 Email: Alexey.Melnikov@isode.com