RFC 4422

Simple Authentication and Security Layer (SASL)

๐Ÿ“… published June 2006, from ietf

RFC 4422 ๐ŸŽ€

Network Working Group ๐Ÿ’… Request for Comments: 4422 โœจ Category: Standards Track ๐Ÿ‘‘ Date: June 2006 ๐ŸŒธ Obsoletes: 2222 ๐Ÿ’€

Authors: A. Melnikov, Ed. (Isode Limited) and K. Zeilenga, Ed. (OpenLDAP Foundation) ๐Ÿซถ

Title: Simple Authentication and Security Layer (SASL) ๐Ÿฆ‹

Status of This Memo ๐Ÿ“œ

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

Copyright (C) The Internet Society (2006).

Abstract ๐ŸŒˆ

okay so the Simple Authentication and Security Layer (SASL) is a framework for providing authentication and data security services in connection-oriented protocols via replaceable mechanisms ๐Ÿ”ฅ. It gives protocols and mechanisms a structured interface to talk through ๐Ÿ’–. The big payoff is that new protocols can reuse existing mechanisms, and old protocols can pick up new mechanisms too ๐Ÿงš. The framework also includes a protocol for securing the protocol exchanges that come after, inside a data security layer ๐Ÿ”.

This document explains how a SASL mechanism is structured, how protocols add SASL support, and it defines the protocol for carrying a data security layer over a connection ๐ŸŽ€. It also defines one SASL mechanism, the EXTERNAL mechanism โœจ.

This document obsoletes RFC 2222. ๐Ÿ’…

Table of Contents ๐Ÿ—‚๏ธ

   1. Introduction ....................................................3
      1.1. Document Audiences .........................................4
      1.2. Relationship to Other Documents ............................4
      1.3. Conventions ................................................5
   2. Identity Concepts ...............................................5
   3. The Authentication Exchange .....................................6
      3.1. Mechanism Naming ...........................................8
      3.2. Mechanism Negotiation ......................................9
      3.3. Request Authentication Exchange ............................9
      3.4. Challenges and Responses ...................................9
           3.4.1. Authorization Identity String ......................10
      3.5. Aborting Authentication Exchanges .........................10
      3.6. Authentication Outcome ....................................11
      3.7. Security Layers ...........................................12
      3.8. Multiple Authentications ..................................12
   4. Protocol Requirements ..........................................13
   5. Mechanism Requirements .........................................16
   6. Security Considerations ........................................18
      6.1. Active Attacks ............................................19
           6.1.1. Hijack Attacks .....................................19
           6.1.2. Downgrade Attacks ..................................19
           6.1.3. Replay Attacks .....................................20
           6.1.4. Truncation Attacks .................................20
           6.1.5. Other Active Attacks ...............................20
      6.2. Passive Attacks ...........................................20
      6.3. Re-keying .................................................21
      6.4. Other Considerations ......................................21
   7. IANA Considerations ............................................22
      7.1. SASL Mechanism Registry ...................................22
      7.2. Registration Changes ......................................26
   8. References .....................................................26
      8.1. Normative References ......................................26
      8.2. Informative References ....................................27
   9. Acknowledgements ...............................................28
   Appendix A.  The SASL EXTERNAL Mechanism ..........................29
      A.1. EXTERNAL Technical Specification ..........................29
      A.2. SASL EXTERNAL Examples ....................................30
      A.3. Security Considerations ...................................31
   Appendix B.  Changes since RFC 2222 ...............................31

1. Introduction โœจ

okay so SASL is a framework for providing authentication and data security services in connection-oriented protocols via replaceable mechanisms ๐Ÿ’–. It gives protocols and mechanisms a structured interface between them ๐Ÿซถ. SASL also has a protocol for securing the exchanges that follow, inside a data security layer ๐Ÿ”. That layer can provide data integrity, data confidentiality, and other services ๐Ÿฆ‹.

SASL's design lets new protocols reuse existing mechanisms without needing the mechanisms redesigned, and lets existing protocols use new mechanisms without needing the protocols redesigned ๐Ÿงš. It's giving modular ๐Ÿ’….

SASL is basically an abstraction layer sitting between protocols and mechanisms. Here's the picture ๐ŸŒธ:

                  SMTP    LDAP    XMPP   Other protocols ...
                     \       |    |      /
                      \      |    |     /
                     SASL abstraction layer
                      /      |    |     \
                     /       |    |      \
              EXTERNAL   GSSAPI  PLAIN   Other mechanisms ...

Through the interfaces of this layer, the framework lets any protocol use any mechanism ๐ŸŽ€. The layer mostly hides the particulars of protocols from mechanisms, and the particulars of mechanisms from protocols. It does not fully hide the particulars of mechanisms from protocol implementations ๐Ÿ‘€. Different mechanisms need different information to operate ๐Ÿ”‘. Some use password-based authentication, some need realm information, and others use Kerberos tickets, certificates, and so on ๐Ÿ“. Also, to do authorization, server implementations usually have to map between authentication identities (whose form is mechanism specific) and authorization identities (whose form is application protocol specific) ๐Ÿชž. Section 2 talks about identity concepts ๐Ÿ†”.

You can design and implement this framework in ways that do abstract away the particulars of similar mechanisms ๐Ÿงฉ. A framework implementation, and the mechanism implementations, could be shared not just by multiple implementations of one protocol, but by implementations of multiple protocols ๐ŸŒˆ.

The framework has interfaces with both protocols and mechanisms, and that's where the authentication exchanges happen โญ. Section 3 covers SASL authentication exchanges ๐Ÿ“š.

To use SASL, each protocol (among other things) needs a way to say which mechanism is being used, a way to exchange mechanism-specific server-challenges and client-responses, and a way to communicate the outcome of the authentication exchange ๐Ÿ’œ. Section 4 covers SASL protocol requirements ๐Ÿ“‹.

Each SASL mechanism defines (among other things) a series of server-challenges and client-responses that provide authentication services and negotiate data security services ๐Ÿ”ฅ. Section 5 covers SASL mechanism requirements ๐Ÿ›ก๏ธ.

Section 6 covers security considerations ๐Ÿ˜ญ. Section 7 covers IANA considerations ๐Ÿ—‚๏ธ. Appendix A defines the SASL EXTERNAL mechanism ๐Ÿฆ‹.

1.1. Document Audiences ๐ŸŽ€

This document is written for a few different audiences ๐Ÿซถ:

  • protocol designers who are using this spec to add authentication to their protocol,
  • mechanism designers who are defining new SASL mechanisms, and
  • implementors of clients or servers for protocols that support SASL.

The document is organized so you can jump straight to the details that matter for your engineering ๐Ÿ’…. Still, readers are encouraged to read and understand all aspects of it, ngl ๐Ÿ™ˆ.

1.2. Relationship to Other Documents ๐Ÿฆ‹

This document obsoletes RFC 2222 ๐ŸŒธ. It replaces all parts of RFC 2222 except sections 7.1 (the KERBEROS_IV mechanism), 7.2 (the GSSAPI mechanism), and 7.3 (the SKEY mechanism) ๐Ÿ“. The KERBEROS_IV and SKEY mechanisms are now seen as obsolete, and their specifications in RFC 2222 are Historic ๐Ÿ•ฐ๏ธ. The GSSAPI mechanism now has its own separate spec [SASL-GSSAPI] โœจ.

Appendix B has a summary of changes since RFC 2222 ๐Ÿ“.

1.3. Conventions ๐Ÿ’…

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 BCP 14 [RFC2119] ๐Ÿ‘‘. Yes, these are the official requirement words, so pay attention to them ๐Ÿ™ˆ.

Character names in this document use the notation for code points and names from the Unicode Standard [Unicode] ๐ŸŒ. For example, the letter "a" may be written as either <U+0061> or <LATIN SMALL LETTER A> ๐Ÿ”ค.

Note: a glossary of Unicode terms is in [Glossary]. Info on the Unicode character encoding model is in [CharModel] ๐Ÿ“–.

In examples, C: and S: mark lines sent by the client and the server, respectively ๐Ÿงš. The lines have been wrapped so they're easier to read ๐ŸŒท.


Part 2 is coming next, bestie ๐Ÿซถ๐Ÿ’œ

2. Identity Concepts โœจ

okay so in the real world, auth and authz can involve multiple identities, and they can look totally different: a simple username, a Kerberos principal, an X.500 Distinguished Name, etc. They can also be represented in different ways, like an ABNF-described UTF-8 encoded Unicode character string or a BER-encoded Distinguished Name ๐Ÿงš. Technical specs often dictate the identity form and representation used on the wire, but implementations often (honestly, usually ๐Ÿ’…) use different forms and/or representations internally. How identities of different forms relate to each other is generally a local matter, and so are the forms and representations used within an implementation.

That said, conceptually, the SASL framework involves two identities:

  1. an identity associated with the authentication credentials (termed the authentication identity), and
  2. an identity to act as (termed the authorization identity).

SASL mechanism specs describe the credential form(s) used to authenticate the client (X.509 certificates, Kerberos tickets, simple username/password, etc.), including, where appropriate, the syntax and semantics of the authentication identities carried in those credentials. SASL protocol specs describe the identity form(s) used in authorization and, in particular, prescribe the syntax and semantics of the authorization identity character string that mechanisms transfer ๐ŸŽ€.

The client provides its credentials (which include or imply an authentication identity) and, optionally, a character string representing the requested authorization identity as part of the SASL exchange. When this string is omitted or empty, the client is requesting to act as the identity associated with its credentials. So, for example, the user is requesting to act as the authentication identity ๐Ÿฆ‹.

The server is responsible for verifying the client's credentials, and for verifying that the identity it associates with those credentials (e.g., the authentication identity) is allowed to act as the authorization identity. A SASL exchange fails if either (or both) of these verifications fails. (The SASL exchange may fail for other reasons too, such as service authorization failure.)

However, the precise forms of the authentication identities (used within the server in its verifications, or otherwise) and the precise forms of the authorization identities (used in making authorization decisions, or otherwise) are beyond the scope of SASL and this specification. In some circumstances, the precise identity forms used in some context outside the SASL exchange may be dictated by other specifications. For instance, an identity assumption authorization (proxy authorization) policy specification may dictate how authentication and authorization identities are represented in policy statements ๐ŸŒธ.


3. The Authentication Exchange

each authentication exchange is a little dance ๐Ÿ’ƒ. It starts with a message from the client to the server requesting authentication via a particular mechanism. Then come one or more pairs of challenges from the server and responses from the client. It ends with a message from the server indicating the outcome of the exchange. (Note: exchanges may also be aborted, as discussed in Section 3.5.)

Here's the high-level overview:

C: Request authentication exchange
S: Initial challenge
C: Initial response
<additional challenge/response messages>
S: Outcome of authentication exchange

If the outcome is successful and a security layer was negotiated, this layer is then installed (see Section 3.7). This also applies to the following illustrations.

Some mechanisms specify that the first data sent in the exchange is from the client to the server. Protocols may provide an optional initial response field in the request message to carry this data. When the mechanism specifies that the first data goes client-to-server, the protocol provides that optional initial response field, and the client uses it, the exchange gets shortened by one round-trip. Iconic ๐Ÿ”ฅ:

C: Request authentication exchange + Initial response
<additional challenge/response messages>
S: Outcome of authentication exchange

When the mechanism specifies that the first data is client-to-server and this field is unavailable or unused, the client request is followed by an empty challenge:

C: Request authentication exchange
S: Empty Challenge
C: Initial Response
<additional challenge/response messages>
S: Outcome of authentication exchange
Should a client include an initial response in its request where the mechanism does not allow the client to send data first, the authentication exchange fails. Do NOT do this, bestie ๐Ÿ™ˆ.

Some mechanisms specify that the server is to send additional data to the client when indicating a successful outcome. Protocols may provide an optional additional data field in the outcome message to carry this data. When the mechanism specifies that the server returns additional data with the successful outcome, the protocol provides that optional field, and the server uses it, the exchange is shortened by one round-trip:

C: Request authentication exchange
S: Initial challenge
C: Initial response
<additional challenge/response messages>
S: Outcome of authentication exchange with
   additional data with success

When the mechanism specifies that the server returns additional data with a successful outcome and this field is unavailable or unused, the additional data is sent as a challenge whose response is empty. After receiving that response, the server then indicates the successful outcome ๐Ÿซถ:

C: Request authentication exchange
S: Initial challenge
C: Initial response
<additional challenge/response messages>
S: Additional data challenge
C: Empty Response
S: Outcome of authentication exchange

Last one, and it's the glow-up ๐ŸŒˆ. When mechanisms specify that the first data is client-to-server and the additional data goes to the client alongside a successful outcome, and the protocol provides fields supporting both, the exchange takes two fewer round-trips:

C: Request authentication exchange + Initial response
<additional challenge/response messages>
S: Outcome of authentication exchange
   with additional data with success

instead of:

C: Request authentication exchange
S: Empty Challenge
C: Initial Response
<additional challenge/response messages>
S: Additional data challenge
C: Empty Response
S: Outcome of authentication exchange

3.1. Mechanism Naming

SASL mechanisms are named by character strings, from 1 to 20 characters in length, made up of ASCII [ASCII] uppercase letters, digits, hyphens, and/or underscores. In the following Augmented Backus-Naur Form (ABNF) [RFC4234] grammar, the <sasl-mech> production defines the syntax of a SASL mechanism name ๐Ÿ“:

sasl-mech    = 1*20mech-char
mech-char    = UPPER-ALPHA / DIGIT / HYPHEN / UNDERSCORE
; mech-char is restricted to A-Z (uppercase only), 0-9, -, and _
; from ASCII character set.

UPPER-ALPHA  = %x41-5A  ; A-Z (uppercase only)
DIGIT        = %x30-39  ; 0-9
HYPHEN       = %x2D ; hyphen (-)
UNDERSCORE   = %x5F ; underscore (_)

SASL mechanism names are registered as discussed in Section 7.1.

3.2. Mechanism Negotiation

Mechanism negotiation is protocol specific. ๐ŸŒธ

Commonly, a protocol will specify that the server advertises its supported and available mechanisms to the client via some facility the protocol provides. The client then selects the "best" mechanism from that list that it supports and finds suitable.

Note that mechanism negotiation is not protected by the subsequent authentication exchange, so it's subject to downgrade attacks if it isn't protected by other means. Yikes ๐Ÿ˜ญ.

To detect downgrade attacks, a protocol can allow the client to discover available mechanisms after the authentication exchange and the installation of data security layers with at least data integrity protection. This lets the client detect changes to the list of mechanisms the server supports ๐Ÿ•ต๏ธโ€โ™€๏ธ.

3.3. Request Authentication Exchange

The authentication exchange is initiated by the client, which requests authentication via a mechanism it specifies. The client sends a message containing the name of the mechanism to the server. The particulars of that message are protocol specific.

Note that the name of the mechanism is not protected by the mechanism itself, so it's subject to alteration by an attacker if it isn't integrity protected by other means ๐Ÿ‘€.

Where the mechanism is defined to allow the client to send data first, and the protocol's request message includes an optional initial response field, the client may include the response to the initial challenge in the authentication request message ๐Ÿ’–.

3.4. Challenges and Responses

The authentication exchange involves one or more pairs of server-challenges and client-responses, whose particulars are mechanism specific. These challenges and responses are enclosed in protocol messages, whose particulars are protocol specific.

Through these challenges and responses, the mechanism may:

  • authenticate the client to the server,
  • authenticate the server to the client,
  • transfer an authorization identity string,
  • negotiate a security layer, and
  • provide other services.

Negotiating the security layer may involve negotiating the security services to be provided in the layer, how those services will be provided, and a maximum cipher-text buffer size each side is able to receive in the layer (see Section 3.6). Lowkey a lot going on there ๐Ÿง .

After receiving an authentication request or any client response, the server may issue a challenge, abort the exchange, or indicate the outcome of the exchange. After receiving a challenge, a client mechanism may issue a response or abort the exchange.

3.4.1. Authorization Identity String

The authorization identity string is a sequence of zero or more Unicode [Unicode] characters, excluding the NUL (U+0000) character, representing the identity to act as ๐Ÿ“.

If the authorization identity string is absent, the client is requesting to act as the identity the server associates with the client's credentials. An empty string is equivalent to an absent authorization identity.

A non-empty authorization identity string indicates that the client wishes to act as the identity the string represents. In this case, the form of identity the string represents, as well as the precise syntax and semantics of the string, are protocol specific.

While the character encoding scheme used to transfer the authorization identity string in the authentication exchange is mechanism specific, mechanisms are expected to be capable of carrying the entire Unicode repertoire (with the exception of the NUL character). Main character energy, every single emoji in the book ๐Ÿ“šโœจ.

3.5. Aborting Authentication Exchanges ๐Ÿ›‘

okay so sometimes a client or server is just like "nope, I'm out" ๐Ÿ™…โ€โ™€๏ธ and that's totally valid if they're unwilling or unable to keep going (or to enter into it at all) ๐Ÿ’…

A client can abort the exchange by sending a message to the server saying the exchange is aborted ๐Ÿ™ˆ The particulars of that message depend on the protocol. The protocol may require the server to send back a message in response to the client's abort message, so the server doesn't just leave the client hanging ๐Ÿซถ

Likewise, a server can abort the exchange by sending a message to the client saying it's aborted. Again, the exact details are protocol specific โœจ

3.6. Authentication Outcome ๐Ÿ

at the end of the exchange, the server sends the client a message telling it the outcome ๐Ÿ“ฌ The particulars of that message are protocol specific, so each protocol gets to decide its own vibe ๐Ÿ’œ

the outcome is not successful if any of these things happen:

  • the authentication exchange failed for any reason, ๐Ÿ’€
  • the client's credentials could not be verified,
  • the server cannot associate an identity with the client's credentials,
  • the client-provided authorization identity string is malformed,
  • the identity associated with the client's credentials is not authorized to act as the requested authorization identity,
  • the negotiated security layer (or lack thereof) is not suitable, or
  • the server is not willing to provide service to the client for any reason. ๐Ÿ™…โ€โ™€๏ธ

the protocol may include an optional additional data field in this outcome message ๐ŸŽ€ But here's the tea: this field can only carry additional data when the outcome is successful ๐Ÿ‘‘

if the outcome is successful and a security layer was negotiated, that layer gets installed right then ๐Ÿ”’ If the outcome is unsuccessful, or no security layer was negotiated, any existing security just stays exactly where it is ๐Ÿงš

the outcome message from the server can help the client tell apart three kinds of errors ๐ŸŒˆ One kind is best handled by re-prompting the user for her credentials. Another is best handled by telling the user to try again later. The last kind is when the user has to contact a system administrator to get it sorted. (The SYS and AUTH POP Response Codes [RFC3206] specification has an example of this.) This distinction is super useful during scheduled server maintenance, because it cuts down on support costs ๐Ÿ’–

it's also important that the server can be configured so the outcome message does not reveal whether someone is a valid user with invalid credentials or an invalid user altogether ๐Ÿ™ˆ That's a major privacy-and-security glow-up ๐Ÿ‘€


3.7. Security Layers ๐Ÿ›ก๏ธ

SASL mechanisms can offer a whole buffet of services in security layers ๐Ÿ“ The typical ones are data integrity and data confidentiality ๐Ÿ” SASL mechanisms that don't provide a security layer are treated as negotiating no security layer, so no drama there ๐ŸŒธ

if a security layer is negotiated during the authentication exchange, the server installs it after it has told the client the outcome of the exchange. The client installs it once it receives that outcome indication ๐Ÿค In both cases, the layer gets installed before any further protocol data is transferred. Exactly where in the protocol data stream the layer takes effect is protocol specific โœจ

once a security layer is in effect in the protocol data stream, it stays in effect until either a different security layer gets negotiated and installed, or the underlying transport connection is closed ๐Ÿฆ‹

when a security layer is in effect, it turns protocol data into buffers of protected data ๐Ÿง If at any point the security layer is unable or unwilling to keep producing buffers that protect the protocol data, the underlying transport connection MUST be closed ๐Ÿšจ Same goes if the security layer can't decode a received buffer: the underlying connection MUST be closed ๐Ÿšจ In both of those situations, the underlying transport connection SHOULD be closed gracefully ๐Ÿ’…

each buffer of protected data travels over the underlying transport connection as a sequence of octets with a four-octet length field in front of it. That field is in network byte order and says how long the buffer is ๐Ÿ”ข The length of the protected data buffer MUST be no larger than the maximum size the other side expects ๐Ÿ“ If the receiver gets a length field bigger than that maximum size, it SHOULD close the connection, because that could be a sign of an attack ๐Ÿ‘€โš ๏ธ

the maximum size each side expects is fixed by the mechanism, either through negotiation or by the mechanism's specification ๐Ÿง 

3.8. Multiple Authentications ๐Ÿ”

unless the protocol explicitly permits it (as stated in the protocol's technical specification), only one successful SASL authentication exchange can happen in a protocol session ๐Ÿ™…โ€โ™€๏ธ So once an exchange has completed successfully, any further attempts to start one will fail ๐Ÿ’€

where the protocol does permit multiple successful SASL authentication exchanges, multiple SASL security layers can never be in effect at the same time ๐Ÿ™ƒ If a security layer is already in effect and a later SASL negotiation picks a second one, the second layer replaces the first ๐Ÿ”„ If a security layer is in effect and a later SASL negotiation picks no security layer, the original security layer stays in effect ๐Ÿซถ

where multiple successful SASL negotiations are allowed, what a failed SASL authentication exchange does to the previously established authentication and authorization state is protocol specific ๐ŸŽญ The protocol's technical specification should be consulted to find out whether that previous state stays in force, changes to an anonymous state, or gets affected some other way. Whatever the protocol does to that previous state, the previously negotiated security layer remains in effect ๐Ÿ”’โœจ

4. Protocol Requirements โœจ

okay bestie, so if a protocol wants to offer SASL services, its specification MUST supply the following information ๐Ÿ’…

  1. Service name ๐Ÿท๏ธ Pick one from the registry of "service" elements for the Generic Security Service Application Program Interface (GSSAPI) host-based service name form, as described in Section 4.1 of [RFC2743]. Fun fact: this registry is shared by all GSSAPI and SASL mechanisms ๐Ÿค
  2. Mechanism negotiation ๐Ÿค Detail any mechanism negotiation facility that the protocol provides (see Section 3.2).

A protocol SHOULD specify a facility that lets the client discover the names of the SASL mechanisms the server offers. This discovery can happen before the SASL exchange starts, and also after the security layers negotiated by the exchange are installed. The second part matters a lot because it lets the client catch downgrade attacks ๐Ÿ•ต๏ธโ€โ™€๏ธ This facility is typically provided through the protocol's extensions or capabilities discovery facility.

  1. Authentication messages ๐Ÿ’Œ Define the messages needed for the authentication exchange, including the following:
    • a) A message to start the authentication exchange (see Section 3.3). This message MUST contain a field for carrying the name of the mechanism the client picked. It SHOULD also contain an optional field for carrying an initial response. If the message has that field, the specification MUST explain how a message with an empty initial response is told apart from a message with no initial response ๐Ÿง And that field MUST be able to carry arbitrary sequences of octets, including zero-length ones and ones containing zero-valued octets ๐Ÿ“
    • b) Messages that send server challenges and client responses (see Section 3.4). Each of these MUST be able to carry arbitrary sequences of octets, including zero-length sequences and sequences containing zero-valued octets ๐ŸŒˆ
    • c) A message that says how the authentication exchange turned out (see Section 3.6). This message SHOULD contain an optional field for carrying additional data with a successful outcome. If the message has that field, the specification MUST explain how a message with empty additional data is told apart from a message with no additional data. That field MUST be able to carry arbitrary sequences of octets, including zero-length sequences and sequences containing zero-valued octets ๐Ÿฆ‹
  2. Authorization identity strings ๐Ÿชช Spell out the syntax and meaning of non-empty authorization identity strings (see Section 3.4.1).

To avoid interoperability headaches caused by different normalizations, the protocol specification MUST detail precisely how and where (client or server) non-empty authorization identity strings are prepared. That includes all normalizations, for comparison and any other relevant functions, so everything works properly โœจ

Specifications are encouraged to use existing authorization identity forms, as well as existing string representations such as simple user names [RFC4013]. ๐Ÿ’–

If the specification doesn't precisely say how identities in SASL relate to identities used elsewhere in the protocol (for example, in access control policy statements), it may be appropriate for the protocol to offer a facility. With it, the client can discover information about established identities, such as the representation of the identity used for access control decisions ๐Ÿ”

  1. Aborting ๐Ÿ›‘ Detail any facility the protocol provides that lets the client and/or server abort an authentication exchange (see Section 3.5).

Protocols that support multiple authentications typically let a client abort an ongoing authentication exchange by starting a new one. Protocols that don't support multiple authentications may require the client to close the connection and start over in order to abort an ongoing authentication exchange ๐Ÿ”„

Protocols typically let the server abort ongoing authentication exchanges by returning a non-successful outcome message ๐Ÿ™…โ€โ™€๏ธ

  1. Where security layers kick in โฐ Identify precisely where newly negotiated security layers start to take effect, in both directions (see Section 3.7).

Typically, specifications have security layers start taking effect on the first octet following the outcome message in data sent by the server, and on the first octet sent after receiving the outcome message in data sent by the client ๐ŸŽ€

  1. Stacking other security layers ๐Ÿฅž If the protocol supports other layered security services, such as Transport Layer Security (TLS) [RFC4346], the specification MUST prescribe the order in which security layers are applied to protocol data.

For instance, if a protocol supports both TLS and SASL security layers, the specification could prescribe any of the following:

  • a) The SASL security layer is always applied first to data being sent, and therefore applied last to received data ๐ŸŒธ
  • b) The SASL security layer is always applied last to data being sent, and therefore applied first to received data ๐ŸŒธ
  • c) Layers are applied in the order they were installed ๐ŸŒธ
  • d) Layers are applied in the reverse order they were installed ๐ŸŒธ
  • e) Both TLS and SASL security layers cannot be installed ๐Ÿ™…โ€โ™€๏ธ
  1. Multiple authentications ๐Ÿ‘ฏ Indicate whether the protocol supports multiple authentications (see Section 3.8). If it does, the protocol MUST detail the effect a failed SASL authentication exchange has on a previously established authentication and authorization state ๐Ÿ’€

Protocol specifications SHOULD avoid stating implementation requirements that would get in the way of replacing applicable mechanisms. In general, protocol specifications SHOULD be mechanism neutral ๐Ÿง There are a few reasonable exceptions to this recommendation, including:

  • detailing how credentials (which are mechanism specific) are managed in the protocol,
  • detailing how authentication identities (which are mechanism specific) and authorization identities (which are protocol specific) relate to each other, and
  • detailing which mechanisms are applicable to the protocol.

5. Mechanism Requirements ๐Ÿ”ฅ

SASL mechanism specifications MUST supply the following information, no cap ๐Ÿงข

  1. Mechanism name ๐Ÿท๏ธ The name of the mechanism (see Section 3.1). This name MUST be registered as discussed in Section 7.1.
  2. Challenges and responses ๐Ÿ—ฃ๏ธ Define the server-challenges and client-responses of the authentication exchange, plus the following:
    • a) Say whether the mechanism is client-first, variable, or server-first. If a SASL mechanism is client-first and the client doesn't send an initial response in the authentication request, then the first server challenge MUST be empty (the EXTERNAL mechanism is an example of this case). If a SASL mechanism is variable, the specification needs to say how the server behaves when the initial client response in the authentication request is left out (the DIGEST-MD5 mechanism [DIGEST-MD5] is an example of this case). If a SASL mechanism is server-first, then the client MUST NOT send an initial client response in the authentication request (the CRAM-MD5 mechanism [CRAM-MD5] is an example of this case) ๐Ÿงฉ
    • b) Say whether the server is expected to provide additional data when indicating a successful outcome. If it does, and the server sends that additional data as a challenge, the specification MUST indicate that the response to this challenge is an empty response ๐Ÿ’œ

SASL mechanisms SHOULD be designed to minimize the number of challenges and responses needed to finish the exchange ๐Ÿƒโ€โ™€๏ธ

  1. Authorization identity capability ๐Ÿชช Say whether the mechanism can transfer authorization identity strings (see Section 3.4.1). Some legacy mechanisms can't transmit an authorization identity, which means that for those mechanisms the authorization identity is always the empty string ๐Ÿ™ƒ Newly defined mechanisms SHOULD be able to transfer authorization identity strings. The mechanism SHOULD NOT be able to transfer both no authorization identity string and an empty authorization identity ๐Ÿคฏ

Mechanisms that can transfer an authorization identity string MUST be able to transfer arbitrary non-empty sequences of Unicode characters, excluding those that contain the NUL (U+0000) character. Mechanisms SHOULD use the UTF-8 [RFC3629] transformation format. The specification MUST detail how any Unicode code points special to the mechanism that might appear in the authorization identity string are escaped, so there's no ambiguity when the string gets decoded. Typically, mechanisms with special characters require those characters to be escaped or encoded in the character string (after it's encoded in a particular Unicode transformation format) using a data encoding scheme such as Base64 [RFC3548] ๐Ÿ”

  1. Security layer ๐Ÿ›ก๏ธ The specification MUST detail whether the mechanism offers a security layer. If it does, the specification MUST detail the security and other services offered in the layer, as well as how those services are to be implemented โœจ
  2. Integrity protection ๐Ÿ”’ If the underlying cryptographic technology used by a mechanism supports data integrity, then the mechanism specification MUST integrity protect the transmission of an authorization identity and the negotiation of the security layer ๐Ÿ’–

SASL mechanisms SHOULD be protocol neutral ๐ŸŒ

SASL mechanisms SHOULD reuse existing credential and identity forms, as well as their associated syntaxes and semantics ๐Ÿซถ

SASL mechanisms SHOULD use the UTF-8 transformation format [RFC3629] for encoding Unicode [Unicode] code points for transfer ๐ŸŒธ

To avoid interoperability problems caused by different normalizations, when a mechanism calls for character data (other than the authorization identity string) to be used as input to a cryptographic and/or comparison function, the specification MUST detail precisely how and where (client or server) that character data is prepared, including all normalizations, before it goes into the function. That's how you make sure it works properly ๐Ÿงผ

For simple user names and/or passwords in authentication credentials, SASLprep [RFC4013] (a profile of the StringPrep [RFC3454] preparation algorithm) SHOULD be specified as the preparation algorithm ๐Ÿงด

The mechanism SHOULD NOT use the authorization identity string when generating any long-term cryptographic keys or hashes, because there's no requirement that the authorization identity string be canonical ๐Ÿ™…โ€โ™€๏ธ Here, "long-term" means a period longer than the duration of the authentication exchange in which the keys or hashes were generated. Different clients (of the same or different protocol) may provide different authorization identity strings that are semantically equivalent. So using authorization identity strings to generate cryptographic keys and hashes will likely lead to interoperability and other problems ๐Ÿ’€

6. Security Considerations โœจ

okay bestie, security is literally threaded through this whole memo ๐Ÿ” so let's get into it. no cap.

Lots of existing SASL mechanisms don't protect the authentication exchange against passive attacks, let alone active ones ๐Ÿ˜ฌ. A bunch of them also don't offer security layers at all. The hope is that future SASL mechanisms give strong protection against passive and active attacks in the authentication exchange, plus security layers with strong basic data security features (e.g., data integrity and data confidentiality) services ๐Ÿ›ก๏ธ. It's also hoped that future mechanisms get even fancier and offer things like re-keying (see Section 6.3) ๐Ÿ”‘.

Anyway, the SASL framework is still open to downgrade attacks ๐Ÿ‘€. Section 6.1.2 has a variety of approaches for preventing or detecting these. Sometimes it makes sense to use data integrity protective services from outside SASL (e.g., TLS) to guard against downgrade attacks in SASL. External protective security services matter a lot too when the mechanisms available don't offer enough integrity and/or confidentiality protection for the authentication exchange and/or protocol data on their own ๐Ÿ’….

6.1. Active Attacks

6.1.1. Hijack Attacks

When the client picks a SASL security layer with at least integrity protection, that protection is a counter-measure against an active attacker who hijacks the connection and tries to modify protocol data sent after the security layer is set up ๐Ÿ™…โ€โ™€๏ธ. Implementations SHOULD close the connection when the security services in a SASL security layer report protocol data report lack of data integrity.

6.1.2. Downgrade Attacks

It's important that any security-sensitive protocol negotiations happen after a security layer with data integrity protection is installed ๐Ÿงฑ. Protocols should be designed so that negotiations done before this installation get revalidated once installation is complete. Negotiation of the SASL mechanism is security sensitive, so this really counts ๐Ÿ’ฏ.

When a client negotiates the authentication mechanism with the server and/or other security features, it's possible for an active attacker to make a party use the least secure security services available ๐Ÿ˜ˆ. For instance, an attacker can modify the server-advertised mechanism list, or can modify the client-advertised security feature list within a mechanism response. To protect against this sort of attack, implementations SHOULD NOT advertise mechanisms and/or features that can't meet their minimum security requirements, SHOULD NOT enter into or continue authentication exchanges that can't meet their minimum security requirements, and SHOULD verify that completed authentication exchanges result in security services that meet their minimum security requirements. Note that each endpoint needs to independently verify that its security requirements are met ๐Ÿซถ.

Every endpoint has to check its own security requirements. Nobody gets to check them for you ๐Ÿ™ˆ

In order to detect downgrade attacks to the least (or less) secure mechanism supported, the client can discover the SASL mechanisms the server makes available both before the SASL authentication exchange and after the negotiated SASL security layer (with at least data integrity protection) has been installed, using the protocol's mechanism discovery facility ๐Ÿ”. If the client finds that the integrity-protected list (the list obtained after the security layer was installed) contains a stronger mechanism than the ones in the previously obtained list, the client should assume that the previously obtained list was modified by an attacker, and SHOULD close the underlying transport connection ๐Ÿšจ.

The client's initiation of the SASL exchange, including the selection of a SASL mechanism, is done in the clear and may be modified by an active attacker ๐Ÿ‘€. It's important for any new SASL mechanisms to be designed so that an active attacker can't get an authentication with weaker security properties by modifying the SASL mechanism name and/or the challenges and responses.

Multi-level negotiation of security features is prone to downgrade attacks. Protocol designers should avoid offering higher-level negotiation of security features in protocols (e.g., above SASL mechanism negotiation), and mechanism designers should avoid lower-level negotiation of security features in mechanisms (e.g., below SASL mechanism negotiation) ๐Ÿ™…โ€โ™€๏ธ.

6.1.3. Replay Attacks

Some mechanisms may be subject to replay attacks unless they're protected by external data security services (e.g., TLS) ๐Ÿ”.

6.1.4. Truncation Attacks

Most existing SASL security layers don't protect against truncation attacks by themselves ๐Ÿ˜ฉ. In a truncation attack, the active attacker causes the protocol session to close, which truncates the possibly integrity-protected data stream. That leads to behavior from one or both protocol peers that inappropriately benefits the attacker. Truncation attacks are fairly easy to defend against in connection-oriented application-level protocols โœ‚๏ธ. A protocol can defend against them by making sure each information exchange has a clear final result, that each protocol session has a graceful closure mechanism, and that both of these are integrity protected.

6.1.5. Other Active Attacks

When a security layer's use is negotiated by the authentication protocol exchange, the receiver SHOULD handle gracefully any protected data buffer larger than the defined/negotiated maximal size ๐Ÿงบ. In particular, it MUST NOT blindly allocate the amount of memory specified in the buffer size field, because that might cause an "out of memory" condition ๐Ÿ’ฅ. If the receiver detects a large block, it SHOULD close the connection.

6.2. Passive Attacks

Lots of mechanisms are subject to various passive attacks ๐Ÿ‘‚. That includes simple eavesdropping on unprotected credential information, as well as online and offline dictionary attacks on protected credential information ๐Ÿ•ต๏ธโ€โ™€๏ธ.

6.3. Re-keying

The secure or administratively permitted lifetimes of SASL mechanisms' security layers are finite โณ. Cryptographic keys weaken as they're used and as time passes. The more time and/or cipher-text a cryptanalyst has after the first use of a key, the easier it is for them to mount attacks on that key ๐Ÿงฎ.

Administrative limits on a security layer's lifetime can take the form of time limits expressed in X.509 certificates, in Kerberos V tickets, or in directories, and they're often desired ๐Ÿ“œ. In practice, one likely effect of administrative lifetime limits is that applications may find their security layers stop working in the middle of application protocol operation, like during large data transfers ๐Ÿ˜ต. As a result, the connection will be closed (see Section 3.7), which makes for a pretty unpleasant user experience ๐Ÿ˜ญ.

Re-keying (the key renegotiation process) is a way of dealing with the weakening of cryptographic keys ๐Ÿ”„. The SASL framework doesn't provide for re-keying itself, but SASL mechanisms may. Designers of future SASL mechanisms should consider providing re-keying services.

Implementations that want to re-key SASL security layers where the mechanism doesn't provide for re-keying SHOULD reauthenticate the same IDs and replace the expired or soon-to-expire security layers ๐Ÿ”. This approach requires support for reauthentication in the application protocols (see Section 3.8).

6.4. Other Considerations

Protocol designers and implementors should understand the security considerations of mechanisms, so they can select mechanisms that fit their needs ๐Ÿง .

Distributed server implementations need to be careful about how they trust other parties ๐ŸŒ. In particular, authentication secrets should only be disclosed to other parties that are trusted to manage and use those secrets in a manner acceptable to the disclosing party. Applications using SASL assume that SASL security layers providing data confidentiality are secure even when an attacker chooses the text to be protected by the security layer ๐Ÿคจ. Similarly, applications assume that the SASL security layer is secure even if the attacker can manipulate the cipher-text output of the security layer. New SASL mechanisms are expected to meet these assumptions ๐Ÿ’œ.

Unicode security considerations [UTR36] apply to authorization identity strings, as well as UTF-8 [RFC3629] security considerations wherever UTF-8 is used. SASLprep [RFC4013] and StringPrep [RFC3454] security considerations also apply where they're used ๐Ÿ“š.

7. IANA Considerations ๐Ÿงพ

7.1. SASL Mechanism Registry

The SASL mechanism registry is maintained by IANA ๐Ÿ—‚๏ธ. It's currently available at http://www.iana.org/assignments/sasl-mechanisms.

The whole point of this registry is not only to make sure values used to name SASL mechanisms are unique, but also to provide a definitive reference to technical specifications detailing each SASL mechanism available for use on the Internet ๐ŸŒธ.

There's no naming convention for SASL mechanisms. Any name that conforms to the syntax of a SASL mechanism name can be registered ๐ŸŽ€.

The procedure detailed in Section 7.1.1 is used to register a value naming a specific individual mechanism โœ…. The procedure detailed in Section 7.1.2 is used to register a value naming a family of related mechanisms ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง.

Comments may be included in the registry as discussed in Section 7.1.3, and may be changed as discussed in Section 7.1.4 โœ๏ธ.

The SASL mechanism registry has been updated to reflect that this document provides the definitive technical specification for SASL, and that this section provides the registration procedures for this registry ๐Ÿฆ‹.

7.1.1. Mechanism Name Registration Procedure

IANA will register new SASL mechanism names on a First Come First Served basis, as defined in BCP 26 [RFC2434]. IANA has the right to reject obviously bogus registration requests, but won't review any claims made in the registration form ๐Ÿ™„.

Registering a SASL mechanism means filling in the following template ๐Ÿ“:

   Subject: Registration of SASL mechanism X

   SASL mechanism name (or prefix for the family):

   Security considerations:

   Published specification (recommended):

   Person & email address to contact for further information:

   Intended usage: (One of COMMON, LIMITED USE, or OBSOLETE)

   Owner/Change controller:

   Note: (Any other information that the author deems relevant may be
   added here.)

and sending it by electronic mail to IANA at iana@iana.org ๐Ÿ’Œ.

While this registration procedure doesn't require expert review, authors of SASL mechanisms are encouraged to seek community review and comment whenever that's feasible ๐Ÿซถ. Authors can seek community review by posting a specification of their proposed mechanism as an Internet-Draft. SASL mechanisms intended for widespread use should be standardized through the normal IETF process, when appropriate โœจ.

7.1.2. Family Name Registration Procedure ๐Ÿฆ‹

okay so there's no general naming convention for SASL mechanisms, no cap ๐Ÿ’…. But specs can totally reserve a chunk of the namespace for a bunch of related mechanisms, and that chunk is called a "family" โœจ. Each family gets a unique prefix, like X-. Registering a new family name needs expert review as defined in BCP 26 [RFC2434] ๐Ÿซถ.

Registering a SASL family name means filling in this template:

   Subject: Registration of SASL mechanism family X

   SASL family name (or prefix for the family):

   Security considerations:

   Published specification (recommended):

   Person & email address to contact for further information:

   Intended usage: (One of COMMON, LIMITED USE, or OBSOLETE)

   Owner/Change controller:

   Note: (Any other information that the author deems relevant may be
   added here.)

Then you send it by email to the IETF SASL mailing list at <ietf-sasl@imc.org> and carbon copy IANA at <iana@iana.org> ๐Ÿ“ง. The community gets two weeks to weigh in on the list. After that, the expert decides whether the request is appropriate and either approves or disapproves it, and tells the requestor, the mailing list, and IANA ๐Ÿ’Œ.

The review is all about whether the requested family name fits the proposed use, and whether the naming and registration plan for current and future mechanism names in that family makes sense ๐Ÿง. The expert can look at relevant parts of the technical spec, like its IANA Considerations section ๐Ÿ“‹. But this review is narrowly focused on whether the registration is appropriate. It is not a judgement on how sound the whole technical spec is, so don't get it twisted ๐Ÿ™…โ€โ™€๏ธ.

Authors are encouraged to get community review by posting the technical spec as an Internet-Draft and asking for comments on the appropriate IETF mailing lists ๐Ÿ“ฃ.

7.1.3. Comments on SASL Mechanism Registrations ๐Ÿ’ฌ

If you have a comment on a registered SASL mechanism or family, send it to the "owner" first, and/or to the <ietf-sasl@imc.org> mailing list ๐Ÿซถ.

If you've tried reaching the owner and it didn't work out, you can ask IANA to attach your comment to the SASL mechanism registration by emailing <iana@iana.org> ๐Ÿ“จ. IANA gets the final say here. At IANA's sole discretion, it may attach the comment to the SASL mechanism's registration ๐Ÿคทโ€โ™€๏ธ.

7.1.4. Change Control ๐Ÿ”„

Once IANA publishes a SASL mechanism registration, the author can request a change to its definition. That change request follows the same procedure as the registration request ๐Ÿ“.

The owner of a SASL mechanism can hand responsibility over to another person or agency by telling IANA. No discussion or review needed, bestie ๐Ÿฆ‹.

The IESG may reassign responsibility for a SASL mechanism. The most common reason is that the author of the registration has died, has moved out of contact, or is otherwise unable to make changes the community really needs ๐Ÿ•Š๏ธ. Lowkey heartbreaking, but it keeps things moving ๐Ÿฅน.

SASL mechanism registrations may not be deleted. If a mechanism is no longer believed appropriate for use, it can be declared OBSOLETE by changing its "intended usage" field. Those mechanisms stay on the lists IANA publishes, clearly marked ๐Ÿท๏ธ.

The IESG is considered the owner of all SASL mechanisms that are on the IETF standards track ๐Ÿ‘‘.

7.2. Registration Changes ๐Ÿ“š

The IANA updated the SASL mechanisms registry like this:

  1. It changed the "Intended usage" of the KERBEROS_V4 and SKEY mechanism registrations to OBSOLETE ๐Ÿชฆ.
  2. It changed the "Published specification" of the EXTERNAL mechanism to this document, as shown below ๐ŸŽ€:
      Subject: Updated Registration of SASL mechanism EXTERNAL
      Family of SASL mechanisms: NO
      SASL mechanism name: EXTERNAL
      Security considerations: See A.3 of RFC 4422
      Published specification (optional, recommended): RFC 4422
      Person & email address to contact for further information:
          Alexey Melnikov <Alexey.Melnikov@isode.com>
      Intended usage: COMMON
      Owner/Change controller: IESG <iesg@ietf.org>
      Note: Updates existing entry for EXTERNAL

8. References ๐Ÿ“–

8.1. Normative References ๐Ÿงท

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

   [RFC2244]     Newman, C. and J. G. Myers, "ACAP -- Application
                 Configuration Access Protocol", RFC 2244, November
                 1997.

   [RFC2434]     Narten, T. and H. Alvestrand, "Guidelines for Writing
                 an IANA Considerations Section in RFCs", BCP 26, RFC
                 2434, October 1998.

   [RFC2743]     Linn, J., "Generic Security Service Application Program
                 Interface Version 2, Update 1", RFC 2743, January 2000.

   [RFC3454]     Hoffman, P. and M. Blanchet, "Preparation of
                 Internationalized Strings ("stringprep")", RFC 3454,
                 December 2002.

   [RFC3629]     Yergeau, F., "UTF-8, a transformation format of ISO
                 10646", STD 63, RFC 3629, November 2003.

   [RFC4013]     Zeilenga, K., "SASLprep: Stringprep Profile for User
                 Names and Passwords", RFC 4013, February 2005.

   [RFC4234]     Crocker, D. and P. Overell, "Augmented BNF for Syntax
                 Specifications: ABNF", RFC 4234, October 2005.

   [ASCII]       Coded Character Set--7-bit American Standard Code for
                 Information Interchange, ANSI X3.4-1986.

   [Unicode]     The Unicode Consortium, "The Unicode Standard, Version
                 3.2.0" is defined by "The Unicode Standard, Version
                 3.0" (Reading, MA, Addison-Wesley, 2000. ISBN 0-201-
                 61633-5), as amended by the "Unicode Standard Annex
                 #27: Unicode 3.1"
                 (http://www.unicode.org/reports/tr27/) and by the
                 "Unicode Standard Annex #28: Unicode 3.2"
                 (http://www.unicode.org/reports/tr28/).

   [CharModel]   Whistler, K. and M. Davis, "Unicode Technical Report
                 #17, Character Encoding Model", UTR17,
                 <http://www.unicode.org/unicode/reports/tr17/>, August
                 2000.

   [Glossary]    The Unicode Consortium, "Unicode Glossary",
                 <http://www.unicode.org/glossary/>.

8.2. Informative References ๐Ÿ’ก

   [RFC3206]     Gellens, R., "The SYS and AUTH POP Response Codes", RFC
                 3206, February 2002.

   [RFC3548]     Josefsson, S., "The Base16, Base32, and Base64 Data
                 Encodings", RFC 3548, July 2003.

   [RFC4301]     Kent, S. and K. Seo, "Security Architecture for the
                 Internet Protocol", RFC 4301, December 2005.

   [RFC4346]     Dierks, T. and E. Rescorla, "The Transport Layer
                 Security (TLS) Protocol Version 1.1", RFC 4346, April
                 2006.

   [SASL-GSSAPI] Melnikov, A. (Editor), "The Kerberos V5 ("GSSAPI") SASL
                 Mechanism", Work in Progress, May 2006.

   [UTR36]       Davis, M., "(Draft) Unicode Technical Report #36,
                 Character Encoding Model", UTR17,
                 <http://www.unicode.org/unicode/reports/tr36/>,
                 February 2005.

   [CRAM-MD5]    Nerenberg, L., "The CRAM-MD5 SASL Mechanism", Work in
                 Progress.

   [DIGEST-MD5]  Leach, P., C. Newman, and A. Melnikov, "Using Digest
                 Authentication as a SASL Mechanism", Work in Progress,
                 March 2006.

9. Acknowledgements ๐Ÿซถ

This document is a revision of RFC 2222 written by John Myers ๐Ÿ’œ.

This revision is a product of the IETF Simple Authentication and Security Layer (SASL) Working Group ๐ŸŒˆ.

The following individuals contributed significantly to this revision: Abhijit Menon-Sen, Hallvard Furuseth, Jeffrey Hutzelman, John Myers, Luke Howard, Magnus Nystrom, Nicolas Williams, Peter Saint-Andre, RL 'Bob' Morgan, Rob Siemborski, Sam Hartman, Simon Josefsson, Tim Alsop, and Tony Hansen ๐Ÿ‘‘โœจ.

Appendix A. The SASL EXTERNAL Mechanism ๐ŸŽ€

This appendix is normative ๐Ÿ“œ.

The EXTERNAL mechanism lets a client ask the server to use credentials that were set up by means outside the mechanism itself, to authenticate the client ๐Ÿ”. Those outside means could be, for instance, IP Security [RFC4301] or TLS [RFC4346] services ๐ŸŒ. Unless the client and server have some a priori agreement, the client can't make any assumption about which external means the server used to get the client's credentials, or about the form of those credentials ๐Ÿ™ˆ. For example, the client can't assume the server will use the credentials the client set up via TLS ๐Ÿ’€.

A.1. EXTERNAL Technical Specification โš™๏ธ

The name of this mechanism is "EXTERNAL" ๐Ÿท๏ธ.

The mechanism does not provide a security layer ๐Ÿšซ.

The mechanism can transfer an authorization identity string. If the string is empty, the client is asking to act as the identity the server has associated with the client's credentials. If it's non-empty, the client is asking to act as the identity represented by the string ๐Ÿชช.

The client is expected to send data first in the authentication exchange. If the client doesn't provide initial response data in its request to start the exchange, the server responds with an empty initial challenge, and then the client provides its initial response ๐Ÿ”.

The client sends the initial response containing the UTF-8 [RFC3629] encoding of the requested authorization identity string. This response is non-empty when the client is asking to act as the identity represented by the (non-empty) string. It's empty when the client is asking to act as the identity the server associated with its authentication credentials ๐Ÿ’–.

The syntax of the initial response is specified as the value of the <extern-initial-resp> production, detailed below using the Augmented Backus-Naur Form (ABNF) [RFC4234] notation ๐Ÿงฉ:

      external-initial-resp = authz-id-string
      authz-id-string       = *( UTF8-char-no-nul )
      UTF8-char-no-nul      = UTF8-1-no-nul / UTF8-2 / UTF8-3 / UTF8-4
      UTF8-1-no-nul         = %x01-7F

where the <UTF8-2>, <UTF8-3>, and <UTF8-4> productions are as defined in [RFC3629] ๐Ÿ“–.

There are no additional challenges and responses ๐Ÿ™Œ.

So the server returns the outcome of the authentication exchange ๐ŸŽ‰.

The exchange fails if:

  • the client has not established its credentials via external means,
  • the client's credentials are inadequate,
  • the client provided an empty authorization identity string and the server is unwilling or unable to associate an authorization identity with the client's credentials,
  • the client provided a non-empty authorization identity string that is invalid per the syntax requirements of the applicable application protocol specification,
  • the client provided a non-empty authorization identity string representing an identity that the client is not allowed to act as, or
  • the server is unwilling or unable to provide service to the client for any other reason ๐Ÿ˜ญ.

Otherwise the exchange is successful ๐Ÿฅณ. When indicating a successful outcome, additional data is not provided โœจ.

A.2. SASL EXTERNAL Examples ๐Ÿฆ‹

okay so this bit is all about EXTERNAL auth exchanges, bestie ๐Ÿ’– these examples are here to help you vibe with the text above, but they're not the final word, so don't treat them like gospel. ACAP [RFC2244] is the protocol in all of them.

First up, we've got an empty authorization identity, and the client does not send an initial response with its request to start the exchange ๐Ÿ™ˆ

S: * ACAP (SASL "DIGEST-MD5")
C: a001 STARTTLS
S: a001 OK "Begin TLS negotiation now"
<TLS negotiation, further commands are under TLS layer>
S: * ACAP (SASL "DIGEST-MD5" "EXTERNAL")
C: a002 AUTHENTICATE "EXTERNAL"
S: + ""
C: + ""
S: a002 OK "Authenticated"

Next, the authorization identity is "fred@example.com". This time the initial response goes out right alongside the client's request to start the exchange, so you save a round-trip โœจ it's giving efficiency ๐Ÿ”ฅ

S: * ACAP (SASL "DIGEST-MD5")
C: a001 STARTTLS
S: a001 OK "Begin TLS negotiation now"
<TLS negotiation, further commands are under TLS layer>
S: * ACAP (SASL "DIGEST-MD5" "EXTERNAL")
C: a002 AUTHENTICATE "EXTERNAL" {16+}
C: fred@example.com
S: a002 NO "Cannot assume requested authorization identity"

A.3. Security Considerations ๐Ÿ”’

okay bestie, this one is serious, so listen up ๐Ÿ’€ EXTERNAL provides no security protection at all. It's open to spoofing by either the client or the server, active attacks, and eavesdropping. So it should only be used when adequate security services have already been set up. no cap, that's the whole safety net ๐Ÿซถ

Don't reach for EXTERNAL on its own and hope for the best. It only works safely once proper security services are already in place.

Appendix B. Changes since RFC 2222 โœจ

This appendix is non-normative ๐ŸŒธ

RFC 2222 got a major glow-up in this document ๐Ÿ’… The old text never said the authorization identity string was a string of Unicode characters, let alone character data, so it sort of implied the string was just a string of octets. Iconic of it, honestly ๐Ÿ™ˆ

  • The authorization identity string is now defined as a string of Unicode characters. The NUL (U+0000) character is prohibited. Protocol specifications are responsible for defining the authorization identity form, along with the Unicode string syntax and related semantics, while mechanism specifications are responsible for defining how that Unicode string gets carried in the authentication exchange.
  • Deleted "If so, when the client does not send data first, the initial challenge MUST be specified as being an empty challenge."

The following technical change was made to the EXTERNAL mechanism ๐Ÿฆ‹

  • The authorization identity string is to be UTF-8 encoded.

Note that the requirements for protocol and mechanism specifications have been significantly tightened ๐Ÿ‘‘ Existing specs will need to be updated to meet them, so that's a whole cleanup era ๐Ÿงน

Editors' Addresses ๐Ÿ’Œ

the editors can be reached at these addresses:

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

EMail: Alexey.Melnikov@isode.com
URI:   http://www.melnikov.ca/


Kurt D. Zeilenga
OpenLDAP Foundation

EMail: Kurt@OpenLDAP.org

Copyright (C) The Internet Society (2006).

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM 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.

Intellectual Property ๐Ÿ’œ

The IETF takes no position on the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document, or on the extent to which any license under such rights might or might not be available. It also doesn't claim to have made any independent effort to identify any such rights. Info on how rights work for RFC documents lives in BCP 78 and BCP 79 ๐Ÿ“š

Copies of IPR disclosures made to the IETF Secretariat, any assurances of licenses to be made available, or the result of an attempt to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be found in the IETF online IPR repository at http://www.ietf.org/ipr.

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology required to implement this standard. Send that info to the IETF at ietf-ipr@ietf.org ๐Ÿซถ

Acknowledgement ๐ŸŒˆ

Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA). โœจ

๐Ÿ“ฆ where this page comes from