<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='http://xml2rfc.tools.ietf.org/authoring/rfc2629.xslt' ?>
<!DOCTYPE rfc PUBLIC "-//IETF//DTD RFC 2629//EN"
"http://xml2rfc.tools.ietf.org/authoring/rfc2629.dtd">

<rfc category="std" docName="draft-ietf-oauth-mix-up-mitigation-01" ipr="trust200902">

  <?rfc toc="yes" ?>
  <?rfc tocdepth="5" ?>
  <?rfc symrefs="yes" ?>
  <?rfc sortrefs="yes"?>
  <?rfc strict="yes" ?>
  <?rfc compact='yes' ?>
  <?rfc subcompact='no' ?>

  <front>
    <title abbrev="OAuth 2.0 Mix-Up Mitigation">OAuth 2.0 Mix-Up Mitigation</title>

    <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
      <organization abbrev="Microsoft">Microsoft</organization>
      <address>
        <email>mbj@microsoft.com</email>
	<uri>http://self-issued.info/</uri>
      </address>
    </author>

    <author fullname="John Bradley" initials="J." surname="Bradley">
      <organization abbrev="Ping Identity">Ping Identity</organization>
      <address>
	<email>ve7jtb@ve7jtb.com</email>
	<uri>http://www.thread-safe.com/</uri>
      </address>
    </author>

    <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
      <organization abbrev="NRI">Nomura Research Institute, Ltd.</organization>
      <address>
        <email>n-sakimura@nri.co.jp</email>
	<uri>http://nat.sakimura.org/</uri>
      </address>
    </author>

    <date day="6" month="July" year="2016" />

    <area>Security</area>
    <workgroup>OAuth Working Group</workgroup>

    <keyword>OAuth</keyword>
    <keyword>Issuer</keyword>
    <keyword>Client ID</keyword>
    <keyword>Audience</keyword>
    <keyword>Discovery</keyword>
    <keyword>State</keyword>
    <keyword>Authorization Server</keyword>
    <keyword>Configuration Information</keyword>
    <keyword>Metadata</keyword>
    <keyword>JavaScript Object Notation</keyword>
    <keyword>JSON</keyword>
    <keyword>JSON Web Token</keyword>
    <keyword>JWT</keyword>

    <abstract>
      <t>
	This specification defines an extension to
	The OAuth 2.0 Authorization Framework
	that enables the authorization server to dynamically provide
	the client using it with additional information about
	the current protocol interaction that can be validated by the client
	and that enables the client to dynamically provide
	the authorization server with additional information about
	the current protocol interaction that can be validated
	by the authorization server.
	This additional information can be used by
	the client and the authorization server to prevent classes of attacks
	in which the client might otherwise be tricked into using
	inconsistent sets of metadata from multiple authorization servers,
	including potentially using a token endpoint that does not belong to
	the same authorization server as the authorization endpoint used.
	Recent research publications refer to these as
	"IdP Mix-Up" and "Malicious Endpoint" attacks.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>
	OAuth 2.0 <xref target="RFC6749"/> clients use multiple
	authorization server endpoints when using some OAuth response types.
	For instance, when using the <spanx style="verb">code</spanx>
	response type, the client uses both the authorization endpoint
	and the token endpoint.
	It is important that endpoints belonging to the same authorization server
	always be used together.
	Otherwise, information produced by one authorization server
	could mistakenly be sent by the client to different authorization server,
	resulting in some of the attacks described in <xref target="Security"/>.
	Recent research publications refer to these specific attacks as
	"IdP Mix-Up" <xref target="arXiv.1601.01229v2"/> and
	"Malicious Endpoint" <xref target="arXiv.1508.04324v2"/> attacks.
      </t>
      <t>
	The client obviously cannot be confused into using endpoints from multiple
	authorization servers in an authorization flow if the client
	is configured to use only a single authorization server.
	However, the client can potentially be tricked into mixing endpoints
	if it is configured to use more than one authorization server,
	whether the configuration is dynamic or static.
	The client may be confused if it has no way to determine whether
	the set of endpoints belongs to the same authorization server.
	Or, a client may be confused simply because
	it is receiving authorization responses from more than one
	authorization server at the same redirection endpoint
	and the client is insufficiently able to determine that
	the response received is associated with the correct authorization server.
      </t>
      <t>
	This specification enables the authorization server to dynamically provide
	the client using it with additional information about
	the current protocol interaction that can be validated by the client
	and that enables the client to dynamically provide
	the authorization server with additional information about
	the current protocol interaction that can be validated
	by the authorization server.
	This enables them to abort interactions in which endpoints from multiple
	authorization servers would otherwise be used.
      </t>
      <t>
	The mitigation data provided by the authorization server to the client
	is an issuer identifier, which is used to identify the authorization server,
	and a client ID, which is used to verify that the response
	is from the correct authorization server
	and is intended for this client.
	The issuer identifier is defined in
	Section 2 of <xref target="OAuth.Discovery"/>.
	If supported by the authorization server,
	the issuer identifier can also be used to obtain
	a consistent set of metadata describing the authorization server configuration,
	as also described in <xref target="OAuth.Discovery"/>.
      </t>
      <t>
	This mitigation data is returned to the client in the authorization response.
	The syntax for returning the mitigation data from the authorization server
	is dependent upon the OAuth response type being used.
	The syntax used with the existing response types registered in the IANA
	"OAuth Authorization Endpoint Response Types" registry <xref target="IANA.OAuth.Parameters"/>
	as of the time of this writing is defined by this specification.
	Two of these response types are defined by <xref target="RFC6749">RFC 6749</xref>;
	the rest are defined by <xref target="OAuth.Responses"/>.
      </t>
      <t>
	The mitigation data provided by the client to the authorization server
	is the existing <spanx style="verb">state</spanx> value
	defined by <xref target="RFC6749">RFC 6749</xref>,
	but adding also sending it from the client to the token endpoint.
	This is used by the authorization server to verify that
	the authorization code and state both belong to the same protocol interaction.
      </t>

      <section anchor="rnc" title="Requirements Notation and Conventions">
	<t>
	  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
	  "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY",
	  and "OPTIONAL" in this document are to be interpreted
	  as described in <xref target="RFC2119">RFC 2119</xref>.
	</t>
      </section>

      <section anchor="Terminology" title="Terminology">
	<t>
	  This specification uses the terms "Access Token", "Authorization Code",
	  "Authorization Endpoint", "Authorization Grant", "Authorization Server",
	  "Client", "Client Authentication", "Client Identifier", "Client Secret",
	  "Grant Type", "Protected Resource", "Redirection URI", "Refresh Token",
	  "Resource Owner", "Resource Server", "Response Type", and "Token Endpoint"
	  defined by <xref target="RFC6749">OAuth 2.0</xref>,
	  the terms "Claim Name", "Claim Value", and "JSON Web Token (JWT)"
	  defined by <xref target="JWT">JSON Web Token (JWT)</xref>.
	</t>
      </section>
    </section>

    <section anchor="Issuer" title="The OAuth Issuer Identifier">
      <t>
	The OAuth issuer identifier serves as a concrete identifier for the authorization server.
	As defined in <xref target="OAuth.Discovery"/>, the issuer identifier is a URL that
	uses the <spanx style="verb">https</spanx> scheme and has no query or fragment components.
	Also as specified there,
	this is the location where
	<spanx style="verb">.well-known</spanx> <xref target="RFC5785">RFC 5785</xref> resources
	containing information about the authorization server are published.
	In particular, when discovery is supported,
	the authorization server's metadata is retrieved as a JSON document <xref target="RFC7159"/>
	from a path derived from this URL.
	This metadata document contains
	a consistent set of metadata describing the authorization server configuration.
      </t>
      <t>
	Implementations supporting this specification MAY also support discovery or
	they MAY simply use the issuer identifier as a concrete identifier for the authorization server.
	This specification does not rely upon the authorization server publishing
	or the client retrieving a discovery metadata document.
      </t>
    </section>

    <section anchor="AuthorizationResponseData" title="Mitigation Data Returned in Authorization Response">

      <t>
	Mitigating the attacks relies on the authorization server returning
	additional data about the interaction and the client checking that data.
	The mitigation data returned is the client ID and the issuer identifier.
	The syntax for returning the mitigation data from the authorization server
	is dependent upon the OAuth response type being used.
      </t>

      <section anchor="ResponseParameters" title="Mitigation Data Returned in Authorization Response Parameters">
	<t>
	  Some OAuth response types do not already return
	  the issuer identifier and client ID in the authorization response.
	  When this is the case, the mitigation data is returned as additional
	  OAuth response parameters.
	</t>
	<t>
	  These new response parameters are defined for this purpose:

	  <list style="hanging">

	    <t hangText="client_id">
	      <vspace/>
	      Client that this response is intended for.
	      It MUST contain the OAuth 2.0 client ID
	      of the client as its value.
	    </t>

	    <t hangText="iss">
	      <vspace/>
	      Issuer identifier for the authorization server issuing the response.
	      The <spanx style="verb">iss</spanx> value is a case-sensitive URL
	      using the <spanx style="verb">https</spanx> scheme that
	      contains scheme, host, and optionally, port number and path
	      components and no query or fragment components.
	    </t>
	  </list>
	</t>
	<t>
	  As of the time of this writing, these are the existing response types
	  that are registered in the IANA
	  "OAuth Authorization Endpoint Response Types" registry <xref target="IANA.OAuth.Parameters"/>
	  that do not already return the issuer identifier and client ID in the authorization response:
	  <spanx style="verb">code</spanx>,
	  <spanx style="verb">code&nbsp;token</spanx>,
	  <spanx style="verb">none</spanx>,
	  and
	  <spanx style="verb">token</spanx>.
	  Therefore, the client ID and issuer are returned using
	  the new authorization response parameters when using these response types.
	  To avoid duplication, as discussed in <xref target="Duplication"/>,
	  it is NOT RECOMMENDED to also return them in this manner when the response type
	  already returns these values in the authorization response.
	</t>

	<section anchor="ParametersExample" title="Example Authorization Response using Response Parameters">
	  <t>
	    The following example authorization response is to a request
	    that used the <spanx style="verb">code</spanx> response type.
	    It uses the 
	    <spanx style="verb">iss</spanx> and <spanx style="verb">client_id</spanx>
	    response parameters to return the mitigation information to the client.
	  </t>
          <figure>
            <preamble>
              The example successful authorization response follows
	      (with line breaks within lines for display purposes only):
            </preamble>
            <artwork><![CDATA[
  HTTP/1.1 302 Found
  Location: https://client.example.org/cb?
    code=Qcb0Orv1zh30vL1MPRsbm-diHiMwcLyZvn1arpZv-Jxf_11jnpEX3Tgfvk
    &state=nrsz6AnHzPSVVBYRVTXV6ZTXQeg_eih7hdpewHNXmZ8
    &iss=https://server.example.com
    &client_id=5d9e8a36-569d-4c40-8d6b-6e279ac1c5f1
]]></artwork>
          </figure>
	</section>

      </section>

      <section anchor="DataInJWT" title="Mitigation Data Returned in JWT">
	<t>
	  As of the time of this writing, these are the existing response types
	  that are registered in the IANA
	  "OAuth Authorization Endpoint Response Types" registry <xref target="IANA.OAuth.Parameters"/>
	  that already return the issuer identifier and client ID in the authorization response:
	  <spanx style="verb">code&nbsp;id_token</spanx>,
	  <spanx style="verb">code&nbsp;id_token&nbsp;token</spanx>,
	  <spanx style="verb">id_token</spanx>,
	  and
	  <spanx style="verb">id_token&nbsp;token</spanx>.
	  All of these return these values
	  as the <spanx style="verb">iss</spanx> (issuer) claim value and
	  as an <spanx style="verb">aud</spanx> (audience) claim value
	  in a signed ID Token, which is a JSON Web Token <xref target="JWT"/>,
	  as specified in <xref target="OpenID.Core">"OpenID Connect Core 1.0"</xref>.
	  When using these response types, the client MUST use
	  the client ID and issuer values returned in the ID Token
	  for validating the mitigation data.
	</t>

	<section anchor="JWTExample" title="Example Authorization Response using JWT">
	  <t>
	    The following example authorization response is to a request
	    that used the <spanx style="verb">id_token&nbsp;token</spanx> response type.
	    It uses the
	    <spanx style="verb">iss</spanx> and <spanx style="verb">aud</spanx>
	    claims in the ID Token to return the mitigation information to the client.
	  </t>

	  <figure>
            <preamble>
              The example successful authorization response follows
	      (with line breaks within lines for display purposes only):
            </preamble>
	    <artwork><![CDATA[
  HTTP/1.1 302 Found
  Location: https://client.example.org/cb#
    access_token=jHkWEdUXMU1BwAsC4vtUsZwnNvTIxEl0z9K3vx5KF0Y
    &token_type=Bearer
    &id_token=eyJraWQiOiIxZTlnZGs3IiwiYWxnIjoiUlMyNTYifQ.
    ewogImlzcyI6ICJodHRwczovL3NlcnZlci5leGFtcGxlLmNvbSIsCiAic3ViIjog
    IjI0ODI4OTc2MTAwMSIsCiAiYXVkIjogInM2QmhkUmtxdDMiLAogIm5vbmNlIjog
    Im4tMFM2X1d6QTJNaiIsCiAiZXhwIjogMTMxMTI4MTk3MCwKICJpYXQiOiAxMzEx
    MjgwOTcwLAogImF0X2hhc2giOiAiNzdRbVVQdGpQZnpXdEYyQW5wSzlSUSIKfQ.
    kdqTmftlaXg5WBYBr1wkxhkqCGZPc0k8vTiV5g2jj67jQ7XkrDamYx2bOkZLdZrp
    MPIzkdYB1nZI_G8vQGQuamRhJcEIt21kblGPZ-yhEhdkAiZIZLu38rChalDS2Mh0
    glE_rke5XXRhmqqoEFFdziFdnO3p61-7y51co84OEAZvARSINQaOWIzvioRfs4zw
    IFOaT33Vpxfqr8HDyh31zo9eBW2dSQuCa071z0ENWChWoPliK1JCo_Bk9eDg2uwo
    2ZwhsvHzj6TMQ0lYOTzufSlSmXIKfjlOsb3nftQeR697_hA-nMZyAdL8_NRfaC37
    XnAbW8WB9wCfECp7cuNuOg
    &state=af0ifjsldkj
]]></artwork>
	  </figure>

	  <figure>
	    <preamble>
	      Decoding the ID Token in the response will yield the following claims,
	      which includes the mitigation information in the
	      <spanx style="verb">iss</spanx> and <spanx style="verb">aud</spanx>
	      claims:
	    </preamble>
	    <artwork><![CDATA[
  {
   "iss": "https://server.example.com",
   "sub": "248289761001",
   "aud": "s6BhdRkqt3",
   "nonce": "n-0S6_WzA2Mj",
   "exp": 1311281970,
   "iat": 1311280970,
   "at_hash": "77QmUPtjPfzWtF2AnpK9RQ"
  }
]]></artwork>
	  </figure>

	</section>

      </section>

    </section>

    <section anchor="AuthorizationResponseValidation" title="Validating the Authorization Response">
      <t>
	Upon receiving the mitigation data in an authorization response,
	the client MUST validate that the response was intended for it and that
	the authorization server metadata
	that it obtained at client registration time is consistent with
	the authorization server metadata contained in the
	metadata referenced by the issuer identifier.
      </t>
      <t>
	The client MUST validate the authorization server configuration as follows:
	<list style="numbers">
	  <t>
	    Compare the issuer identifier for the authorization server that
	    the client received when it registered at the authorization server
	    that it made the request to with the issuer value returned in
	    the <spanx style="verb">iss</spanx> response parameter or
	    the <spanx style="verb">iss</spanx> claim in the ID Token,
	    depending upon the response type being used.
	    If they do not exactly match,
	    the client MUST NOT proceed with the authorization.
	  </t>
	  <t>
	    Verify that the response is intended for this client
	    by confirming that the client's client identifier
	    for the authorization server the request was made to
	    matches the value of the <spanx style="verb">client_id</spanx>
	    response parameter or that the client's client identifier
	    is an audience value of the ID Token,
	    depending upon the response type being used.
	    If not, the client MUST NOT proceed with the authorization.
	  </t>
	</list>
      </t>
    </section>

    <section anchor="TokenRequestData" title="Mitigation Data Sent to the Token Endpoint">
      <t>
	Mitigating the attacks also relies on the client sending
	additional data about the interaction to the token endpoint,
	for response types that use it,
	and the authorization server checking that data.
	The mitigation data sent is the same state value
	that is sent in the authorization request
	and returned in the authorization response.
	This specification defines the new <spanx style="verb">state</spanx>
	token request parameter for passing this additional information.
      </t>
      <t>
	As of the time of this writing, these are the existing response types
	that are registered in the IANA
	"OAuth Authorization Endpoint Response Types" registry <xref target="IANA.OAuth.Parameters"/>
	that use the token endpoint:
	<spanx style="verb">code</spanx>,
	<spanx style="verb">code&nbsp;id_token</spanx>,
	<spanx style="verb">code&nbsp;id_token&nbsp;token</spanx>,
	and
	<spanx style="verb">code&nbsp;token</spanx>.
	The state value is to be sent in the <spanx style="verb">state</spanx>
	token request parameter when using these response types,
	and any new response types registered that use the token endpoint.
      </t>

      <section anchor="TokenRequestExample" title="Example Token Request">
	<t>
	  The following example token request is part of a protocol interaction
	  that used the <spanx style="verb">code</spanx> response type.
	  It uses the <spanx style="verb">state</spanx> 
	  request parameter to send mitigation information to the authorization server.
	</t>

	    <figure>
	      <preamble>
		The example of token request follows
		(with line breaks within lines for display purposes only):
	      </preamble>

	      <artwork><![CDATA[
  POST /token HTTP/1.1
  Host: server.example.com
  Content-Type: application/x-www-form-urlencoded
  Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW

  grant_type=authorization_code
    &code=SplxlOBeZQQYbYS6WxSbIA
    &redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb
    &state=ZSGXNBavNc-B3kU3DeJnZoWWOzYxsbvj7jp-S0x_z8U
]]></artwork>
	    </figure>
      </section>

    </section>

    <section anchor="TokenRequestValidation" title="Validating the Token Request">
      <t>
	When the authorization server receives a token request at the token endpoint
	that contains a value in the <spanx style="verb">state</spanx> parameter,
	it MUST validate that the state value received
	exactly matches the state value previously received
	in the corresponding authorization request.
	If the recorded state value and the state value received do not exactly match,
	the authorization server MUST NOT proceed with the authorization.
      </t>
    </section>

    <section anchor="Security" title="Security Considerations">

      <section anchor="MixUpAttacks" title="IdP Mix-Up and Malicious Endpoint Attacks">
	<t>
	  The attacks mitigated by this extension are described in detail in
	  "A Comprehensive Formal Security Analysis of OAuth 2.0"
	  <xref target="arXiv.1601.01229v2"/> and
	  "On the security of modern Single Sign-On Protocols:
	  Second-Order Vulnerabilities in OpenID Connect"
	  <xref target="arXiv.1508.04324v2"/>.
	  To mitigate these attacks, clients configured to use more than one
	  authorization server should use authorization servers that
	  return issuer and client ID information and should validate that
	  a consistent set of authorization server endpoints are being used
	  when using response types that utilize multiple endpoints.
	</t>
	<t>
	  When registering, clients SHOULD NOT allow multiple authorization servers
	  to return the same issuer value, and MUST NOT allow multiple authorization servers
	  to return the same issuer and client ID value pair.
	</t>
      </section>

      <section anchor="Duplication" title="Duplicate Information Attacks">
	<t>
	  If a protocol is
	  defined to return the same information in multiple locations,
	  this can create an additional attack surface.
	  Knowing that the information is supposed to be the same, recipients
	  will often be lazy and use the information from only one of the locations,
	  not validating that all the supposedly duplicate instances are the same.
	  This can enable attackers to create illegal protocol messages
	  that have different values in the multiple locations and those
	  illegal messages will not be detected or rejected by these lazy recipients.
	</t>
	<t>
	  For this reason, if an OAuth profile is being used
	  that returns the mitigation information defined by this specification
	  in one location, it SHOULD NOT also be returned in another.
	  In particular, if a JWT containing the client ID and issuer values
	  is being returned in the authorization response,
	  they SHOULD NOT also be returned as
	  individual authorization response parameters.
	</t>
      </section>

      <section anchor="CutAndPaste" title="Cut-and-Paste Attacks">
	<t>
	  OAuth authorization responses are sent as redirects to redirection URIs,
	  with the response parameters typically passed
	  as URI query parameters or fragment values.
	  A "cut-and-paste" attack is performed by the attacker creating
	  what appears to be a legitimate authorization response, but that
	  substitutes some of the response parameter values with
	  values of the attacker's choosing.
	  Sometimes this is done by copying or "cutting" some values out of
	  a legitimate response and replacing or "pasting" some of these values
	  into a different response,
	  the original version of which may have also been legitimate,
	  creating a combination of response values that are not legitimate
	  and that may cause behaviors sought by the attacker.
	  The Code Substitution threat
	  described in Section 4.4.1.13 of <xref target="RFC6819"/>
	  is one example of the use of a cut-and-paste attack.
	</t>
	<t>
	  A concern with returning the mitigation information as new individual
	  authorization response parameters
	  whose values are not cryptographically bound together
	  is that cut-and-paste attacks against their values will not be detected.
	  A security analysis has not been done of the effects of the new attacks
	  that the use of cut-and-paste against these new values will enable.
	</t>
	<t>
	  To prevent replay of the state in another browser instance by an attacker,
	  the state value MUST be tied to the browser instance
	  in a way that cannot be forged by an attacker.
	  Section 4 of <xref target="I-D.bradley-oauth-jwt-encoded-state"/>
	  provides several examples of how a client can accomplish this.
	</t>
	<t>
	  In the replay attack, the attacker can set cookies in the browser.
	  Using an unsigned cookie to bind state to the browser is not sufficient.
	</t>
      </section>

    </section>

    <section anchor="IANA" title="IANA Considerations">

      <section anchor="OAuthParametersRegistry" title="OAuth Parameters Registration">

	<t>
	  This specification registers the following parameters
	  in the IANA
	  "OAuth Parameters" registry <xref target="IANA.OAuth.Parameters"/>
	  established by <xref target="RFC6749">RFC 6749</xref>.
	</t>

	<section anchor='ParametersContents' title='Registry Contents'>
	  <t> <?rfc subcompact="yes"?>
	    <list style="symbols">
	      <t>Parameter name: <spanx style="verb">client_id</spanx></t>

	      <t>Parameter usage location: Authorization Response</t>

	      <t>Change controller: IESG</t>

	      <t>Specification document(s): <xref target="ResponseParameters"/> of [[ this specification ]]</t>

	      <t>Related information: None</t>
	    </list>
	  </t>
	  <t>
	    <list style="symbols">
	      <t>Parameter name: <spanx style="verb">iss</spanx></t>

	      <t>Parameter usage location: Authorization Response</t>

	      <t>Change controller: IESG</t>

	      <t>Specification document(s): <xref target="ResponseParameters"/> of [[ this specification ]]</t>

	      <t>Related information: None</t>
	    </list>
	  </t>
	  <t>
	    <list style="symbols">
	      <t>Parameter name: <spanx style="verb">state</spanx></t>

	      <t>Parameter usage location: Token Request</t>

	      <t>Change controller: IESG</t>

	      <t>Specification document(s): <xref target="TokenRequestData"/> of [[ this specification ]]</t>

	      <t>Related information: None</t>
	    </list>
	  </t>
	</section>
	<?rfc subcompact="no"?>

      </section>

    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119"?>
      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3629"?>
      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5785"?>
      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6749"?>
      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6819"?>
      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7159"?>
      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7662"?>

      <reference anchor="OAuth.Discovery" target="http://tools.ietf.org/html/draft-ietf-oauth-discovery-02">
        <front>
	  <title abbrev="OAuth 2.0 Discovery">OAuth 2.0 Discovery</title>

	  <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
	    <organization abbrev="Microsoft">Microsoft</organization>
	    <address>
	      <email>mbj@microsoft.com</email>
	      <uri>http://self-issued.info/</uri>
	    </address>
	  </author>

	  <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
	    <organization abbrev="NRI">Nomura Research Institute, Ltd.</organization>
	    <address>
	      <email>n-sakimura@nri.co.jp</email>
	      <uri>http://nat.sakimura.org/</uri>
	    </address>
	  </author>

	  <author fullname="John Bradley" initials="J." surname="Bradley">
	    <organization abbrev="Ping Identity">Ping Identity</organization>
	    <address>
	      <email>ve7jtb@ve7jtb.com</email>
	      <uri>http://www.thread-safe.com/</uri>
	    </address>
	  </author>

	  <date day="21" month="March" year="2016" />
        </front>
	<seriesInfo name="Internet-Draft" value="draft-ietf-oauth-discovery-02"/>
      </reference>
      
      <reference anchor="JWT" target="http://tools.ietf.org/html/rfc7519">
        <front>
          <title>JSON Web Token (JWT)</title>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Ping Identity">Ping Identity</organization>
          </author>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute, Ltd.</organization>
          </author>

          <date month="May" year="2015" />
        </front>

	<seriesInfo name="RFC" value="7519"/>
	<seriesInfo name="DOI" value="10.17487/RFC7519"/>
      </reference>

      <reference anchor="OAuth.Responses" target="http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html">
        <front>
	  <title>OAuth 2.0 Multiple Response Type Encoding Practices</title>

	  <author fullname="Breno de Medeiros" initials="B." role="editor" surname="de Medeiros">
	    <organization abbrev="Google">Google</organization>
	  </author>

	  <author fullname="Marius Scurtescu" initials="M." surname="Scurtescu">
	    <organization abbrev="Google">Google</organization>
	  </author>

	  <author fullname="Paul Tarjan" initials="P." surname="Tarjan">
	    <organization abbrev="Facebook"> Facebook</organization>
	  </author>

	  <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
	    <organization abbrev="Microsoft">Microsoft</organization>
	  </author>

	  <date day="25" month="February" year="2014" />
        </front>
      </reference>

      <reference anchor="IANA.OAuth.Parameters" target="http://www.iana.org/assignments/oauth-parameters">
        <front>
          <title>OAuth Parameters</title>
          <author>
            <organization>IANA</organization>
          </author>
	  <date/>
        </front>
      </reference>

      <reference anchor="OpenID.Core" target="http://openid.net/specs/openid-connect-core-1_0.html">
        <front>
          <title>OpenID Connect Core 1.0</title>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute, Ltd.</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Ping Identity">Ping Identity</organization>
          </author>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <author fullname="Breno de Medeiros" initials="B." surname="de Medeiros">
            <organization abbrev="Google">Google</organization>
          </author>

	  <author fullname="Chuck Mortimore" initials="C." surname="Mortimore">
	    <organization abbrev="Salesforce">Salesforce</organization>
	  </author>

          <date day="8" month="November" year="2014"/>
        </front>
      </reference>

    </references>

    <references title="Informative References">

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7591"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-bradley-oauth-jwt-encoded-state-05.xml" ?>

      <reference anchor="arXiv.1601.01229v2"
		 target="http://arxiv.org/abs/1601.01229v2/">
	<front>
	  <title>A Comprehensive Formal Security Analysis of OAuth 2.0</title>
	  <author fullname="Daniel Fett" surname="Fett" initials="D."><organization/></author>
	  <author fullname="Ralf Kuesters" surname="Kuesters" initials="R."><organization/></author>
	  <author fullname="Guido Schmitz" surname="Schmitz" initials="G."><organization/></author>

	  <date day="7" month="January" year="2016"/>
	</front>
	<seriesInfo name="arXiv" value="1601.01229v2"/>
      </reference>

      <reference anchor="arXiv.1508.04324v2"
		 target="http://arxiv.org/abs/1508.04324v2/">
	<front>
	  <title>On the security of modern Single Sign-On Protocols: Second-Order Vulnerabilities in OpenID Connect</title>
	  <author fullname="Vladislav Mladenov" surname="Mladenov" initials="V."><organization/></author>
	  <author fullname="Christian Mainka" surname="Mainka" initials="C."><organization/></author>
	  <author fullname="Joerg Schwenk" surname="Schwenk" initials="J."><organization/></author>

	  <date day="7" month="January" year="2016"/>
	</front>
	<seriesInfo name="arXiv" value="1508.04324v2"/>
      </reference>

    </references>

    <section anchor="ImplementationNotes" title="Implementation Notes">
      <t>
	The authorization server can compare the two state values
	either by recording the complete state value
	between the authorization request and the token request,
	possibly in the same data structure in which the authorization code issued was recorded,
	or by recording only a cryptographic hash of the state value,
	possibly resulting in substantial size savings.
      </t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">

      <t>
	Alfred Albrecht,
	John Bradley,
	Brian Campbell,
	Joerg Connotte,
	William Denniss,
	Sebastian Ebling,
	Florian Feldmann,
	Daniel Fett,
	Roland Hedberg,
	Phil Hunt,
	Ralf Kuesters,
	Torsten Lodderstedt,
	Christian Mainka,
	Vladislav Mladenov,
	Anthony Nadalin,
	Justin Richer,
	Nat Sakimura,
	Antonio Sanso,
	Guido Schmitz,
	Joerg Schwenk,
	Hannes Tschofenig,
	and
	Hans Zandbelt
	all contributed to the discussions that led to the creation of this specification.
      </t>
      <t>
	This specification is partially based on the OpenID Connect Core 1.0 specification,
	which was produced by the OpenID Connect working group of the OpenID Foundation.
      </t>
    </section>

    <section anchor="TBD" title="Open Issues">
      <t>
        <list style="symbols">
	  <t>
	    We need to do a security analysis of the cut-and-paste attacks
	    that may be enabled when mitigation information is returned to the client
	    using individual authorization response parameters.
	  </t>
	</list>
      </t>
    </section>

    <section anchor="History" title="Document History">
      <t>[[ to be removed by the RFC Editor before publication as an RFC ]]</t>

      <t>
	-01
        <list style="symbols">
	  <t>
	    Changed terms "issuer URL" and "configuration information location"
	    to "issuer identifier" so that consistent terminology is used for this.
	  </t>
	</list>
      </t>

      <t>
	-00
        <list style="symbols">
	  <t>
	    Created the initial working group draft from
	    draft-jones-oauth-mix-up-mitigation-01 with no normative changes
	    and adding Nat Sakimura as an editor.
	  </t>
	</list>
      </t>

    </section>

  </back>
</rfc>
