home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_n_r / draft-newman-tls-imappop-00.txt < prev    next >
Text File  |  1997-08-28  |  20KB  |  509 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          C. Newman
  8. Internet Draft: Protecting IMAP4 and POP3 Connections           Innosoft
  9. Document: draft-newman-tls-imappop-00.txt                    August 1997
  10.  
  11.  
  12.                  Protecting IMAP4 and POP3 Connections
  13.  
  14.  
  15. Status of this memo
  16.  
  17.      This document is an Internet-Draft.  Internet-Drafts are working
  18.      documents of the Internet Engineering Task Force (IETF), its areas,
  19.      and its working groups.  Note that other groups may also distribute
  20.      working documents as Internet-Drafts.
  21.  
  22.      Internet-Drafts are draft documents valid for a maximum of six
  23.      months and may be updated, replaced, or obsoleted by other
  24.      documents at any time.  It is inappropriate to use Internet-Drafts
  25.      as reference material or to cite them other than as "work in
  26.      progress."
  27.  
  28.      To view the entire list of current Internet-Drafts, please check
  29.      the "1id-abstracts.txt" listing contained in the Internet-Drafts
  30.      Shadow Directories on ftp.is.co.za (Africa), ftp.nordu.net
  31.      (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East
  32.      Coast), or ftp.isi.edu (US West Coast).
  33.  
  34.  
  35. Introduction
  36.  
  37.      The TLS protocol [TLS] (formerly known as SSL) provides a way to
  38.      secure a connection from tampering and evesdropping.  Obviously,
  39.      such security is desirable for IMAP [IMAP4] and POP [POP3].
  40.      Although advanced authentication mechanisms [IMAP-AUTH, POP-AUTH]
  41.      can provide this service with less complexity than TLS, TLS is
  42.      useful in combination with plaintext password logins and other
  43.      simple mechanisms as it doesn't require a site to upgrade its
  44.      authentication database.
  45.  
  46.      The common practice of using a separate port for a secure version
  47.      of each protocol has a number of disadvantages in the IMAP [IMAP4]
  48.      and POP [POP3] environment.  Rather than using the best security
  49.      available, it means that clients have to be explicitly configured
  50.      to use the separate secure port or suffer the performance loss of
  51.      probing for active ports.  For IMAP, this is even more serious as
  52.      it would require the definition of a new URL scheme which would
  53.      require support for TLS in order to gain access.
  54.  
  55.  
  56.  
  57.  
  58. Newman                                                          [Page 1]
  59.  
  60. Internet Draft   Protecting IMAP4 and POP3 Connections       August 1997
  61.  
  62.  
  63.      This specification defines extensions to IMAP4 and POP3 which
  64.      activate TLS.  It defines a set of server security policy response
  65.      codes for use with IMAP4, and extends POP3 to permit such response
  66.      codes.  The response codes MAY be used independently of the TLS
  67.      extension.
  68.  
  69.  
  70. 0. Open Issues
  71.  
  72.      1. The cipher suite requirement is included to meet the decisions
  73.      made at the Munich and Danvers IETF meetings.  The additional text
  74.      about exportable ciphers is my invention to hopefully improve
  75.      interoperability.  Comments are welcome.
  76.  
  77.      2. Should I explicitly revoke registration of the IMAP+SSL port?
  78.      I'm not inclined to do so as this isn't as serious a design flaw as
  79.      the SMTP+SSL port, and there are already deployed IMAP+SSL
  80.      implementations.
  81.  
  82.      3. Any security considerations I missed?
  83.  
  84.  
  85. 1. Conventions Used in this Document
  86.  
  87.      The key words "REQUIRED", "MUST", "MUST NOT", "SHOULD", "SHOULD
  88.      NOT", and "MAY" in this document are to be interpreted as described
  89.      in "Key words for use in RFCs to Indicate Requirement Levels"
  90.      [KEYWORDS].
  91.  
  92.      Formal syntax is defined using ABNF [ABNF].
  93.  
  94.      In examples, "C:" and "S:" indicate lines sent by the client and
  95.      server respectively.
  96.  
  97.  
  98. 2. IMAP4 STARTTLS extension
  99.  
  100.      When the TLS extension is present in IMAP4, "STARTTLS" is listed as
  101.      a capability in response to the CAPABILITY command.  This extension
  102.      adds a single command, "STARTTLS" to the IMAP4 protocol which is
  103.      used to begin a TLS negotiation.
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Newman                                                          [Page 2]
  115.  
  116. Internet Draft   Protecting IMAP4 and POP3 Connections       August 1997
  117.  
  118.  
  119. 2.1. STARTTLS Command
  120.  
  121.    Arguments:  none
  122.  
  123.    Responses:  no specific responses for this command
  124.  
  125.    Result:     OK - begin TLS negotiation
  126.                NO - security layer already active
  127.                BAD - command unknown or arguments invalid
  128.  
  129.       A TLS negotiation begins immediately after the CRLF at the end of
  130.       the tagged OK response from the server.  The STARTTLS command MAY
  131.       be used in any state.  However, a NO response MAY result if a
  132.       security layer is already active.  Once a client issues a STARTTLS
  133.       command, it MUST NOT issue further commands until a server
  134.       response is seen.
  135.  
  136.       If STARTTLS is issued in non-authenticated state, the server
  137.       remains in non-authenticated state, even if client credentials are
  138.       supplied during the TLS negotiation.  The SASL [SASL] EXTERNAL
  139.       mechanism MAY be used to authenticate once TLS client credentials
  140.       are successfully exchanged, but servers supporting the STARTTLS
  141.       command are not required to support the EXTERNAL mechanism.
  142.  
  143.       Support for the TLS mechanism TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA is
  144.       REQUIRED by all IMAP software implementing this extension.
  145.       Implementations MUST NOT assume any other cipher suite is present.
  146.       Unfortunately, it is possible that due to certain government
  147.       export restrictions some non-compliant versions of this extension
  148.       could be deployed.  Implementations wishing to interoperate with
  149.       such non-compliant versions MAY offer the
  150.       TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA mechanism.  However, since
  151.       40 bit ciphers are known to be vulnerable to attack by current
  152.       technology, any client which actives a 40 bit cipher MUST NOT
  153.       indicate to the user that the connection is secure from
  154.       evesdropping.
  155.  
  156.       The formal syntax for IMAP4 is amended as follows:
  157.  
  158.         command_any   =/  "STARTTLS"
  159.  
  160.    Example:    C: a001 CAPABILITY
  161.                S: * CAPABILITY IMAP4rev1 STARTTLS
  162.                S: a001 OK CAPABILITY completed
  163.                C: a002 STARTTLS
  164.                S: a002 OK Begin TLS negotiation now
  165.                <TLS negotation begins, futher commands sent under TLS layer>
  166.                C: a003 LOGIN joe password
  167.  
  168.  
  169.  
  170. Newman                                                          [Page 3]
  171.  
  172. Internet Draft   Protecting IMAP4 and POP3 Connections       August 1997
  173.  
  174.  
  175.                S: a003 OK LOGIN completed
  176.  
  177. 3. New IMAP4 response codes
  178.  
  179.       This specification defines three new IMAP4 response codes which
  180.       MAY be used to communicate server security policy to the client.
  181.       These MAY be implemented independently of the STARTTLS command.
  182.  
  183.  
  184.       ENCRYPT-NEEDED This occurs on a tagged NO response to an
  185.                      AUTHENTICATE or LOGIN command and indicates that
  186.                      the requested authentication mechanism is only
  187.                      permitted underneath a security layer.  The client
  188.                      MAY then issue the STARTTLS command and repeat the
  189.                      same AUTHENTICATE or LOGIN command, or try an
  190.                      AUTHENTICATE command with a stronger mechanism.
  191.                      The client SHOULD record the fact that encryption
  192.                      is needed for that user, server and mechanism
  193.                      combination.
  194.  
  195.       AUTH-TOO-WEAK  This occurs on a tagged NO response to an
  196.                      AUTHENTICATE or LOGIN command and indicates that
  197.                      the mechanism is too weak and is no longer
  198.                      permitted for that user by site policy.  This
  199.                      allows a mechanism to be disabled on a per-user
  200.                      rather than a per-server level which is useful if
  201.                      different users have different security
  202.                      requirements or for transitioning from plaintext
  203.                      LOGIN to a more secure mechanism.  The client
  204.                      SHOULD record the fact that the user, server and
  205.                      mechanism combination is no longer permitted.
  206.  
  207.       TRANSITION-NEEDED
  208.                      This occurs on a tagged NO response to an
  209.                      AUTHENTICATE command.  It indicates that the server
  210.                      has an entry for the specified user in a legacy
  211.                      authentication database but does not yet have
  212.                      credentials to offer the requested mechanism.  A
  213.                      client which receives this error code MAY do a
  214.                      one-time login using the LOGIN command or another
  215.                      plaintext mechanism (preferably protected by the
  216.                      STARTTLS command) to initialize credentials for the
  217.                      requested mechanism.
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Newman                                                          [Page 4]
  227.  
  228. Internet Draft   Protecting IMAP4 and POP3 Connections       August 1997
  229.  
  230.  
  231. 4. POP3 STARTTLS extension
  232.  
  233.    The POP3 STARTTLS extension adds the STLS command to POP3 servers.
  234.  
  235.       STLS
  236.  
  237.          Arguments: none
  238.  
  239.          Restrictions:
  240.              MAY be given in any state, but MAY fail if a security layer
  241.              is already active.
  242.  
  243.          Discussion:
  244.              A TLS negotiation begins immediately after the CRLF at the
  245.              end of the +OK response from the server.  A -ERR response
  246.              MAY result if a security layer is already active.  Once a
  247.              client issues a STLS command, it MUST NOT issue further
  248.              commands until a server response is seen.
  249.  
  250.              If STLS is issued in authorization state, the server
  251.              remains in authorization state, even if client credentials
  252.              are supplied during the TLS negotiation.  The AUTH command
  253.              [POP3-AUTH] with the EXTERNAL mechanism [SASL] MAY be used
  254.              to authenticate once TLS client credentials are
  255.              successfully exchanged, but servers supporting the STLS
  256.              command are not required to support the EXTERNAL mechanism.
  257.  
  258.              Support for the TLS mechanism
  259.              TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA is REQUIRED by all POP3
  260.              software implementing this extension.  Implementations MUST
  261.              NOT assume any other cipher suite is present.
  262.              Unfortunately, it is possible that due to certain
  263.              government export restrictions some non-compliant versions
  264.              of this extension could be deployed.  Implementations
  265.              wishing to interoperate with such non-compliant versions
  266.              MAY offer the TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
  267.              mechanism.  However, since 40 bit ciphers are known to be
  268.              vulnerable to attack by current technology, any client
  269.              which actives a 40 bit cipher MUST NOT indicate to the user
  270.              that the connection is secure from evesdropping.
  271.  
  272.          Possible Responses:
  273.              +OK -ERR
  274.  
  275.          Examples:
  276.              C: STLS
  277.              S: +OK Begin TLS negotiation
  278.              <TLS negotiation begins>
  279.  
  280.  
  281.  
  282. Newman                                                          [Page 5]
  283.  
  284. Internet Draft   Protecting IMAP4 and POP3 Connections       August 1997
  285.  
  286.  
  287.                ...
  288.              C: STLS
  289.              S: -ERR Security Layer already active
  290.  
  291. 5. POP3 response code extension
  292.  
  293.      POP3 is currently only capable of indicating success or failure to
  294.      most commands.  Unfortunately, clients often need to know more
  295.      information about the cause of a failure in order to gracefully
  296.      recover.  The security policy response codes defined for IMAP in
  297.      section 3 are a specific example of this.
  298.  
  299.      This specification amends the POP3 standard to permit an optional
  300.      response code, enclosed in square brackets, at the beginning of the
  301.      human readable text portion of a "+OK" or "-ERR" response.  Clients
  302.      supporting this extension MAY remove any information enclosed in
  303.      square brackets prior to displaying human readable text to the
  304.      user.  Immediately following the open square bracket "[" character
  305.      is a response code which is interpreted in a case-insensitive
  306.      fashion by the client.
  307.  
  308.      The response code is hierarchical, with a "/" separating levels of
  309.      detail about the error.  Clients MUST ignore unknown hierarchical
  310.      detail about the response code.  This is important, as it could be
  311.      necessary to provide further detail for response codes in the
  312.      future.  For example, ENCRYPT-NEEDED/TLS and ENCRYPT-NEEDED/SSH
  313.      might indicate a suggestion to use the TLS or SSH protocols
  314.      respectively for encryption.
  315.  
  316.      Examples:
  317.          C: USER mrose
  318.          S: -ERR [ENCRYPT-NEEDED] You need to activate encryption before
  319.                  logging in.
  320.  
  321.  
  322. 5.1. POP3 response codes
  323.  
  324.       This specification defines three new POP3 response codes which MAY
  325.       be used to communicate server security policy to the client.
  326.       These MAY be implemented independently of the STARTTLS extension.
  327.  
  328.  
  329.       ENCRYPT-NEEDED This occurs on an -ERR response to an AUTH, USER or
  330.                      APOP command and indicates that the requested
  331.                      authentication mechanism is only permitted
  332.                      underneath a security layer.  The client MAY then
  333.                      issue the STLS command and repeat the same AUTH,
  334.                      USER or APOP command or try an AUTH command with a
  335.  
  336.  
  337.  
  338. Newman                                                          [Page 6]
  339.  
  340. Internet Draft   Protecting IMAP4 and POP3 Connections       August 1997
  341.  
  342.  
  343.                      stronger mechanism.  The client SHOULD record the
  344.                      fact that encryption is needed for that user,
  345.                      server and mechanism combination.
  346.  
  347.       AUTH-TOO-WEAK  This occurs on an -ERR response to an AUTH, USER or
  348.                      APOP command and indicates that the mechanism is
  349.                      too weak and is no longer permitted for that user
  350.                      by site policy.  This allows a mechanism to be
  351.                      disabled on a per-user rather than a per-server
  352.                      level which is useful if different users have
  353.                      different security requirements or for
  354.                      transitioning from plaintext USER/PASS to a more
  355.                      secure mechanism.  The client SHOULD record the
  356.                      fact that the user, server and mechanism
  357.                      combination is no longer permitted.
  358.  
  359.       TRANSITION-NEEDED
  360.                      This occurs on an -ERR response to an AUTH or APOP
  361.                      command.  It indicates that the server has an entry
  362.                      for the specified user in a legacy authentication
  363.                      database but does not yet have credentials to offer
  364.                      the requested mechanism.  A client which receives
  365.                      this error code MAY do a one-time login using the
  366.                      USER/PASS commands or another plaintext mechanism
  367.                      (preferably protected by the STLS command) to
  368.                      initialize credentials for the requested mechanism.
  369.  
  370.  
  371. 6. imaps and pop3s ports
  372.  
  373.      Use of the registered "imaps" and "pop3s" ports is hereby strongly
  374.      discouraged and considered non-standard behavior.
  375.  
  376.  
  377. 7. Security Considerations
  378.  
  379.      The mechanisms described in this document only apply to protecting
  380.      a single connection.  Messages are still available to server
  381.      administrators and usually subject to evesdropping, tampering and
  382.      forgery when transmitted through SMTP or NNTP.  Protecting messages
  383.      requires an object security mechanism such as PGP MIME [PGP-MIME].
  384.  
  385.      An active attacker for IMAP can remove STARTTLS from the IMAP
  386.      CAPABILITY list, or cause the POP3 STLS command to fail with a
  387.      message such as "-ERR Unknown command."  In order to detect such an
  388.      attack, clients SHOULD either warn the user when session protection
  389.      is not active, or be configurable to refuse to proceed without an
  390.      acceptable level of security.
  391.  
  392.  
  393.  
  394. Newman                                                          [Page 7]
  395.  
  396. Internet Draft   Protecting IMAP4 and POP3 Connections       August 1997
  397.  
  398.  
  399.      If a client uses a weak mechanism which sends the user name at the
  400.      same time as the authentication credentials, such as IMAP4's LOGIN
  401.      command, the ENCRYPT-NEEDED or AUTH-TOO-WEAK error codes will not
  402.      prevent exposure.  For this reason, clients SHOULD record the fact
  403.      that that user, server and mechanism combination is unacceptable to
  404.      prevent future exposure or be configurable to try stronger
  405.      mechanisms or activate encryption first.
  406.  
  407.      An active attacker could cause a bogus TRANSITION-NEEDED response
  408.      to a stronger authentication mechanism.  For this reasons, clients
  409.      SHOULD either activate TLS prior to authentication or get explicit
  410.      permission from the user prior to using a plaintext mechanism for
  411.      automated transition.
  412.  
  413.      An attacker might probe for users at a site by trying a strong
  414.      authentication mechanism which could result in TRANSITION-NEEDED
  415.      for some users.  Strong mechanisms can progress partway through
  416.      negotiation prior to issuing the TRANSITION-NEEDED failure message
  417.      in order to avoid this problem.
  418.  
  419.      An attacker might probe for users using the POP3 USER command to
  420.      probe for AUTH-TOO-WEAK or ENCRYPT-NEEDED.  Server implementations
  421.      could use these error codes for unknown users to defeat this
  422.      attack.  Delaying the error until after the PASS command is
  423.      supplied would unnecessarily reveal a user's password and thus
  424.      would be a far more serious problem than probing for users.
  425.  
  426.      An active attacker can always cause a down-negotiation to the
  427.      weakest authentication mechanism or cipher suite available.  For
  428.      this reason, implementations need to be configurable to refuse weak
  429.      mechanisms or cipher suites.
  430.  
  431.  
  432. 8. References
  433.  
  434.      [ABNF] Crocker, "Augmented BNF for Syntax Specifications: ABNF", work
  435.      in progress.
  436.  
  437.      [IMAIL] Crocker, D., "Standard for the Format of Arpa Internet Text
  438.      Messages", RFC 822, University of Delaware, August 1982.
  439.  
  440.           <ftp://ds.internic.net/rfc/rfc822.txt>
  441.  
  442.      [IMAP4] Crispin, M., "Internet Message Access Protocol - Version 4rev1",
  443.      RFC 2060, University of Washington, December 1996.
  444.  
  445.          <ftp://ds.internic.net/rfc/rfc2060.txt>
  446.  
  447.  
  448.  
  449.  
  450. Newman                                                          [Page 8]
  451.  
  452. Internet Draft   Protecting IMAP4 and POP3 Connections       August 1997
  453.  
  454.  
  455.      [IMAP-AUTH] Myers, J., "IMAP4 Authentication Mechanism", RFC 1731,
  456.      Carnegie-Mellon University, December 1994.
  457.  
  458.          <ftp://ds.internic.net/rfc/rfc1731.txt>
  459.  
  460.      [KEYWORDS] Bradner, "Key words for use in RFCs to Indicate Requirement
  461.      Levels", RFC 2119, Harvard University, March 1997.
  462.  
  463.          <ftp://ds.internic.net/rfc/rfc2119.txt>
  464.  
  465.      [PGP-MIME] Elkins, M., "MIME Security with Pretty Good Privacy (PGP)",
  466.      RFC 2015, The Aerospace Corporation, October 1996.
  467.  
  468.           <ftp://ds.internic.net/rfc/rfc2015.txt>
  469.  
  470.      [POP3] Myers, J., Rose, M., "Post Office Protocol - Version 3", RFC
  471.      1939, Carnegie Mellon, Dover Beach Consulting, Inc., May 1996.
  472.  
  473.              <ftp://ds.internic.net/rfc/rfc1939.txt>
  474.  
  475.      [POP-AUTH] Myers, "POP3 AUTHentication command", RFC 1734, Carnegie
  476.      Mellon, December 1994.
  477.  
  478.          <ftp://ds.internic.net/rfc/rfc1734.txt>
  479.  
  480.      [SASL] Myers, "Simple Authentication and Security Layer (SASL)", Work
  481.      in progress.
  482.  
  483.      [TLS] Dierks, Allen, "The TLS Protocol Version 1.0", Work in progress.
  484.  
  485.  
  486. 9. Author's Address
  487.  
  488.      Chris Newman
  489.      Innosoft International, Inc.
  490.      1050 Lakes Drive
  491.      West Covina, CA 91790 USA
  492.  
  493.      Email: chris.newman@innosoft.com
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. Newman                                                          [Page 9]
  507.  
  508.  
  509.