5803
INFORMATIONAL

Lightweight Directory Access Protocol (LDAP) Schema for Storing Salted Challenge Response Authentication Mechanism (SCRAM) Secrets

Authors: A. Melnikov
Date: July 2010
Working Group: NON WORKING GROUP
Stream: IETF

Abstract

This memo describes how the "authPassword" Lightweight Directory Access Protocol (LDAP) attribute can be used for storing secrets used by the Salted Challenge Response Authentication Message (SCRAM) mechanism in the Simple Authentication and Security Layer (SASL) framework. This document is not an Internet Standards Track specification; it is published for informational purposes.

RFC 5803: Lightweight Directory Access Protocol (LDAP) Schema for Storing Salted Challenge Response Authentication Mechanism (SCRAM) Secrets [RFC Home] [TEXT|PDF|HTML] [Tracker] [IPR] [Errata] [Info page]

INFORMATIONAL
Errata Exist
Internet Engineering Task Force (IETF)                       A. Melnikov
Request for Comments: 5803                                 Isode Limited
Category: Informational                                        July 2010
ISSN: 2070-1721


 <span class="h1">Lightweight Directory Access Protocol (LDAP) Schema for Storing Salted</span>
      <span class="h1">Challenge Response Authentication Mechanism (SCRAM) Secrets</span>

Abstract

   This memo describes how the "authPassword" Lightweight Directory
   Access Protocol (LDAP) attribute can be used for storing secrets used
   by the Salted Challenge Response Authentication Message (SCRAM)
   mechanism in the Simple Authentication and Security Layer (SASL)
   framework.

Status of This Memo

   This document is not an Internet Standards Track specification; it is
   published for informational purposes.

   This document is a product of the Internet Engineering Task Force
   (IETF).  It represents the consensus of the IETF community.  It has
   received public review and has been approved for publication by the
   Internet Engineering Steering Group (IESG).  Not all documents
   approved by the IESG are a candidate for any level of Internet
   Standard; see <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   <a href="https://www.rfc-editor.org/info/rfc5803">http://www.rfc-editor.org/info/rfc5803</a>.

Copyright Notice

   Copyright (c) 2010 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.




<span class="grey">Melnikov                      Informational                     [Page 1]</span>

<span id="page-2" ></span>
<span class="grey"><a href="./rfc5803">RFC 5803</a>          LDAP Schema for Storing SCRAM Secrets        July 2010</span>


Table of Contents

   <a href="#section-1">1</a>. Overview ........................................................<a href="#page-2">2</a>
   <a href="#section-2">2</a>. Conventions Used in This Document ...............................<a href="#page-3">3</a>
   <a href="#section-3">3</a>. Security Considerations .........................................<a href="#page-3">3</a>
   <a href="#section-4">4</a>. Acknowledgements ................................................<a href="#page-4">4</a>
   <a href="#section-5">5</a>. Normative References ............................................<a href="#page-4">4</a>

<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>.  Overview</span>

   This document describes how the authPassword LDAP attribute
   [<a href="#ref-AUTHPASS" title=""LDAP Authentication Password Schema"">AUTHPASS</a>] can be used for storing secrets used by [<a href="#ref-SCRAM" title=""Salted Challenge Response Authentication Message (SCRAM) SASL Mechanisms"">SCRAM</a>] Simple
   Authentication and Security Layer [<a href="./rfc4422" title=""Simple Authentication and Security Layer (SASL)"">RFC4422</a>] Mechanisms.

      The "scheme" part of the authPassword attribute is the SCRAM
      mechanism name (always without the "-PLUS" suffix), e.g., "SCRAM-
      SHA-1".  See [<a href="#ref-SCRAM" title=""Salted Challenge Response Authentication Message (SCRAM) SASL Mechanisms"">SCRAM</a>] for the exact syntax of SCRAM mechanism
      names.

      The "authInfo" part of the authPassword attribute is the iteration
      count (iter-count in the ABNF below), followed by ":" and base64-
      encoded [<a href="#ref-BASE64" title=""The Base16, Base32, and Base64 Data Encodings"">BASE64</a>] salt.

      The "authValue" part of the authPassword attribute is the base64-
      encoded [<a href="#ref-BASE64" title=""The Base16, Base32, and Base64 Data Encodings"">BASE64</a>] StoredKey [<a href="#ref-SCRAM" title=""Salted Challenge Response Authentication Message (SCRAM) SASL Mechanisms"">SCRAM</a>], followed by ":" and base64-
      encoded [<a href="#ref-BASE64" title=""The Base16, Base32, and Base64 Data Encodings"">BASE64</a>] ServerKey [<a href="#ref-SCRAM" title=""Salted Challenge Response Authentication Message (SCRAM) SASL Mechanisms"">SCRAM</a>].

   Syntax of the attribute can be expressed using ABNF [<a href="./rfc5234" title=""Augmented BNF for Syntax Specifications: ABNF"">RFC5234</a>].  Non-
   terminal references in the following ABNF are defined in either
   [<a href="#ref-AUTHPASS" title=""LDAP Authentication Password Schema"">AUTHPASS</a>], [<a href="./rfc4422" title=""Simple Authentication and Security Layer (SASL)"">RFC4422</a>], or [<a href="./rfc5234" title=""Augmented BNF for Syntax Specifications: ABNF"">RFC5234</a>].

       scram-mech     = "SCRAM-SHA-1" / scram-mech-ext
                      ; Complies with ABNF for <scheme>
                      ; defined in [<a href="#ref-AUTHPASS" title=""LDAP Authentication Password Schema"">AUTHPASS</a>].

       scram-authInfo = iter-count ":" salt
                      ; Complies with ABNF for <authInfo>
                      ; defined in [<a href="#ref-AUTHPASS" title=""LDAP Authentication Password Schema"">AUTHPASS</a>].

       scram-authValue = stored-key ":" server-key
                      ; Complies with ABNF for <authValue>
                      ; defined in [<a href="#ref-AUTHPASS" title=""LDAP Authentication Password Schema"">AUTHPASS</a>].

       iter-count   = %x31-39 *DIGIT
                      ; SCRAM iteration count.
                      ; A positive number without leading zeros.

       salt         = <base64-encoded value>



<span class="grey">Melnikov                      Informational                     [Page 2]</span>

<span id="page-3" ></span>
<span class="grey"><a href="./rfc5803">RFC 5803</a>          LDAP Schema for Storing SCRAM Secrets        July 2010</span>


       stored-key   = <base64-encoded value>
                      ; See definition in [<a href="#ref-SCRAM" title=""Salted Challenge Response Authentication Message (SCRAM) SASL Mechanisms"">SCRAM</a>].

       server-key   = <base64-encoded value>
                      ; See definition in [<a href="#ref-SCRAM" title=""Salted Challenge Response Authentication Message (SCRAM) SASL Mechanisms"">SCRAM</a>].

       scram-mech-ext = "SCRAM-" 1*9mech-char
                      ; Other SCRAM mechanisms registered
                      ; in the IANA registry for SASL
                      ; mechanism names.

       mech-char    = <Defined in <a href="./rfc4422">RFC 4422</a>>

   Note that the authPassword attribute is multivalued.  For example, it
   may contain multiple SCRAM hashes for different hashing algorithms.

<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>.  Conventions Used in This Document</span>

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].

<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>.  Security Considerations</span>

   This document defines how the authPassword attribute can be used to
   store SCRAM secrets.  Therefore, security considerations relevant to
   [<a href="#ref-SCRAM" title=""Salted Challenge Response Authentication Message (SCRAM) SASL Mechanisms"">SCRAM</a>] and hash functions used with it are also relevant to this
   document.

   General security considerations related to the authPassword attribute
   (as specified in [<a href="#ref-AUTHPASS" title=""LDAP Authentication Password Schema"">AUTHPASS</a>]) also apply to the use of authPassword as
   specified in this document.  In particular, the values of
   authPassword SHOULD be protected as if they were cleartext passwords.
   A read operation on this attribute that is not protected by a privacy
   layer (such as IPsec or TLS) can expose this attribute to an attacker
   who a) would be able to use the intercepted value to impersonate the
   user to all servers providing SCRAM access using the same hash
   function, password, iteration count, and salt or b) would be able to
   perform an offline dictionary or brute-force attack in order to
   recover the user's password.

   Servers MUST validate the format of the authPassword attribute before
   using it for performing a SCRAM authentication exchange.  It is
   possible that an attacker compromised the LDAP server or got access
   to the entry containing the attribute in order to exploit a
   vulnerability in the subsystem performing the SCRAM authentication





<span class="grey">Melnikov                      Informational                     [Page 3]</span>

<span id="page-4" ></span>
<span class="grey"><a href="./rfc5803">RFC 5803</a>          LDAP Schema for Storing SCRAM Secrets        July 2010</span>


   exchange.  Big iteration counts and invalid base64 encoding are two
   possible (but not the only) exploits in the format specified in the
   document.

<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>.  Acknowledgements</span>

   The author gratefully acknowledges the feedback provided by Chris
   Newman, Kurt Zeilenga, Chris Lonvick, Peter Saint-Andre, Barry Leiba,
   and Chris Ridd.

<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>.  Normative References</span>

   [<a id="ref-AUTHPASS">AUTHPASS</a>]  Zeilenga, K., "LDAP Authentication Password Schema",
               <a href="./rfc3112">RFC 3112</a>, May 2001.

   [<a id="ref-BASE64">BASE64</a>]    Josefsson, S., "The Base16, Base32, and Base64 Data
               Encodings", <a href="./rfc4648">RFC 4648</a>, October 2006.

   [<a id="ref-RFC2119">RFC2119</a>]   Bradner, S., "Key words for use in RFCs to Indicate
               Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.

   [<a id="ref-RFC4422">RFC4422</a>]   Melnikov, A. and K. Zeilenga, "Simple Authentication and
               Security Layer (SASL)", <a href="./rfc4422">RFC 4422</a>, June 2006.

   [<a id="ref-RFC5234">RFC5234</a>]   Crocker, D. and P. Overell, "Augmented BNF for Syntax
               Specifications: ABNF", STD 68, <a href="./rfc5234">RFC 5234</a>, January 2008.

   [<a id="ref-SCRAM">SCRAM</a>]     Menon-Sen, A., Newman, C., Melnikov, A., and N. Williams,
               "Salted Challenge Response Authentication Message (SCRAM)
               SASL Mechanisms", <a href="./rfc5802">RFC 5802</a>, July 2010.

Author's Address

   Alexey Melnikov
   Isode Limited
   5 Castle Business Village
   36 Station Road
   Hampton, Middlesex  TW12 2BX
   UK

   EMail: [email protected]
   URI:   <a href="http://www.melnikov.ca/">http://www.melnikov.ca/</a>









Melnikov                      Informational                     [Page 4]

Additional Resources