rfc4467.IMAP_URLAUTH_extension.txt 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  1. Network Working Group M. Crispin
  2. Request for Comments: 4467 University of Washington
  3. Updates: 3501 May 2006
  4. Category: Standards Track
  5. Internet Message Access Protocol (IMAP) - URLAUTH Extension
  6. Status of This Memo
  7. This document specifies an Internet standards track protocol for the
  8. Internet community, and requests discussion and suggestions for
  9. improvements. Please refer to the current edition of the "Internet
  10. Official Protocol Standards" (STD 1) for the standardization state
  11. and status of this protocol. Distribution of this memo is unlimited.
  12. Copyright Notice
  13. Copyright (C) The Internet Society (2006).
  14. Abstract
  15. This document describes the URLAUTH extension to the Internet Message
  16. Access Protocol (IMAP) (RFC 3501) and the IMAP URL Scheme (IMAPURL)
  17. (RFC 2192). This extension provides a means by which an IMAP client
  18. can use URLs carrying authorization to access limited message data on
  19. the IMAP server.
  20. An IMAP server that supports this extension indicates this with a
  21. capability name of "URLAUTH".
  22. 1. Introduction
  23. In [IMAPURL], a URL of the form imap://fred@example.com/INBOX/;uid=20
  24. requires authorization as userid "fred". However, [IMAPURL] implies
  25. that it only supports authentication and confuses the concepts of
  26. authentication and authorization.
  27. The URLAUTH extension defines an authorization mechanism for IMAP
  28. URLs to replace [IMAPURL]'s authentication-only mechanism. URLAUTH
  29. conveys authorization in the URL string itself and reuses a portion
  30. of the syntax of the [IMAPURL] authentication mechanism to convey the
  31. authorization identity (which also defines the default namespace in
  32. [IMAP]).
  33. The URLAUTH extension provides a means by which an authorized user of
  34. an IMAP server can create URLAUTH-authorized IMAP URLs. A URLAUTH-
  35. authorized URL conveys authorization (not authentication) to the data
  36. Crispin Standards Track [Page 1]
  37. RFC 4467 IMAP - URLAUTH Extension May 2006
  38. addressed by that URL. This URL can be used in another IMAP session
  39. to access specific content on the IMAP server, without otherwise
  40. providing authorization to any other data (such as other data in the
  41. mailbox specified in the URL) owned by the authorizing user.
  42. Conceptually, a URLAUTH-authorized URL can be thought of as a "pawn
  43. ticket" that carries no authentication information and can be
  44. redeemed by whomever presents it. However, unlike a pawn ticket,
  45. URLAUTH has optional mechanisms to restrict the usage of a URLAUTH-
  46. authorized URL. Using these mechanisms, URLAUTH-authorized URLs can
  47. be usable by:
  48. . anonymous (the "pawn ticket" model)
  49. . authenticated users only
  50. . a specific authenticated user only
  51. . message submission acting on behalf of a specific user only
  52. There is also a mechanism for expiration.
  53. A URLAUTH-authorized URL can be used in the argument to the BURL
  54. command in message composition, as described in [BURL], for such
  55. purposes as allowing a client (with limited memory or other
  56. resources) to submit a message forward or to resend from an IMAP
  57. mailbox without requiring the client to fetch that message data.
  58. The URLAUTH is generated using an authorization mechanism name and an
  59. authorization token, which is generated using a secret mailbox access
  60. key. An IMAP client can request that the server generate and assign
  61. a new mailbox access key (thus effectively revoking all current URLs
  62. using URLAUTH with the old mailbox access key) but cannot set the
  63. mailbox access key to a key of its own choosing.
  64. 1.1. Conventions Used in this Document
  65. The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY"
  66. in this document are to be interpreted as defined in [KEYWORDS].
  67. The formal syntax uses the Augmented Backus-Naur Form (ABNF) notation
  68. including the core rules defined in Appendix A of [ABNF].
  69. In examples, "C:" and "S:" indicate lines sent by the client and
  70. server, respectively. If a single "C:" or "S:" label applies to
  71. multiple lines, then the line breaks between those lines are for
  72. editorial clarity only and are not part of the actual protocol
  73. exchange.
  74. Crispin Standards Track [Page 2]
  75. RFC 4467 IMAP - URLAUTH Extension May 2006
  76. 2. Concepts
  77. 2.1. URLAUTH
  78. The URLAUTH is a component, appended at the end of a URL, that
  79. conveys authorization to access the data addressed by that URL. It
  80. contains an authorized access identifier, an authorization mechanism
  81. name, and an authorization token. The authorization token is
  82. generated from the URL, the authorized access identifier, the
  83. authorization mechanism name, and a mailbox access key.
  84. 2.2. Mailbox Access Key
  85. The mailbox access key is a random string with at least 128 bits of
  86. entropy. It is generated by software (not by the human user) and
  87. MUST be unpredictable.
  88. Each user has a table of mailboxes and an associated mailbox access
  89. key for each mailbox. Consequently, the mailbox access key is per-
  90. user and per-mailbox. In other words, two users sharing the same
  91. mailbox each have a different mailbox access key for that mailbox,
  92. and each mailbox accessed by a single user also has a different
  93. mailbox access key.
  94. 2.3. Authorized Access Identifier
  95. The authorized access identifier restricts use of the URLAUTH
  96. authorized URL to certain users authorized on the server, as
  97. described in section 3.
  98. 2.4. Authorization Mechanism
  99. The authorization mechanism is the algorithm by which the URLAUTH is
  100. generated and subsequently verified, using the mailbox access key.
  101. 2.4.1. INTERNAL Authorization Mechanism
  102. This specification defines the INTERNAL mechanism, which uses a token
  103. generation algorithm of the server's choosing and does not involve
  104. disclosure of the mailbox access key to the client.
  105. Note: The token generation algorithm chosen by the server
  106. implementation should be modern and reasonably secure. At the
  107. time of the writing of this document, an [HMAC] such as HMAC-SHA1
  108. is recommended.
  109. Crispin Standards Track [Page 3]
  110. RFC 4467 IMAP - URLAUTH Extension May 2006
  111. If it becomes necessary to change the token generation algorithm
  112. of the INTERNAL mechanism (e.g., because an attack against the
  113. current algorithm has been discovered), all currently existing
  114. URLAUTH-authorized URLs are invalidated by the change in
  115. algorithm. Since this would be an unpleasant surprise to
  116. applications that depend upon the validity of a URLAUTH-authorized
  117. URL, and there is no good way to do a bulk update of existing
  118. deployed URLs, it is best to avoid this situation by using a
  119. secure algorithm as opposed to one that is "good enough".
  120. Server implementations SHOULD consider the possibility of changing
  121. the algorithm. In some cases, it may be desirable to implement
  122. the change of algorithm in a way that newly-generated tokens use
  123. the new algorithm, but that for a limited period of time tokens
  124. using either the new or old algorithm can be validated.
  125. Consequently, the server SHOULD incorporate some means of
  126. identifying the token generation algorithm within the token.
  127. Although this specification is extensible for other mechanisms, none
  128. are defined in this document. In addition to the mechanism name
  129. itself, other mechanisms may have mechanism-specific data, which is
  130. to be interpreted according to the definition of that mechanism.
  131. 2.5. Authorization Token
  132. The authorization token is a deterministic string of at least 128
  133. bits that an entity with knowledge of the secret mailbox access key
  134. and URL authorization mechanism can use to verify the URL.
  135. 3. IMAP URL Extensions
  136. [IMAPURL] is extended by allowing the addition of
  137. ";EXPIRE=<datetime>" and ";URLAUTH=<access>:<mech>:<token>" to IMAP
  138. URLs that refer to a specific message or message parts.
  139. The URLAUTH is comprised of ";URLAUTH=<access>:<mech>:<token>" and
  140. MUST be at the end of the URL.
  141. URLAUTH does not apply to, and MUST NOT be used with, any IMAP URL
  142. that refers to an entire IMAP server, a list of mailboxes, an entire
  143. IMAP mailbox, or IMAP search results.
  144. When ";EXPIRE=<datetime>" is used, this indicates the latest date and
  145. time that the URL is valid. After that date and time, the URL has
  146. expired, and server implementations MUST reject the URL. If
  147. ";EXPIRE=<datetime>" is not used, the URL has no expiration, but
  148. still can be revoked as discussed below.
  149. Crispin Standards Track [Page 4]
  150. RFC 4467 IMAP - URLAUTH Extension May 2006
  151. The URLAUTH takes the form ";URLAUTH=<access>:<mech>:<token>". It is
  152. composed of three parts. The <access> portion provides the
  153. authorized access identifiers, which may constrain the operations and
  154. users that are permitted to use this URL. The <mech> portion
  155. provides the authorization mechanism used by the IMAP server to
  156. generate the authorization token that follows. The <token> portion
  157. provides the authorization token.
  158. The "submit+" access identifier prefix, followed by a userid,
  159. indicates that only a userid authorized as a message submission
  160. entity on behalf of the specified userid is permitted to use this
  161. URL. The IMAP server does not validate the specified userid but does
  162. validate that the IMAP session has an authorization identity that is
  163. authorized as a message submission entity. The authorized message
  164. submission entity MUST validate the userid prior to contacting the
  165. IMAP server.
  166. The "user+" access identifier prefix, followed by a userid, indicates
  167. that use of this URL is limited to IMAP sessions that are logged in
  168. as the specified userid (that is, have authorization identity as that
  169. userid).
  170. Note: If a SASL mechanism that provides both authorization and
  171. authentication identifiers is used to authenticate to the IMAP
  172. server, the "user+" access identifier MUST match the authorization
  173. identifier.
  174. The "authuser" access identifier indicates that use of this URL is
  175. limited to IMAP sessions that are logged in as an authorized user
  176. (that is, have authorization identity as an authorized user) of that
  177. IMAP server. Use of this URL is prohibited to anonymous IMAP
  178. sessions.
  179. The "anonymous" access identifier indicates that use of this URL is
  180. not restricted by session authorization identity; that is, any IMAP
  181. session in authenticated or selected state (as defined in [IMAP]),
  182. including anonymous sessions, may issue a URLFETCH using this URL.
  183. The authorization token is represented as an ASCII-encoded
  184. hexadecimal string, which is used to authorize the URL. The length
  185. and the calculation of the authorization token depends upon the
  186. mechanism used; but, in all cases, the authorization token is at
  187. least 128 bits (and therefore at least 32 hexadecimal digits).
  188. Crispin Standards Track [Page 5]
  189. RFC 4467 IMAP - URLAUTH Extension May 2006
  190. 4. Discussion of URLAUTH Authorization Issues
  191. In [IMAPURL], the userid before the "@" in the URL has two purposes:
  192. 1) It provides context for user-specific mailbox paths such as
  193. "INBOX".
  194. 2) It specifies that resolution of the URL requires logging in as
  195. that user and limits use of that URL to only that user.
  196. An obvious limitation of using the same field for both purposes is
  197. that the URL can only be resolved by the mailbox owner.
  198. URLAUTH overrides the second purpose of the userid in the IMAP URL
  199. and by default permits the URL to be resolved by any user permitted
  200. by the access identifier.
  201. The "user+<userid>" access identifier limits resolution of that URL
  202. to a particular userid, whereas the "submit+<userid>" access
  203. identifier is more general and simply requires that the session be
  204. authorized by a user that has been granted a "submit" role within the
  205. authentication system. Use of either of these access identifiers
  206. makes it impossible for an attacker, spying on the session, to use
  207. the same URL, either directly or by submission to a message
  208. submission entity.
  209. The "authuser" and "anonymous" access identifiers do not have this
  210. level of protection and should be used with caution. These access
  211. identifiers are primarily useful for public export of data from an
  212. IMAP server, without requiring that it be copied to a web or
  213. anonymous FTP server. Refer to the Security Considerations for more
  214. details.
  215. 5. Generation of URLAUTH-Authorized URLs
  216. A URLAUTH-authorized URL is generated from an initial URL as follows:
  217. An initial URL is built, ending with ";URLAUTH=<access>" but without
  218. the ":<mech>:<token>" components. An authorization mechanism is
  219. selected and used to calculate the authorization token, with the
  220. initial URL as the data and a secret known to the IMAP server as the
  221. key. The URLAUTH-authorized URL is generated by taking the initial
  222. URL and appending ":", the URL authorization mechanism name, ":", and
  223. the ASCII-encoded hexadecimal representation of the authorization
  224. token.
  225. Crispin Standards Track [Page 6]
  226. RFC 4467 IMAP - URLAUTH Extension May 2006
  227. Note: ASCII-encoded hexadecimal is used instead of BASE64 because
  228. a BASE64 representation may have "=" padding characters, which
  229. would be problematic in a URL.
  230. In the INTERNAL mechanism, the mailbox access key for that mailbox is
  231. the secret known to the IMAP server, and a server-selected algorithm
  232. is used as described in section 2.4.1.
  233. 6. Validation of URLAUTH-authorized URLs
  234. A URLAUTH-authorized URL is validated as follows:
  235. The URL is split at the ":" that separates "<access>" from
  236. "<mech>:<token>" in the ";URLAUTH=<access>:<mech>:<token>" portion of
  237. the URL. The "<mech>:<token>" portion is first parsed and saved as
  238. the authorization mechanism and the authorization token. The URL is
  239. truncated, discarding the ":" described above, to create a "rump URL"
  240. (the URL minus the ":" and the "<mech>:<token>" portion). The rump
  241. URL is then analyzed to identify the mailbox.
  242. If the mailbox cannot be identified, an authorization token is
  243. calculated on the rump URL, using random "plausible" keys (selected
  244. by the server) as needed, before returning a validation failure.
  245. This prevents timing attacks aimed at identifying mailbox names.
  246. If the mailbox can be identified, the authorization token is
  247. calculated on the rump URL and a secret known to the IMAP server
  248. using the given URL authorization mechanism. Validation is
  249. successful if, and only if, the calculated authorization token for
  250. that mechanism matches the authorization token supplied in
  251. ";URLAUTH=<access>:<mech>:<token>".
  252. Removal of the ":<mech>:<token>" portion of the URL MUST be the only
  253. operation applied to the URLAUTH-authorized URL to get the rump URL.
  254. In particular, URL percent escape decoding and case-folding
  255. (including to the domain part of the URL) MUST NOT occur.
  256. In the INTERNAL mechanism, the mailbox access key for that mailbox is
  257. used as the secret known to the IMAP server, and the same server-
  258. selected algorithm used for generating URLs is used to calculate the
  259. authorization token for verification.
  260. Crispin Standards Track [Page 7]
  261. RFC 4467 IMAP - URLAUTH Extension May 2006
  262. 7. Additional Commands
  263. These commands are extensions to the [IMAP] base protocol.
  264. The section headings of these commands are intended to correspond
  265. with where they would be located in the base protocol document if
  266. they were part of that document.
  267. BASE.6.3.RESETKEY. RESETKEY Command
  268. Arguments: optional mailbox name
  269. optional mechanism name(s)
  270. Responses: none other than in result
  271. Result: OK - RESETKEY completed, URLMECH containing new data
  272. NO - RESETKEY error: can't change key of that mailbox
  273. BAD - command unknown or arguments invalid
  274. The RESETKEY command has two forms.
  275. The first form accepts a mailbox name as an argument and generates a
  276. new mailbox access key for the given mailbox in the user's mailbox
  277. access key table, replacing any previous mailbox access key (and
  278. revoking any URLs that were authorized with a URLAUTH using that key)
  279. in that table. By default, the mailbox access key is generated for
  280. the INTERNAL mechanism; other mechanisms can be specified with the
  281. optional mechanism argument.
  282. The second form, with no arguments, removes all mailbox access keys
  283. in the user's mailbox access key table, revoking all URLs currently
  284. authorized using URLAUTH by the user.
  285. Any current IMAP session logged in as the user that has the mailbox
  286. selected will receive an untagged OK response with the URLMECH status
  287. response code (see section BASE.7.1.URLMECH for more details about
  288. the URLMECH status response code).
  289. Example:
  290. C: a31 RESETKEY
  291. S: a31 OK All keys removed
  292. C: a32 RESETKEY INBOX
  293. S: a32 OK [URLMECH INTERNAL] mechs
  294. C: a33 RESETKEY INBOX XSAMPLE
  295. S: a33 OK [URLMECH INTERNAL XSAMPLE=P34OKhO7VEkCbsiYY8rGEg==] done
  296. Crispin Standards Track [Page 8]
  297. RFC 4467 IMAP - URLAUTH Extension May 2006
  298. BASE.6.3.GENURLAUTH. GENURLAUTH Command
  299. Argument: one or more URL/mechanism pairs
  300. Response: untagged response: GENURLAUTH
  301. Result: OK - GENURLAUTH completed
  302. NO - GENURLAUTH error: can't generate a URLAUTH
  303. BAD - command unknown or arguments invalid
  304. The GENURLAUTH command requests that the server generate a URLAUTH-
  305. authorized URL for each of the given URLs using the given URL
  306. authorization mechanism.
  307. The server MUST validate each supplied URL as follows:
  308. (1) The mailbox component of the URL MUST refer to an existing
  309. mailbox.
  310. (2) The server component of the URL MUST contain a valid userid
  311. that identifies the owner of the mailbox access key table that
  312. will be used to generate the URLAUTH-authorized URL. As a
  313. consequence, the iserver rule of [IMAPURL] is modified so that
  314. iuserauth is mandatory.
  315. Note: the server component of the URL is generally the
  316. logged in userid and server. If not, then the logged in
  317. userid and server MUST have owner-type access to the
  318. mailbox access key table owned by the userid and server
  319. indicated by the server component of the URL.
  320. (3) There is a valid access identifier that, in the case of
  321. "submit+" and "user+", will contain a valid userid. This
  322. userid is not necessarily the same as the owner userid
  323. described in (2).
  324. (4) The server MAY also verify that the iuid and/or isection
  325. components (if present) are valid.
  326. If any of the above checks fail, the server MUST return a tagged BAD
  327. response with the following exception. If an invalid userid is
  328. supplied as the mailbox access key owner and/or as part of the access
  329. identifier, the server MAY issue a tagged OK response with a
  330. generated mailbox key that always fails validation when used with a
  331. URLFETCH command. This exception prevents an attacker from
  332. validating userids.
  333. Crispin Standards Track [Page 9]
  334. RFC 4467 IMAP - URLAUTH Extension May 2006
  335. If there is currently no mailbox access key for the given mailbox in
  336. the owner's mailbox access key table, one is automatically generated.
  337. That is, it is not necessary to use RESETKEY prior to first-time use
  338. of GENURLAUTH.
  339. If the command is successful, a GENURLAUTH response code is returned
  340. listing the requested URLs as URLAUTH-authorized URLs.
  341. Examples:
  342. C: a775 GENURLAUTH "imap://joe@example.com/INBOX/;uid=20/
  343. ;section=1.2" INTERNAL
  344. S: a775 BAD missing access identifier in supplied URL
  345. C: a776 GENURLAUTH "imap://example.com/Shared/;uid=20/
  346. ;section=1.2;urlauth=submit+fred" INTERNAL
  347. S: a776 BAD missing owner username in supplied URL
  348. C: a777 GENURLAUTH "imap://joe@example.com/INBOX/;uid=20/
  349. ;section=1.2;urlauth=submit+fred" INTERNAL
  350. S: * GENURLAUTH "imap://joe@example.com/INBOX/;uid=20/;section=1.2
  351. ;urlauth=submit+fred:internal:91354a473744909de610943775f92038"
  352. S: a777 OK GENURLAUTH completed
  353. BASE.6.3.URLFETCH. URLFETCH Command
  354. Argument: one or more URLs
  355. Response: untagged response: URLFETCH
  356. Result: OK - urlfetch completed
  357. NO - urlfetch failed due to server internal error
  358. BAD - command unknown or arguments invalid
  359. The URLFETCH command requests that the server return the text data
  360. associated with the specified IMAP URLs, as described in [IMAPURL]
  361. and extended by this document. The data is returned for all
  362. validated URLs, regardless of whether or not the session would
  363. otherwise be able to access the mailbox containing that data via
  364. SELECT or EXAMINE.
  365. Note: This command does not require that the URL refer to the
  366. selected mailbox; nor does it require that any mailbox be
  367. selected. It also does not in any way interfere with any selected
  368. mailbox.
  369. Crispin Standards Track [Page 10]
  370. RFC 4467 IMAP - URLAUTH Extension May 2006
  371. The URLFETCH command effectively executes with the access of the
  372. userid in the server component of the URL (which is generally the
  373. userid that issued the GENURLAUTH). By itself, the URLAUTH does NOT
  374. grant access to the data; once validated, it grants whatever access
  375. to the data is held by the userid in the server component of the URL.
  376. That access may have changed since the GENURLAUTH was done.
  377. The URLFETCH command MUST return an untagged URLFETCH response and a
  378. tagged OK response to any URLFETCH command that is syntactically
  379. valid. A NO response indicates a server internal failure that may be
  380. resolved on later retry.
  381. Note: The possibility of a NO response is to accommodate
  382. implementations that would otherwise have to issue an untagged BYE
  383. with a fatal error due to an inability to respond to a valid
  384. request. In an ideal world, a server SHOULD NOT issue a NO
  385. response.
  386. The server MUST return NIL for any IMAP URL that references an entire
  387. IMAP server, a list of mailboxes, an entire IMAP mailbox, or IMAP
  388. search results.
  389. Example:
  390. Note: For clarity, this example uses the LOGIN command, which
  391. SHOULD NOT be used over a non-encrypted communication path.
  392. This example is of a submit server, obtaining a message segment
  393. for a message that it has already validated was submitted by
  394. "fred".
  395. S: * OK [CAPABILITY IMAP4REV1 URLAUTH] example.com IMAP server
  396. C: a001 LOGIN submitserver secret
  397. S: a001 OK submitserver logged in
  398. C: a002 URLFETCH "imap://joe@example.com/INBOX/;uid=20/
  399. ;section=1.2;urlauth=submit+fred:internal
  400. :91354a473744909de610943775f92038"
  401. S: * URLFETCH "imap://joe@example.com/INBOX/;uid=20/;section=1.2
  402. ;urlauth=submit+fred:internal
  403. :91354a473744909de610943775f92038" {28}
  404. S: Si vis pacem, para bellum.
  405. S:
  406. S: a002 OK URLFETCH completed
  407. Crispin Standards Track [Page 11]
  408. RFC 4467 IMAP - URLAUTH Extension May 2006
  409. 8. Additional Responses
  410. These responses are extensions to the [IMAP] base protocol.
  411. The section headings of these responses are intended to correspond
  412. with where they would be located in the base protocol document if
  413. they were part of that document.
  414. BASE.7.1.URLMECH. URLMECH Status Response Code
  415. The URLMECH status response code is followed by a list of URL
  416. authorization mechanism names. Mechanism names other than INTERNAL
  417. may be appended with an "=" and BASE64-encoded form of mechanism-
  418. specific data.
  419. This status response code is returned in an untagged OK response in
  420. response to a RESETKEY, SELECT, or EXAMINE command. In the case of
  421. the RESETKEY command, this status response code can be sent in the
  422. tagged OK response instead of requiring a separate untagged OK
  423. response.
  424. Example:
  425. C: a33 RESETKEY INBOX XSAMPLE
  426. S: a33 OK [URLMECH INTERNAL XSAMPLE=P34OKhO7VEkCbsiYY8rGEg==] done
  427. In this example, the server supports the INTERNAL mechanism and an
  428. experimental mechanism called XSAMPLE, which also holds some
  429. mechanism-specific data (the name "XSAMPLE" is for illustrative
  430. purposes only).
  431. BASE.7.4.GENURLAUTH. GENURLAUTH Response
  432. Contents: One or more URLs
  433. The GENURLAUTH response returns the URLAUTH-authorized URL(s)
  434. requested by a GENURLAUTH command.
  435. Example:
  436. C: a777 GENURLAUTH "imap://joe@example.com/INBOX/;uid=20/
  437. ;section=1.2;urlauth=submit+fred" INTERNAL
  438. S: * GENURLAUTH "imap://joe@example.com/INBOX/;uid=20/;section=1.2
  439. ;urlauth=submit+fred:internal:91354a473744909de610943775f92038"
  440. S: a777 OK GENURLAUTH completed
  441. Crispin Standards Track [Page 12]
  442. RFC 4467 IMAP - URLAUTH Extension May 2006
  443. BASE.7.4.URLFETCH. URLFETCH Response
  444. Contents: One or more URL/nstring pairs
  445. The URLFETCH response returns the message text data associated with
  446. one or more IMAP URLs, as described in [IMAPURL] and extended by this
  447. document. This response occurs as the result of a URLFETCH command.
  448. The returned data string is NIL if the URL is invalid for any reason
  449. (including validation failure). If the URL is valid, but the IMAP
  450. fetch of the body part returned NIL (this should not happen), the
  451. returned data string should be the empty string ("") and not NIL.
  452. Note: This command does not require that the URL refer to the
  453. selected mailbox; nor does it require that any mailbox be
  454. selected. It also does not in any way interfere with any selected
  455. mailbox.
  456. Example:
  457. C: a002 URLFETCH "imap://joe@example.com/INBOX/;uid=20/
  458. ;section=1.2;urlauth=submit+fred:internal
  459. :91354a473744909de610943775f92038"
  460. S: * URLFETCH "imap://joe@example.com/INBOX/;uid=20/;section=1.2
  461. ;urlauth=submit+fred:internal
  462. :91354a473744909de610943775f92038" {28}
  463. S: Si vis pacem, para bellum.
  464. S:
  465. S: a002 OK URLFETCH completed
  466. 9. Formal Syntax
  467. The following syntax specification uses the Augmented Backus-Naur
  468. Form (ABNF) notation as specified in [ABNF].
  469. The following modifications are made to the Formal Syntax in [IMAP]:
  470. resetkey = "RESETKEY" [SP mailbox *(SP mechanism)]
  471. capability =/ "URLAUTH"
  472. command-auth =/ resetkey / genurlauth / urlfetch
  473. resp-text-code =/ "URLMECH" SP "INTERNAL" *(SP mechanism ["=" base64])
  474. genurlauth = "GENURLAUTH" 1*(SP url-rump SP mechanism)
  475. genurlauth-data = "*" SP "GENURLAUTH" 1*(SP url-full)
  476. Crispin Standards Track [Page 13]
  477. RFC 4467 IMAP - URLAUTH Extension May 2006
  478. url-full = astring
  479. ; contains authimapurlfull as defined below
  480. url-rump = astring
  481. ; contains authimapurlrump as defined below
  482. urlfetch = "URLFETCH" 1*(SP url-full)
  483. urlfetch-data = "*" SP "URLFETCH" 1*(SP url-full SP nstring)
  484. The following extensions are made to the Formal Syntax in [IMAPURL]:
  485. authimapurl = "imap://" enc-user [iauth] "@" hostport "/"
  486. imessagepart
  487. ; replaces "imapurl" and "iserver" rules for
  488. ; URLAUTH authorized URLs
  489. authimapurlfull = authimapurl iurlauth
  490. authimapurlrump = authimapurl iurlauth-rump
  491. enc-urlauth = 32*HEXDIG
  492. enc-user = 1*achar
  493. ; same as "enc_user" in RFC 2192
  494. iurlauth = iurlauth-rump ":" mechanism ":" enc-urlauth
  495. iurlauth-rump = [expire] ";URLAUTH=" access
  496. access = ("submit+" enc-user) / ("user+" enc-user) /
  497. "authuser" / "anonymous"
  498. expire = ";EXPIRE=" date-time
  499. ; date-time defined in [DATETIME]
  500. mechanism = "INTERNAL" / 1*(ALPHA / DIGIT / "-" / ".")
  501. ; case-insensitive
  502. ; new mechanisms MUST be registered with IANA
  503. Crispin Standards Track [Page 14]
  504. RFC 4467 IMAP - URLAUTH Extension May 2006
  505. 10. Security Considerations
  506. Security considerations are discussed throughout this memo.
  507. The mailbox access key SHOULD have at least 128 bits of entropy
  508. (refer to [RANDOM] for more details) and MUST be unpredictable.
  509. The server implementation of the INTERNAL mechanism SHOULD consider
  510. the possibility of needing to change the token generation algorithm,
  511. and SHOULD incorporate some means of identifying the token generation
  512. algorithm within the token.
  513. The URLMECH status response code may expose sensitive data in the
  514. mechanism-specific data for mechanisms other than INTERNAL. A server
  515. implementation MUST implement a configuration that will not return a
  516. URLMECH status response code unless some mechanism is provided that
  517. protects the session from snooping, such as a TLS or SASL security
  518. layer that provides confidentiality protection.
  519. The calculation of an authorization token with a "plausible" key if
  520. the mailbox can not be identified is necessary to avoid attacks in
  521. which the server is probed to see if a particular mailbox exists on
  522. the server by measuring the amount of time taken to reject a known
  523. bad name versus some other name.
  524. To protect against a computational denial-of-service attack, a server
  525. MAY impose progressively longer delays on multiple URL requests that
  526. fail validation.
  527. The decision to use the "authuser" access identifier should be made
  528. with caution. An "authuser" access identifier can be used by any
  529. authorized user of the IMAP server; therefore, use of this access
  530. identifier should be limited to content that may be disclosed to any
  531. authorized user of the IMAP server.
  532. The decision to use the "anonymous" access identifier should be made
  533. with extreme caution. An "anonymous" access identifier can be used
  534. by anyone; therefore, use of this access identifier should be limited
  535. to content that may be disclosed to anyone. Many IMAP servers do not
  536. permit anonymous access; in this case, the "anonymous" access
  537. identifier is equivalent to "authuser", but this MUST NOT be relied
  538. upon.
  539. Although this specification does not prohibit the theoretical
  540. capability to generate a URL with a server component other than the
  541. logged in userid and server, this capability should only be provided
  542. Crispin Standards Track [Page 15]
  543. RFC 4467 IMAP - URLAUTH Extension May 2006
  544. when the logged in userid/server has been authorized as equivalent to
  545. the server component userid/server, or otherwise has access to that
  546. userid/server mailbox access key table.
  547. 11. IANA Considerations
  548. This document constitutes registration of the URLAUTH capability in
  549. the imap4-capabilities registry.
  550. URLAUTH authorization mechanisms are registered by publishing a
  551. standards track or IESG-approved experimental RFC. The registry is
  552. currently located at:
  553. http://www.iana.org/assignments/urlauth-authorization-mechanism-registry
  554. This registry is case-insensitive.
  555. This document constitutes registration of the INTERNAL URLAUTH
  556. authorization mechanism.
  557. IMAP URLAUTH Authorization Mechanism Registry
  558. Mechanism Name Reference
  559. -------------- ---------
  560. INTERNAL [RFC4467]
  561. Crispin Standards Track [Page 16]
  562. RFC 4467 IMAP - URLAUTH Extension May 2006
  563. 12. Normative References
  564. [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax
  565. Specifications: ABNF", RFC 4234, October 2005.
  566. [BURL] Newman, C., "Message Submission BURL Extension", RFC 4468,
  567. May 2006.
  568. [DATETIME] Klyne, G. and C. Newman, "Date and Time on the Internet:
  569. Timestamps", RFC 3339, July 2002.
  570. [IMAP] Crispin, M., "Internet Message Access Protocol - Version
  571. 4rev1", RFC 3501, March 2003.
  572. [IMAPURL] Newman, C., "IMAP URL Scheme", RFC 2192, September 1997.
  573. [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
  574. Requirement Levels", BCP 14, RFC 2119, March 1997.
  575. 13. Informative References
  576. [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
  577. Hashing for Message Authentication", RFC 2104, February
  578. 1997.
  579. [RANDOM] Eastlake, D., 3rd, Schiller, J., and S. Crocker,
  580. "Randomness Requirements for Security", BCP 106, RFC 4086,
  581. June 2005.
  582. Author's Address
  583. Mark R. Crispin
  584. Networks and Distributed Computing
  585. University of Washington
  586. 4545 15th Avenue NE
  587. Seattle, WA 98105-4527
  588. Phone: (206) 543-5762
  589. EMail: MRC@CAC.Washington.EDU
  590. Crispin Standards Track [Page 17]
  591. RFC 4467 IMAP - URLAUTH Extension May 2006
  592. Full Copyright Statement
  593. Copyright (C) The Internet Society (2006).
  594. This document is subject to the rights, licenses and restrictions
  595. contained in BCP 78, and except as set forth therein, the authors
  596. retain all their rights.
  597. This document and the information contained herein are provided on an
  598. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  599. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
  600. ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
  601. INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
  602. INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  603. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  604. Intellectual Property
  605. The IETF takes no position regarding the validity or scope of any
  606. Intellectual Property Rights or other rights that might be claimed to
  607. pertain to the implementation or use of the technology described in
  608. this document or the extent to which any license under such rights
  609. might or might not be available; nor does it represent that it has
  610. made any independent effort to identify any such rights. Information
  611. on the procedures with respect to rights in RFC documents can be
  612. found in BCP 78 and BCP 79.
  613. Copies of IPR disclosures made to the IETF Secretariat and any
  614. assurances of licenses to be made available, or the result of an
  615. attempt made to obtain a general license or permission for the use of
  616. such proprietary rights by implementers or users of this
  617. specification can be obtained from the IETF on-line IPR repository at
  618. http://www.ietf.org/ipr.
  619. The IETF invites any interested party to bring to its attention any
  620. copyrights, patents or patent applications, or other proprietary
  621. rights that may cover technology that may be required to implement
  622. this standard. Please address the information to the IETF at
  623. ietf-ipr@ietf.org.
  624. Acknowledgement
  625. Funding for the RFC Editor function is provided by the IETF
  626. Administrative Support Activity (IASA).
  627. Crispin Standards Track [Page 18]