ietf-corpus

rfc-4467

Internet Message Access Protocol (IMAP) - URLAUTH Extension

M. Crispin
date2006-05 streamIETF areaapp wglemonade statusPROPOSED STANDARD pages18 canonicalhttps://www.rfc-editor.org/rfc/rfc4467 doi10.17487/RFC4467
This document describes the URLAUTH extension to the Internet Message Access Protocol (IMAP) (RFC 3501) and the IMAP URL Scheme (IMAPURL) (RFC 2192). This extension provides a means by which an IMAP client can use URLs carrying authorization to access limited message data on the IMAP server. An IMAP server that supports this extension indicates this with a capability name of "URLAUTH". [STANDARDS-TRACK]

updated by

Extracted elements (26)

design-rationale §BASE.6.3.GENURLAUTH

GENURLAUTH allows a server to return a tagged OK with a dummy generated key when an invalid userid is supplied, rather than always returning BAD, to prevent an attacker from using the command to enumerate valid userids on the server.

email, security

design-rationale §5

The authorization token is encoded as ASCII hexadecimal rather than BASE64 because BASE64 representations may have '=' padding characters, which would be problematic in a URL context.

email

design-rationale §2.4.1

The INTERNAL mechanism incorporates a means of identifying the token generation algorithm within the token so that if the algorithm must be changed (e.g., due to a discovered attack), the server can support a transition period validating tokens under either the old or new algorithm.

email, security, crypto

design-rationale §1

URLAUTH is conceptually a 'pawn ticket' that carries no authentication information and can be redeemed by whomever presents it (subject to access identifier restrictions). This design separates authorization from authentication, allowing scoped access delegation without sharing credentials.

email, security

interoperability-note §4

URLAUTH overrides the second purpose of the userid in the IMAP URL (authentication requirement) defined in RFC 2192 (IMAPURL), replacing it with an authorization mechanism. The authimapurl grammar replaces the 'imapurl' and 'iserver' rules from RFC 2192 for URLAUTH-authorized URLs, making iuserauth mandatory.

email

normative-requirement §6 MUST NOT

During URLAUTH URL validation, removal of the ':<mech>:<token>' portion to produce the rump URL MUST be the only operation applied; URL percent escape decoding and case-folding (including to the domain part) MUST NOT occur.

email, security

normative-requirement §BASE.6.3.GENURLAUTH MUST

The GENURLAUTH command MUST validate that the mailbox component refers to an existing mailbox, the server component contains a valid owner userid, and there is a valid access identifier; if checks fail the server MUST return a tagged BAD response, with an exception allowing a tagged OK with a dummy key when an invalid userid is supplied to prevent userid enumeration.

email, security

normative-requirement §2.2 MUST

The mailbox access key MUST be unpredictable and SHOULD have at least 128 bits of entropy.

email, security, crypto

normative-requirement §BASE.6.3.URLFETCH MUST

The URLFETCH command MUST return an untagged URLFETCH response and a tagged OK response to any syntactically valid URLFETCH command; a NO response indicates a server internal failure. The server MUST return NIL for URLs referring to an entire server, mailbox list, entire mailbox, or search results.

email

normative-requirement §3 MUST NOT

URLAUTH MUST be at the end of the URL and MUST NOT be used with any IMAP URL that refers to an entire IMAP server, a list of mailboxes, an entire IMAP mailbox, or IMAP search results.

email, security

normative-requirement §3 MUST

When ';EXPIRE=<datetime>' is used, server implementations MUST reject the URL after that date and time has passed.

email, security

protocol-element §3

Four authorized access identifiers are defined: 'submit+<userid>' (limited to message submission entities acting on behalf of that userid), 'user+<userid>' (limited to sessions logged in as that specific userid), 'authuser' (any authenticated IMAP session), and 'anonymous' (any IMAP session including anonymous).

email, security

protocol-element §BASE.6.3.GENURLAUTH

The GENURLAUTH command requests that the server generate URLAUTH-authorized URLs for one or more supplied URL/mechanism pairs. The server validates each URL for mailbox existence, valid owner userid, valid access identifier, and optionally uid/section validity, then returns the complete URLAUTH-authorized URLs in a GENURLAUTH response.

email, security

protocol-element §2.4.1

The INTERNAL authorization mechanism uses a server-chosen token generation algorithm (HMAC-SHA1 recommended at time of writing) and does not involve disclosure of the mailbox access key to the client. The server SHOULD incorporate a means of identifying the token generation algorithm within the token to allow future algorithm changes.

email, security, crypto

protocol-element §2.2

The mailbox access key is a per-user, per-mailbox random string with at least 128 bits of entropy, generated by software (not the human user). Two users sharing the same mailbox each have a different mailbox access key for that mailbox.

email, security, crypto

protocol-element §BASE.6.3.RESETKEY

The RESETKEY command generates a new mailbox access key for a specified mailbox (revoking all existing URLAUTH URLs for that mailbox), or with no arguments removes all mailbox access keys for the user (revoking all URLAUTH URLs). The server returns a URLMECH status response code on success.

email, security

protocol-element §BASE.6.3.URLFETCH

The URLFETCH command requests the server return message text data for one or more URLAUTH-authorized IMAP URLs. It executes with the access rights of the userid in the server component of the URL and does not require any mailbox to be selected, nor does it interfere with any selected mailbox.

email, security

protocol-element §BASE.7.1.URLMECH

The URLMECH status response code lists URL authorization mechanism names supported for a mailbox; it is returned in an untagged OK in response to RESETKEY, SELECT, or EXAMINE commands. Mechanisms other than INTERNAL may include BASE64-encoded mechanism-specific data appended after '='.

email

protocol-element §6

URL validation uses a 'rump URL' (the URLAUTH URL with the ':<mech>:<token>' suffix stripped). If the mailbox cannot be identified, the server calculates an authorization token using random 'plausible' keys before returning a validation failure, to prevent timing attacks on mailbox name existence.

email, security

protocol-element §2.1

URLAUTH is a component appended at the end of an IMAP URL that conveys authorization to access the addressed data. It contains an authorized access identifier, an authorization mechanism name, and an authorization token generated from the URL, the access identifier, the mechanism name, and a secret mailbox access key.

email, security

registry §11

This document registers the 'URLAUTH' capability in the IANA imap4-capabilities registry and establishes the IMAP URLAUTH Authorization Mechanism Registry. New mechanisms must be registered via a standards-track or IESG-approved experimental RFC. The INTERNAL mechanism is the initial registered entry.

email, registry

security-consideration §10 MUST NOT

The 'authuser' access identifier should be used with caution as it permits any authorized IMAP user to access the URL. The 'anonymous' access identifier should be used with extreme caution as it permits anyone, and MUST NOT be assumed equivalent to 'authuser' even on servers that disallow anonymous access.

email, security, privacy

security-consideration §10 MUST

The URLMECH status response code may expose sensitive mechanism-specific data; a server MUST implement a configuration that suppresses URLMECH unless a session protection mechanism (TLS or SASL confidentiality layer) is active.

email, security

security-consideration §10 MAY

To protect against computational denial-of-service attacks, a server MAY impose progressively longer delays on multiple URL validation requests that fail. Timing attack prevention (using dummy key calculations for unrecognized mailboxes) is also required during URLAUTH validation.

email, security

wire-format §9

The full URLAUTH URL grammar requires 'imap://' followed by enc-user, optional iauth, '@', hostport, '/', imessagepart, and iurlauth. The iurlauth component is composed as iurlauth-rump ':' mechanism ':' enc-urlauth, where enc-urlauth is at least 32 hex digits.

email

wire-format §3

The URLAUTH URL extension takes the form ';URLAUTH=<access>:<mech>:<token>' where the authorization token is an ASCII-encoded hexadecimal string of at least 32 hex digits (128 bits). The optional expiry component takes the form ';EXPIRE=<datetime>' per RFC 3339.

email