rfc-1731

IMAP4 Authentication Mechanisms

J. Myers
date1994-12 streamIETF areaapp wgimap statusPROPOSED STANDARD pages6 canonicalhttps://www.rfc-editor.org/rfc/rfc1731 doi10.17487/RFC1731
The Internet Message Access Protocol, Version 4 [IMAP4] contains the AUTHENTICATE command, for identifying and authenticating a user to an IMAP4 server and for optionally negotiating a protection mechanism for subsequent protocol interactions. This document describes several authentication mechanisms for use by the IMAP4 AUTHENTICATE command. [STANDARDS-TRACK]

Extracted elements (23)

design-rationale §4

S/Key authentication deliberately provides no protection mechanisms. This is an implicit design choice: S/Key is a one-time-password scheme for authentication only, offering no session integrity or privacy after login.

security, crypto

design-rationale §2

The protection mechanism negotiation uses a bit-mask in a single octet, allowing the server to advertise multiple supported mechanisms simultaneously and the client to select one. This design enables extensible capability advertisement within the authentication exchange itself.

security, crypto

interoperability-note §3

GSSAPI target name must be constructed as 'SERVICE:imap@hostname' where hostname is the fully qualified host name of the server with all letters in lower case, passed to GSS_Import_Name with input_name_type of NULL.

security, crypto

interoperability-note §2

Kerberos V4 principal name must be 'imap.hostname@realm' where hostname is the first component of the server host name in lower case and realm is the Kerberos realm of the server.

security, crypto

normative-requirement §3 MUST

For GSSAPI, the client must call GSS_Init_sec_context with input_name_string 'SERVICE:imap@hostname' where hostname is the fully qualified host name in lower case. The client must respond with the resulting output_token.

security, crypto

normative-requirement §2 SHOULD

For Kerberos V4, the encrypted checksum in the authenticator must contain the server-provided 32-bit number in network byte order, providing proof of freshness and binding the authenticator to the specific authentication session.

security, crypto

normative-requirement §2 MUST

The client must construct the response data, pad it to a multiple of 8 octets by appending 1 to 8 octets, and PCBC-encrypt the data with the session key before responding to the second server ready response.

security, crypto

normative-requirement §3 MUST

The GSSAPI server must seal its 4-octet capability advertisement using GSS_Seal with conf_flag set to FALSE, and must pass the client's reply through GSS_Unseal to extract the selected protection mechanism, maximum message size, and user name.

security, crypto

normative-requirement §3 MUST

The GSSAPI server must verify that the GSS src_name is authorized to authenticate as the provided user name before considering the client authenticated.

security, crypto

normative-requirement §2 MUST

Upon decrypting the Kerberos ticket and authenticator, the server must add one to the checksum and encrypt the resulting 8-octet response in the session key. The server must verify that the principal in the Kerberos ticket is authorized to connect as the specified user name.

security, crypto

normative-requirement §4 SHOULD

Upon successful verification of the S/Key one-time-password, the server should consider the client authenticated. S/Key authentication provides no protection mechanisms for subsequent protocol interactions.

security, crypto

protocol-element §2

Kerberos V4 and GSSAPI protection mechanisms are encoded as bit-masks: 1 = no protection, 2 = integrity protection (krb_mk_safe / GSS_Seal with conf_flag FALSE), 4 = privacy protection (krb_mk_priv / GSS_Seal with conf_flag TRUE).

security, crypto

protocol-element §3

The GSSAPI authentication type identifier is 'GSSAPI', used with all mechanisms employing GSSAPI [RFC1508]. The server issues an empty first ready response; the client initiates GSS_Init_sec_context with targ_name derived from 'SERVICE:imap@hostname'.

security, crypto

protocol-element §2

The KERBEROS_V4 authentication type uses the IMAP4 AUTHENTICATE command. The server issues a challenge containing a random 32-bit number, and the client responds with a Kerberos ticket and authenticator for the principal 'imap.hostname@realm'.

security, crypto

protocol-element §4

The S/Key authentication type identifier is 'SKEY'. The server issues an empty first ready response; the client responds with the user name string. The server then issues the decimal sequence number followed by a space and the seed string.

security, crypto

security-consideration §6

Security issues are discussed throughout the memo. The Kerberos V4 mechanism provides mutual authentication via nonce verification; GSSAPI provides configurable integrity and privacy protection; S/Key provides one-time-password authentication without session protection.

security, crypto

state-machine §3

GSSAPI authentication proceeds through the following states: (1) server issues empty challenge; (2) client calls GSS_Init_sec_context and sends output_token; (3) if GSS_CONTINUE_NEEDED, tokens are exchanged until GSS_COMPLETE; (4) server sends sealed capability octets; (5) client sends sealed selection and user name; (6) server verifies authorization and authentication is complete.

security, crypto

wire-format §3

After GSSAPI context establishment, the server constructs 4 octets sealed with GSS_Seal (conf_flag FALSE): octet 1 is the protection mechanism bit-mask, octets 2-4 (network byte order) are the maximum output_token size the server can receive.

security, crypto

wire-format §2

The first Kerberos V4 server ready response encodes a random 32-bit number in network byte order. This nonce is used as the checksum field in the Kerberos authenticator sent by the client.

security, crypto

wire-format §3

The GSSAPI client constructs a plaintext message sealed with GSS_Seal (conf_flag FALSE): octet 1 is the selected protection mechanism bit-mask, octets 2-4 (network byte order) are the maximum output_message size the client can receive, followed by the user name string.

security, crypto

wire-format §2

The Kerberos V4 client final message contains: octets 1-4 with the original server checksum (network byte order), octet 5 with the selected protection mechanism bit-mask, octets 6-8 with the maximum cipher-text buffer size the client can receive (network byte order), followed by the user name string. The data is padded to a multiple of 8 octets and PCBC-encrypted with the session key.

security, crypto

wire-format §2

The Kerberos V4 second server ready response contains 8 octets encrypted in the session key: octets 1-4 are the incremented checksum (network byte order), octet 5 is a protection mechanism bit-mask, and octets 6-8 are the maximum cipher-text buffer size the server can receive (network byte order).

security, crypto

wire-format §4

The S/Key second server ready response contains the decimal sequence number, a single space, and the seed string for the indicated user. The client responds with the one-time-password as either a 64-bit value in network byte order or encoded as 'six English words'.

security, crypto