<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC4422 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4422.xml">
<!ENTITY RFC5802 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5802.xml">
<!ENTITY RFC5803 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5803.xml">
<!ENTITY RFC6234 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6234.xml">
<!ENTITY RFC7627 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7627.xml">
<!ENTITY RFC4270 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4270.xml">
<!ENTITY RFC5226 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5226.xml">
<!ENTITY RFC6194 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6194.xml">
<!ENTITY RFC5246 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC7677 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7677.xml">
<!ENTITY RFC8446 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml">
<!ENTITY RFC9266 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9266.xml">
]>
<?rfc toc="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes"?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>

<rfc submissionType="IETF" ipr="trust200902" category="std" consensus="yes" updates="5802, 7677" docName="draft-melnikov-scram-bis-04">
	<?rfc strict="yes"?>
	<?rfc compact="yes"?>
	<?rfc subcompact="no"?>
	<?rfc symrefs="yes"?>
	<?rfc sortrefs="no"?>
	<?rfc text-list-symbols="o*+-"?>
	<?rfc toc="yes"?>
	<front>
	<title abbrev="SASL SCRAM">Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms
  </title>
    <author initials="A." surname="Melnikov" fullname="Alexey Melnikov" role="editor">
      <organization>Isode Ltd</organization>
      <address>
        <postal>
          <street>14 Castle Mews</street>
          <city>Hampton</city>
          <region>Middlesex</region>
          <code>TW12 2NP</code>
          <country>UK</country>
        </postal>
        <email>alexey.melnikov@isode.com</email>
      </address>
    </author>

    <date year="2024"/>
    
    <abstract>
      
      <t>
      This document updates requirements on implementations of various Salted Challenge Response Authentication Mechanism (SCRAM)
      Simple Authentication and Security Layer (SASL) mechanisms based on more modern security practices.
      </t>

    </abstract>
	</front>

	<middle>

	<section title="Introduction">
    
   <t>
   The intent of this document is to serve as an implementor's roadmap for implementing various Salted Challenge Response Authentication Mechanism (SCRAM) <xref target="RFC5802"/>
   SASL <xref target="RFC4422"/> mechanisms.</t>

   <t>
   <xref target="RFC5802"/> defined the generic SCRAM framework and described instantiation of a SCRAM mechanism using SHA-1 hash function: SCRAM-SHA-1 (and SCRAM-SHA-1-PLUS).
   <xref target="RFC7677"/> described another instantiation using SHA-256 hash function (SCRAM-SHA-256 and SCRAM-SHA-256-PLUS) and also clarified conditions for using the mandatory-to-implement
   "tls-unique" channel binding with TLS 1.2.
   <xref target="RFC9266"/> defines the "tls-exporter" channel binding that is to be used when a SCRAM mechanism is used over TLS 1.3 <xref target="RFC8446"/> or later.
   </t>

   <t>
   <xref target="I-D.melnikov-scram-sha-512"/> and <xref target="I-D.melnikov-scram-sha3-512"/> define further instantiations of SCRAM using SHA-512 and SHA3-512 hash functions respectively.
   </t>

   <t>
   <xref target="I-D.kitten-scram-2fa"/> defines an extension to SCRAM for two factor authentication. It is applicable to all instantiations of SCRAM with different hash algorightms.
   </t>

	</section>

	<section title="Key Word Definitions">

   <t>
   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP
   14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all
   </t>

	</section>


	<section title="Implementation Recommendations">
    
   <t>
   <xref target="RFC9266"/> document updated <xref target="RFC5802"/> and
   <xref target="RFC7677"/> to use the "tls-exporter" channel binding as the mandatory
   to implement (instead of "tls-unique") when a SCRAM mechanism is used over TLS 1.3 <xref target="RFC8446"/> or later.
   </t>

   <t>
   [[Discuss if rough consensus can be reached on this in the KITTEN WG.]]
   All SCRAM implementations SHOULD support <xref target="I-D.kitten-scram-2fa"/> to allow for two factor authentication with SCRAM.
   </t>

   <t>
   [[Possibly narrow down choices to only one of these. Discuss in the KITTEN WG.]]
   Unless required for backward compatibility, server and client implementations MUST support SCRAM-SHA-512-PLUS/SCRAM-SHA-512 <xref target="I-D.melnikov-scram-sha-512"/>
   and/or SCRAM-SHA3-512-PLUS/SCRAM-SHA3-512 <xref target="I-D.melnikov-scram-sha3-512"/> instead of SCRAM-SHA-1-PLUS/SCRAM-SHA-1 <xref target="RFC5802"/>.
   </t>

   <!--///Any other wise words about updating iteration-count default?-->

   <t>
   <xref target="RFC5803"/> describes how SCRAM hashes can be stored in LDAP.
   The LDAP format has a field for the hash algorithm name used, so
   it is compatible with all versions of SCRAM described in this document,
   including SCRAM-SHA-256, SCRAM-SHA-512 and SCRAM-SHA3-512.
   </t>
    
   <!--RFC 7804 - SCRAM as HTTP-->
    
	</section>
    

	<section title="Security Considerations" anchor="sec-cons">
    
   <t>
   The security considerations from <xref target="RFC5802"/> still apply.</t>

   <t>
   To be secure, SCRAM-*-PLUS MUST be
   used over a TLS channel that has had the session hash extension
   <xref target="RFC7627"/> negotiated, or session resumption MUST NOT have been used.
   
   When using SCRAM over TLS 1.2 <xref target="RFC5246"/>, the "tls-unique" channel binding
   is still the default channel binding to use (see Section 6.1 of <xref target="RFC5802"/>),
   assuming the above conditions are satisfied.
   
<!--Text from Sam's draft-ietf-kitten-password-storage:
   However, in the absence of the TLS extended master
   secret fix [RFC7627] and the renegotiation indication TLS extension
   [RFC5746] the tls-unique and tls-server-endpoint channel binding data
   can be forged by an attacker that can MITM the connection.  Before
   advertising a channel binding SASL mechanism, entities MUST ensure
   that both the TLS extended master secret fix and the renegotiation
   indication extension are in place and that the connection has not
   been renegotiated.
-->

   When using SCRAM over TLS 1.3 <xref target="RFC8446"/>, the "tls-exporter" channel binding
   <xref target="RFC9266"/> is the default
   (in the sense specified in Section 6.1 of <xref target="RFC5802"/>) to use.
   </t>

   <t>
   See <xref target="RFC4270"/> and <xref target="RFC6194"/> for reasons to move from SHA-1 to a
   strong security mechanism like SHA-512.
   </t>

   <t>
   The strength of this mechanism is dependent in part on the hash
   iteration-count, as denoted by "i" in <xref target="RFC5802"/>.  As a rule of thumb,
   the hash iteration-count should be such that a modern machine will
   take 0.1 seconds to perform the complete algorithm; however, this is
   unlikely to be practical on mobile devices and other relatively low-
   performance systems.
<!--Update this text based on NIST recommendations and current CPU/GPU speeds-->   
   At the time this was written, the rule of thumb
   gives around 15,000 iterations required; however, a hash iteration-
   count of 10000 takes around 0.5 seconds on current mobile handsets.
   This computational cost can be avoided by caching the ClientKey
   (assuming the Salt and hash iteration-count is stable).  Therefore,
   the recommendation of this specification is that the hash iteration-
   count SHOULD be at least 10000, but careful consideration ought to be
   given to using a significantly higher value, particularly where
   mobile use is less important.
   </t>

	</section>

	<section title="IANA Considerations" anchor="sect-5">
    
   <t>
   IANA is requested to add RFC XXXX as an extra reference for the following SASL SCRAM mechanisms
   listed in the "SASL SCRAM Family Mechanisms" registry: SCRAM-SHA-1, SCRAM-SHA-1-PLUS, SCRAM-SHA-256
   and SCRAM-SHA-256-PLUS.
   </t>

  </section>

	</middle>

	<back>
	<references title="Normative References">
 	 &RFC2119;
	 &RFC4422;
   &RFC5246;
	 &RFC5802;
	 &RFC5803; <!-- Storing SCRAM hashes in LDAP -->
	 &RFC6234; <!--US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)-->
   &RFC7627;
   &RFC7677;
   &RFC8174; <!--RFC 2119 clarification-->
   &RFC8446;
   &RFC9266;

    <reference anchor="I-D.kitten-scram-2fa">
      <front>
        <title>Extensions to Salted Challenge Response (SCRAM) for 2 factor authentication</title>
        <author fullname="Alexey Melnikov">
          <organization>Isode Ltd</organization>
        </author>
        <date month="August" day="24" year="2023"/>
        <abstract>
          <t> This specification describes an extension to family of Simple Authentication and Security Layer (SASL; RFC 4422) authentication mechanisms called the Salted Challenge Response Authentication Mechanism (SCRAM), which provides support for 2 factor authentication. This specification also gives an example of how TOTP (RFC 6238) can be used as the second factor. </t>
        </abstract>
      </front>
      <seriesInfo name="Internet-Draft" value="draft-ietf-kitten-scram-2fa-04"/>
      <format type="TXT" target="https://www.ietf.org/archive/id/draft-ietf-kitten-scram-2fa-04.txt"/>
    </reference>

    <reference anchor="I-D.melnikov-scram-sha-512">
      <front>
        <title>SCRAM-SHA-512 and SCRAM-SHA-512-PLUS Simple Authentication and Security Layer (SASL) Mechanisms</title>
        <author initials="A" surname="Melnikov" fullname="Alexey Melnikov">
          <organization/>
        </author>
        <date year="2022" month="March" day="10"/>
        <abstract>
          <t>This document registers the Simple Authentication and Security Layer (SASL) mechanisms SCRAM-SHA-512 and SCRAM-SHA-512-PLUS.</t>
        </abstract>
      </front>
      <seriesInfo name="Internet-Draft" value="draft-melnikov-scram-sha-512-04"/>
      <format type="TXT" target="https://www.ietf.org/internet-drafts/draft-melnikov-scram-sha-512-04.txt"/>
    </reference>

    <reference anchor="I-D.melnikov-scram-sha3-512">
      <front>
        <title>SCRAM-SHA3-512 and SCRAM-SHA3-512-PLUS Simple Authentication and Security Layer (SASL) Mechanisms</title>
        <author initials="A" surname="Melnikov" fullname="Alexey Melnikov">
          <organization/>
        </author>
        <date year="2023" month="August" day="24"/>
        <abstract>
          <t>This document registers the Simple Authentication and Security Layer (SASL) mechanisms SCRAM-SHA3-512 and SCRAM-SHA3-512-PLUS.</t>
        </abstract>
      </front>
      <seriesInfo name="Internet-Draft" value="draft-melnikov-scram-sha3-512-04"/>
      <format type="TXT" target="https://www.ietf.org/internet-drafts/draft-melnikov-scram-sha3-512-04.txt"/>
    </reference>    
    
  </references>
	<references title="Informative References">
	 &RFC4270; <!--Attacks on Cryptographic Hashes in Internet Protocols-->
	 &RFC5226;
	 &RFC6194;
	</references>
    
	<section title="Acknowledgements" numbered="no" anchor="acknowledgements">
   
   <t>
   This document is based on RFC 7677 by Tony Hansen.
   </t>

   <t>
   Thank you to Ludovic Bocquet for comments and corrections.
<!--/////
   This document benefited from discussions on the KITTEN WG mailing
   list.  The author would like to specially thank Russ Allbery, Dave
   Cridland, Shawn Emery, Stephen Farrell, Simon Josefsson, Pearl Liang,
   Alexey Melnikov, Peter Saint-Andre, Robert Sparks, Martin Thompson,
   and Nico Williams for their comments on this topic.
-->
   </t>
    
	</section>

	</back>

	</rfc>
	
