RFC 3112

LDAP Authentication Password Schema

πŸ“… published May 2001, from ietf

RFC 3112: LDAP Authentication Password Schema πŸŽ€

Part 1 of 2 πŸ’…

Okay bestie, here's the deets πŸ“‹ This one comes from the Network Working Group and was written by K. Zeilenga of the OpenLDAP Foundation. It's marked as Category: Informational and dated May 2001 🌸 The header doesn't list any documents it obsoletes or updates, so nothing gets replaced or changed by it 🫢

Status of This Memo 🧾

This memo gives info to the Internet community. It's not an Internet standard of any kind πŸ™ˆ Distribution of this memo is unlimited πŸ¦‹

Copyright (C) The Internet Society (2001). All Rights Reserved. πŸ’œ

Abstract πŸ“–

So this doc is all about schema for user/password authentication in an LDAP (Lightweight Directory Access Protocol) directory, including the authPassword attribute type 🧚 That attribute type holds values derived from the user's password(s), usually made with a cryptographic-strength one-way hash. Basically, authPassword is meant to be used instead of userPassword ✨

1. Background and Intended Use ✨

Okay so the userPassword attribute type [RFC2256] is meant to support the LDAP [RFC2251] "simple" bind operation πŸ’… The catch is that userPassword values have to be clear text passwords 😭 It's often way more desirable to store values derived from the user's password(s) instead of the actual passwords πŸ”₯

The authPassword attribute type is meant to store information used for simple password based authentication πŸŽ€ LDAP servers can use it to carry out the LDAP Bind operation's "simple" authentication method πŸ’–

This attribute type supports multiple storage schemes 🌈 There's a matching rule for use with extensible search filters, so clients can assert that a clear text password "matches" one of the attribute's values 🫢

Storage schemes often use cryptographic-strength one-way hashing. Using one-way hashing makes it less likely that exposed values will give unauthorized access to the Directory (unless the hash algorithm or implementation is flawed) πŸ‘€ Still, hashing passwords is meant to be an extra layer of protection, not the whole plan. It is RECOMMENDED that hashed values be protected as if they were clear text passwords πŸ”

This attribute may be used together with server side password generation mechanisms, like the LDAP Password Modify [RFC3062] extended operation 🧁

Access to this attribute may be governed by administrative controls, like the ones that carry out password change policies πŸ’…

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", and "MAY" in this document are to be interpreted as described in RFC 2119 [RFC2119] 🧠

2. Schema Definitions πŸ“

Okay the schema definitions below are described using LDAPv3 Attribute Syntax Definitions [RFC2252], with the specific syntax detailed using Augmented BNF [RFC2234] πŸ€“

2.1. authPasswordSyntax πŸ’–

( 1.3.6.1.4.1.4203.1.1.2
  DESC 'authentication password syntax' )

Values of this syntax are encoded according to this grammar, bestie 🧚

authPasswordValue = w scheme s authInfo s authValue w
scheme = %x30-39 / %x41-5A / %x2D-2F / %x5F
      ; 0-9, A-Z, "-", ".", "/", or "_"
authInfo = schemeSpecificValue
authValue = schemeSpecificValue
        schemeSpecificValue = *( %x21-23 / %x25-7E )
      ; printable ASCII less "$" and " "
s = w SEP w
w = *SP
SEP = %x24 ; "$"
SP = %x20 ; " " (space)

So scheme describes the mechanism, and authInfo and authValue are scheme specific 🌸 The authInfo field is often a base64 encoded salt, and the authValue field is often a base64 encoded value derived from a user's password(s) πŸ’œ Values of this attribute are case sensitive, so watch those letters πŸ‘€

Transfer of values of this syntax is strongly discouraged where the underlying transport service cannot guarantee confidentiality. It may result in disclosure of the values to unauthorized parties 😭

This document describes a number of schemes, plus the requirements for naming those schemes, in section 3 πŸ¦‹

2.2. authPasswordExactMatch πŸ”₯

( 1.3.6.1.4.1.4203.1.2.2
  NAME 'authPasswordExactMatch'
  DESC 'authentication password exact matching rule'
  SYNTAX 1.3.6.1.4.1.4203.1.1.2 )

This matching rule lets a client assert that an asserted authPasswordSyntax value matches authPasswordSyntax values πŸŽ€ It's meant to be used as the EQUALITY matching rule for attributes whose SYNTAX is authPasswordSyntax πŸ’…

The assertion is "TRUE" if there's an attribute value with the same scheme, authInfo, and authValue components as the asserted value. It's "FALSE" if no attribute value has the same components as the asserted value. Otherwise it's "Undefined" ✨

2.3. authPasswordMatch 🧁

( 1.3.6.1.4.1.4203.1.2.3
  NAME 'authPasswordMatch'
  DESC 'authentication password matching rule'
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} )

This matching rule lets a client assert that a password matches values of authPasswordSyntax, using an extensibleMatch filter component 🌈 Each value gets matched according to its scheme 🫢 The assertion is "TRUE" if one or more attribute values match the asserted value. It's "FALSE" if all values do not match, and "Undefined" otherwise πŸ’–

Servers which support using this matching rule SHOULD publish appropriate matchingRuleUse values per [RFC2252], 4.4 πŸ’œ

Transfer of authPasswordMatch assertion values is strongly discouraged where the underlying transport service cannot guarantee confidentiality. It may result in disclosure of the values to unauthorized parties 😭

2.4. supportedAuthPasswordSchemes 🧚

( 1.3.6.1.4.1.4203.1.3.3
  NAME 'supportedAuthPasswordSchemes'
  DESC 'supported password storage schemes'
  EQUALITY caseExactIA5Match
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32}
  USAGE dSAOperation )

The values of this attribute are the names of the authentication password schemes the server supports 🌸 The syntax of a scheme name is described in section 2.1 ✨ This attribute may only be present in the root DSE. If the server doesn't support any password schemes, this attribute won't be present at all πŸ™ˆ

2.5. authPassword πŸ’…

( 1.3.6.1.4.1.4203.1.3.4 NAME 'authPassword'
  DESC 'password authentication information'
  EQUALITY 1.3.6.1.4.1.4203.1.2.2
  SYNTAX 1.3.6.1.4.1.4203.1.1.2 )

The values of this attribute represent the user's password(s), and they conform to the authPasswordSyntax described in 2.1 πŸ”₯ These values may be used for authentication purposes πŸŽ€

Transfer of authPassword values is strongly discouraged where the underlying transport service cannot guarantee confidentiality. It may result in disclosure of the values to unauthorized parties 😭

2.6. authPasswordObject πŸ¦‹

( 1.3.6.1.4.1.4203.1.4.7 NAME 'authPasswordObject'
  DESC 'authentication password mix in class'
  MAY 'authPassword'
  AUXILIARY )

Entries of this object class may contain authPassword attribute types 🧁

3. Schemes 🌈

This section describes the "MD5" and "SHA1" schemes ✨ Other schemes may be defined by other documents πŸ’– Schemes that aren't described in an RFC SHOULD be named with a leading "X-" to show they're a private or implementation specific scheme. They may also be named using the dotted-decimal representation [RFC2252] of an OID assigned to the scheme 🫢

3.1. MD5 scheme πŸ’œ

The MD5 [RFC1321] scheme name is "MD5" 🧠

The authValue is the base64 encoding of an MD5 digest of the concatenation of the user password and salt. The base64 encoding of the salt is provided in the authInfo field. The salt MUST be at least 64 bits long. Implementations of this scheme MUST support salts up to 128 bits in length πŸ”

Example:

Given a user "joe" who's password is "mary" and a salt of "salt",
the authInfo field would be the base64 encoding of "salt" and the
authValue field would be the base64 encoding of the MD5 digest of
"marysalt".

A match against an asserted password and an attribute value of this scheme SHALL be true if and only if the MD5 digest of the concatenation of the asserted value and the salt is equal to the MD5 digest contained in AuthValue. The match SHALL be undefined if the server is unable to complete the equality test for any reason. Otherwise the match SHALL be false 🌸

Values of this scheme SHOULD only be used to implement simple user/password authentication πŸŽ€

3.2. SHA1 scheme πŸ¦‹

The SHA1 [SHA1] scheme name is "SHA1" πŸ’…

The authValue is the base64 encoding of a SHA1 digest of the concatenation of the user password and the salt. The base64 encoding of the salt is provided in the authInfo field. The salt MUST be at least 64 bits long. Implementations of this scheme MUST support salts up to 128 bits in length ✨

Example:

Given a user "joe" who's password is "mary" and a salt of "salt",
the authInfo field would be the base64 encoding of "salt" and the
authValue field would be the base64 encoding of the SHA1 digest of
"marysalt".

A match against an asserted password and an attribute value of this scheme SHALL be true if and only if the SHA1 digest of the concatenation of the asserted value and the salt is equal to the SHA1 digest contained in AuthValue. The match SHALL be undefined if the server is unable to complete the equality test for any reason. Otherwise the match SHALL be false 🧁

Values of this scheme SHOULD only be used to implement simple user/password authentication πŸ’–

5. Security Considerations πŸ”’βœ¨

Okay bestie, this is the serious part, so let's go πŸ’…

This document is about how authentication information can be stored in a directory. Authentication information MUST be adequately protected, because if it leaks, attackers can get immediate access to the directory, as described in [RFC2829]. 😭

Think of AuthPassword values like your real diary passwords. Lock them down. πŸ”

Hashing algorithms can have flaws, and so can particular implementations of them. Values could also be attacked in various ways if they get exposed. That's why values of AuthPassword SHOULD be protected as if they were clear text passwords. πŸ™ˆ When values get transferred, privacy protections like IPSEC or TLS SHOULD be in place. πŸ›‘οΈ

Clients SHOULD use strong authentication mechanisms [RFC2829]. No weak sauce here. πŸ’ͺ

The AuthPasswordMatch matching rule lets applications test whether a user's password is valid, so it can be used to mount an attack. Servers SHOULD take appropriate measures to protect the directory from these attacks. 🚨

Some password schemes may need CPU intensive operations. Servers SHOULD take appropriate measures to protect against Denial of Service attacks. Nobody wants a server that gets exhausted. πŸ₯΅

AuthPassword does not restrict an authentication identity to a single password. An attacker who gets write access to this attribute could store extra values without disabling the user's true password(s). Use of policy aware clients and servers is RECOMMENDED. 🧚

The level of protection against different attacks differs from scheme to scheme. It is RECOMMENDED that servers support scheme selection as a configuration item. That way, a scheme can be easily disabled if a significant security flaw is discovered. πŸ’œ


6. Acknowledgment 🫢

This document borrows from a number of IETF documents and is based upon input from the IETF LDAPext working group. Shoutout to them, they're iconic. πŸ‘‘

7. Bibliography πŸ“š

[RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321,
          April 1992

[RFC2219] Bradner, S., "Key words for use in RFCs to Indicate
          Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2234] Crocker, D., Editor, P. Overell, "Augmented BNF for Syntax
          Specifications: ABNF", RFC 2234, November 1997.

[RFC2251] Wahl, M., Howes, T. and S. Kille, "Lightweight Directory
          Access Protocol (v3)", RFC 2251, December 1997.

[RFC2252] Wahl, M., Coulbeck, A., Howes, T., and S. Kille,
          "Lightweight Directory Access Protocol (v3): Attribute
          Syntax Definitions", RFC 2252, December 1997.

[RFC2256] Wahl, A., "A Summary of the X.500(96) User Schema for use
          with LDAPv3", RFC 2256, December 1997.

[RFC2307] Howard, L., "An Approach for Using LDAP as a Network
          Information Service", RFC 2307, March 1998.

[RFC2829] Wahl, M., Alvestrand, H., Hodges, J. and R. Morgan,
          "Authentication Methods for LDAP", RFC 2829, June 2000.

[RFC3062] Zeilenga, K., "LDAP Password Modify Extended Operation",
          RFC 3062, February 2001.

[SHA1]    NIST, FIPS PUB 180-1: Secure Hash Standard, April 1995.

8. Author's Address πŸ¦‹

Kurt D. Zeilenga
OpenLDAP Foundation

EMail: Kurt@OpenLDAP.org

Here's the legal stuff, copied word for word so nothing gets lost.

Copyright (C) The Internet Society (2001).  All Rights Reserved.

This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works.  However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.

The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement 🌸

Funding for the RFC Editor function is currently provided by the Internet Society. Thank you to them, periodt. ✨

πŸ“¦ where this page comes from