idnits 2.17.1 draft-melnikov-scram-2fa-01.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 (July 13, 2020) is 1375 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 July 13, 2020 5 Expires: January 14, 2021 7 Extensions to Salted Challenge Response (SCRAM) for 2 factor 8 authentication 9 draft-melnikov-scram-2fa-01 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 January 14, 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 . . . . . . . . . . . . . . . . . . . . . . 5 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: "otp". 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=otp" it is 6 digit decimal number. This attribute MUST be 154 ignored unless the "t" attribute is also specified. 156 The following syntax specification uses the Augmented Backus-Naur 157 Form (ABNF) notation as specified in [RFC5234]. 159 type = "t=" type-value 160 ; Complies with "attr-val" syntax. 161 type-value = "otp" / value 162 ; Type of second factor. 163 ; Should be registered with IANA. 164 second-factor = "f=" second-factor-value 165 ; Complies with "attr-val" syntax. 166 second-factor-value = 6DIGIT / value 168 server-error-value-ext = 169 "second-factor-failed" / 170 "second-factor-value-missing" 172 value = 174 5. Use of TOTP with SCRAM 176 This document defines the following SCRAM attributes: 178 o t: This attribute specifies the type of second factor. (Create 179 IANA registry for these?) This document defines one type: "otp". 180 If this attribute is specified, the "f" attribute MUST also be 181 specified. 183 o f: This attribute specifies the value of the second factor. For 184 "t=otp" it is 6 digit decimal number. This attribute MUST be 185 ignored unless the "t" attribute is also specified. 187 A TOTP URI is specified with the following ABNF: 189 totp-uri = "otpauth" "://" "totp/" label "?secret=" secret "&issuer=" issuer 190 label = issuer (":" / "%3A") identity 191 identity = 1*CHAR ; URI-encoded SASL identity 192 secret = 40 * HEXCHAR ; Base32 (hex) encoded secret with no padding. 193 issuer = 1*CHAR ; Issuer name. 195 6. Examples 197 The following example extends the example from Section 5 of 198 [RFC5802]: 200 C: n,,n=user,r=fyko+d2lbbFgONRv9qkxdawL 201 S: r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j,s=QSXCR+Q6sek8bf92, 202 i=4096 203 C: c=biws,r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j, 204 t=totp,f=776804, 205 p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts= 206 S: v=lz59pqV8S7suAoZWja4dJRkFsKQ= 208 7. Open Issues 210 Simon Josefsson: should this be a new SASL mechanism name, e.g. 211 SCRAM-SHA-1-TOTP? 213 Simon Josefsson: cookie option for fast reauthentication? Alexey: 214 can do or just used CLIENT-KEY (draft-cridland-kitten-clientkey)? 216 8. Security Considerations 218 TBD 220 9. IANA Considerations 222 TBD. Possibly create a new registry of second factor types. 224 10. Acknowledgements 226 Thank you to Stephen Farrell for motivating creation of this document 227 and to Dave Cridland for describing how TOTP can be used with XMPP in 228 XEP-400. 230 11. Normative References 232 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 233 Requirement Levels", BCP 14, RFC 2119, 234 DOI 10.17487/RFC2119, March 1997, 235 . 237 [RFC4422] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple 238 Authentication and Security Layer (SASL)", RFC 4422, 239 DOI 10.17487/RFC4422, June 2006, 240 . 242 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 243 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 244 . 246 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 247 Specifications: ABNF", STD 68, RFC 5234, 248 DOI 10.17487/RFC5234, January 2008, 249 . 251 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 252 "Salted Challenge Response Authentication Mechanism 253 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, 254 DOI 10.17487/RFC5802, July 2010, 255 . 257 [RFC6238] M'Raihi, D., Machani, S., Pei, M., and J. Rydell, "TOTP: 258 Time-Based One-Time Password Algorithm", RFC 6238, 259 DOI 10.17487/RFC6238, May 2011, 260 . 262 Author's Address 264 Alexey Melnikov 265 Isode Ltd 267 Email: Alexey.Melnikov@isode.com