<?xml version='1.0' encoding='ascii'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc ipr="trust200902" category="info" docName="opend-fapi-financial_api_wd_002" obsoletes="" updates="" submissionType="IETF" xml:lang="en">
  <?rfc toc="yes" ?>
  <?rfc tocdepth="4" ?>
  <?rfc symrefs="yes" ?>
  <?rfc sortrefs="yes"?>
  <?rfc strict="yes" ?>
  <?rfc iprnotified="no" ?>
  <?rfc private="Draft" ?>
  <front>
    <title abbrev="FAPI - Part 2">Financial Services &#8211; Financial API - Part 2: Read and Write API Security Profile</title>
    <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>
    <author fullname="Edmund Jay" initials="E." surname="Jay">
      <organization abbrev="Illumila">Illumila</organization>
      <address>
        <email>ejay@mgi1.com</email>
        <uri>http://illumi.la/</uri>
      </address>
    </author>
    <date day="29" month="May" year="2017"/>
    <note title="Warning">
      <t>This document is not an OIDF International Standard. It is distributed for review and comment. It is subject to change without notice and may not be referred to as an International Standard.  </t>
      <t>Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.  </t>
    </note>
    <note title="Copyright notice">
      <t>The OpenID Foundation (OIDF) grants to any Contributor, developer, implementer, or other interested party a non-exclusive, royalty free, worldwide copyright license to reproduce, prepare derivative works from, distribute, perform and display, this Implementers Draft or Final Specification solely for the purposes of (i) developing specifications, and (ii) implementing Implementers Drafts and Final Specifications based on such documents, provided that attribution be made to the OIDF as the source of the material, but that such attribution does not indicate an endorsement by the OIDF.  </t>
      <t>The technology described in this specification was made available from contributions from various sources, including members of the OpenID Foundation and others. Although the OpenID Foundation has taken steps to help ensure that the technology is available for distribution, it takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this specification or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any independent effort to identify any such rights. The OpenID Foundation and the contributors to this specification make no (and hereby expressly disclaim any) warranties (express, implied, or otherwise), including implied warranties of merchantability, non-infringement, fitness for a particular purpose, or title, related to this specification, and the entire risk as to implementing this specification is assumed by the implementer. The OpenID Intellectual Property Rights policy requires contributors to offer a patent promise not to assert certain patent claims against other contributors and against implementers. The OpenID Foundation invites any interested party to bring to its attention any copyrights, patents, patent applications, or other proprietary rights that may cover technology that may be required to practice this specification.  </t>
    </note>
    <note title="Foreword">
      <t>OIDF (OpenID Foundation) is an international standardizing body comprised by over 160 participating entities (work group participants). The work of preparing international standards is carried out through OIDF work groups according to OpenID Process.  Each participants interested in a subject for which a work group has been established has the right to be represented on that work group. International organizations, governmental and non-governmental, in liaison with OIDF, also take part in the work. OIDF collaborates closely with other standardizing bodies in the related fields.  </t>
      <t>OpenID Foundation standards are drafted in accordance with the rules given in the OpenID Process.  </t>
      <t>The main task of work group is to prepare Implementers Draft and Final Draft. Final Draft adopted by the Work Group through consensus are circulated publicly for the public review for 60 days and for the OIDF members for voting. Publication as an OIDF Standard requires approval by at least 50 % of the members casting a vote.  </t>
      <t>Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. OIDF shall not be held responsible for identifying any or all such patent rights.  </t>
      <t>Financial API - Part 1: Read Only API Security Profile was prepared by OpenID Foundation Financial API Work Group.  </t>
      <t>Financial API consists of the following parts, under the general title Financial Services &#8212; Financial API: </t>
      <t>
        <list style="symbols">
          <t>Part 1: Read Only API Security Profile </t>
          <t>Part 2: Read and Write API Security Profile </t>
          <t>Part 3: Open Data API </t>
          <t>Part 4: Protected Data API and Schema - Read only </t>
          <t>Part 5: Protected Data API and Schema - Read and Write </t>
        </list>
      </t>
      <t>This part is intended to be used with [RFC6749], [RFC6750], [RFC6736], and [OIDC].  </t>
    </note>
    <note title="Introduction">
      <t>In many cases, Fintech services such as aggregation services use screen scraping and store user passwords. This model is both brittle and insecure. To cope with the brittleness, it should utilize an API model with structured data and to cope with insecurity, it should utilize a token model such as OAuth [RFC6749, RFC6750].  </t>
      <t>Financial API aims to rectify the situation by developing a REST/JSON model protected by OAuth. However, just asking to use OAuth is too vague as there are many implementation choices. OAuth is a framework which can cover wide range of use-cases thus some implementation choices are easy to implement but less secure and some implementation choices are harder to implement but more secure.  Financial services on the internet is a use-case that requires more secure implementation choices. That is, OAuth needs to be profiled to be used in the financial use-cases.  </t>
      <t>This document is a Part 2 of a set of document that specifies Financial API. It provides a profile of OAuth that is suitable to be used in the write access to the financial data also known as the transactional access. To achieve it, this part of the document specifies the control against such attacks like authorization request tampering, the authorization response tampering including code injection and the state injection, token request phishing, etc. More details are available in the security consideration section.</t>
    </note>
    <note title="Notational Conventions">
      <t>The keywords "shall", "shall not", "should", "should not", "may", and "can" in this document are to be interpreted as described in ISO Directive Part 2 [ISODIR2]. These keywords are not used as dictionary terms such that any occurrence of them shall be interpreted as keywords and are not to be interpreted with their natural language meanings.</t>
    </note>
  </front>
  <middle><!--This document was prepared using Pandoc2rfc, https://github.com/miekg/pandoc2rfc --><section title="Scope" anchor="scope" toc="default"><t>This part of the document specifies the method of </t><t><list style="symbols"><t>applications to obtain the OAuth tokens in an appropriately secure manner for financial data access; </t><t>application to utilize OpenID Connect to identify the customer; and </t><t>using the tokens to interact with the REST endpoints that provides financial data; </t></list></t><t>This document is applicable to higher risk use cases which includes commercial and investment banking.  </t></section><section title="Normative references" anchor="normative-references" toc="default"><t>The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applied. For undated references, the latest edition of the referenced document (including any amendments) applies.  </t><t>[ISODIR2] - ISO/IEC Directives Part 2 [ISODIR2]: http://www.iso.org/sites/directives/2016/part2/index.xhtml </t><t>[RFC7230] - Hypertext Transfer Protocol -- HTTP/1.1 [RFC7230]: https://tools.ietf.org/html/rfc7230 </t><t>[RFC6749] - The OAuth 2.0 Authorization Framework [RFC6749]: https://tools.ietf.org/html/rfc6749 </t><t>[RFC6750] - The OAuth 2.0 Authorization Framework: Bearer Token Usage [RFC6750]: https://tools.ietf.org/html/rfc6750 </t><t>[RFC7636] - Proof Key for Code Exchange by OAuth Public Clients [RFC7636]: https://tools.ietf.org/html/rfc7636 </t><t>[RFC5246] - The Transport Layer Security (TLS) Protocol Version 1.2 [RFC5246]: https://tools.ietf.org/html/rfc5246 </t><t>[RFC6125] - Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS) [RFC6125]: https://tools.ietf.org/html/rfc6125 </t><t>[RFC6819] - OAuth 2.0 Threat Model and Security Considerations [RFC6819]: https://tools.ietf.org/html/rfc6819 </t><t>[RFC7519] - JSON Web Token (JWT) [RFC7519]:https://tools.ietf.org/html/rfc7519 </t><t>[BCP195] - Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) [BCP195]: https://tools.ietf.org/html/bcp195 </t><t>BCP NAPPS - <eref target="https://tools.ietf.org/html/draft-ietf-oauth-native-apps-03">OAuth 2.0 for Native Apps</eref> </t><t>[OIDC] - OpenID Connect Core 1.0 incorporating errata set 1 [OIDC]: http://openid.net/specs/openid-connect-core-1_0.html </t><t>[OIDD] - OpenID Connect Discovery 1.0 incorporating errata set 1 [OIDD]: http://openid.net/specs/openid-connect-discovery-1_0.html </t><t>[OIDM] - OAuth 2.0 Multiple Response Type Encoding Practices [OIDM]: http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html </t><t>[X.1254] - Entity authentication assurance framework [X.1254]: https://www.itu.int/rec/T-REC-X.1254 </t><t>[OAUTB] - OAuth 2.0 Token Binding [OAUTB]: https://tools.ietf.org/html/draft-ietf-oauth-token-binding-01 </t><t>[MTLS] - Mutual TLS Profiles for OAuth Clients [MTLS]: https://tools.ietf.org/html/draft-ietf-oauth-mtls-00 </t></section><section title="Terms and definitions" anchor="terms-and-definitions" toc="default"><t>For the purpose of this standard, the terms defined in [RFC6749], [RFC6750], [RFC7636], [OpenID Connect Core][OIDC] apply.  </t></section><section title="Symbols and Abbreviated terms" anchor="symbols-and-abbreviated-terms" toc="default"><t><spanx style="strong" xml:space="preserve">API</spanx> &#8211; Application Programming Interface </t><t><spanx style="strong" xml:space="preserve">CSRF</spanx> - Cross Site Request Forgery </t><t><spanx style="strong" xml:space="preserve">FAPI</spanx> - Financial API </t><t><spanx style="strong" xml:space="preserve">FI</spanx> &#8211; Financial Institution </t><t><spanx style="strong" xml:space="preserve">HTTP</spanx> &#8211; Hyper Text Transfer Protocol </t><t><spanx style="strong" xml:space="preserve">OIDF</spanx> - OpenID Foundation </t><t><spanx style="strong" xml:space="preserve">REST</spanx> &#8211; Representational State Transfer </t><t><spanx style="strong" xml:space="preserve">TLS</spanx> &#8211; Transport Layer Security </t></section><section title="Read and Write API Security Profile" anchor="read-and-write-api-security-profile" toc="default"><section title="Introduction" anchor="introduction" toc="default"><t>The OIDF Financial API (FAPI) is a REST API that provides JSON data representing accounts and transactional data. These APIs are protected by the OAuth 2.0 Authorization Framework that consists of [RFC6749], [RFC6750], [RFC7636], and other specifications.  </t><t>There are different levels of risks associated with access to these APIs. Read and write access has a higher financial risk than read-only access. As such, the security profiles of the authorization framework protecting these APIs are also different.  </t><t>This profile describes security provisions for the server and client that are appropriate for read and write access by defining the measures to mitigate the attacks that leverage on the weak binding of endpoints in [RFC6749] (e.g. Malicious Endpoints attacks, IdP Mix-up attacks) and attacks that involve modification of the authorization requests and responses that are not protected in [RFC6749] by leveraging on OpenID Connect's Hybrid Flow that returns an ID Token in the authorization response.  </t><t>While the name ID Token suggests that it is something that provides the identity of the resource owner (subject), it is not necessarily so. While it does identify the authorization server by including the issuer identifier, it is perfectly fine to have ephemeral subject identifier. In this case, the ID Token acts as a detached signature of the issuer to the authorization response and it was an explicit design decision of OpenID Connect Core to make the ID Token act as a detached signature.  </t><t>This document leverages on this fact and protects the authorization response by including the hash of all of the unprotected response parameters, i.e. <spanx style="verb" xml:space="preserve">code</spanx> and <spanx style="verb" xml:space="preserve">state</spanx>.  </t><t>While the hash of the <spanx style="verb" xml:space="preserve">code</spanx> is defined in [OIDC], the hash of the <spanx style="verb" xml:space="preserve">state</spanx> is not defined.  Thus this document defines it as follows.  </t><t>** s_hash ** </t><t>State hash value. Its value is the base64url encoding of the left-most half of the hash of the octets of the ASCII representation of the state value, where the hash algorithm used is the hash algorithm used in the <spanx style="verb" xml:space="preserve">alg</spanx> Header Parameter of the ID Token's JOSE Header. For instance, if the alg is HS512, hash the code value with SHA-512, then take the left-most 256 bits and base64url encode them. The <spanx style="verb" xml:space="preserve">s_hash</spanx> value is a case sensitive string.  </t></section><section title="Read and Write API Security Provisions" anchor="read-and-write-api-security-provisions" toc="default"><section title="Introduction" anchor="introduction-1" toc="default"><t>Read and Write Access carries high financial risk, so the protection level is higher than Read-Only Access.  </t><t>As a profile of The OAuth 2.0 Authorization Framework, this document mandates the following for the Read and Write API of the FAPI.  </t></section><section title="Authorization Server" anchor="authorization-server" toc="default"><t>The Authorization Server shall support the provisions specified in clause 5.2.2 of Financial API - Part 1: Read Only API Security Profile.  </t><t>In addition, the Authorization server, for the write operation, </t><t><list style="numbers"><t>shall require the <spanx style="verb" xml:space="preserve">request</spanx> or <spanx style="verb" xml:space="preserve">request_uri</spanx> parameter to be passed as a JWS signed JWT as in clause 6 of [OIDC]; </t><t>shall require the <spanx style="verb" xml:space="preserve">response_type</spanx> values <spanx style="verb" xml:space="preserve">code id_token</spanx> or <spanx style="verb" xml:space="preserve">code id_token token</spanx>; </t><t>shall return ID Token as a detached signature to the authorization response; </t><t>shall include state hash, <spanx style="verb" xml:space="preserve">s_hash</spanx>, in the ID Token to protect the <spanx style="verb" xml:space="preserve">state</spanx> value; </t><t>shall only issue holder of key authorization code, access token, and refresh token for write operations; </t><t>shall support [OAUTB] or [MTLS] as a holder of key mechanism; </t><t>shall support user authentication at LoA 3 or greater as defined in [X.1254]; </t><t>shall support signed ID Tokens; and </t><t>should support signed and encrypted ID Token.  </t></list></t></section><section title="Public Client" anchor="public-client" toc="default"><t>A Public Client shall support the provisions specified in clause 5.2.3 of Financial API - Part 1: Read Only API Security Profile.  </t><t>In addition, the Public Client </t><t><list style="numbers"><t>shall support [OAUTB] as a holder of key mechanism; </t><t>shall include the <spanx style="verb" xml:space="preserve">request</spanx> or <spanx style="verb" xml:space="preserve">request_uri</spanx> parameter as defined in Section 6 of [OIDC] in the authentication request; </t><t>shall request user authentication at LoA 3 or greater by requesting the <spanx style="verb" xml:space="preserve">acr</spanx> claim as an essential claim as defined in section 5.5.1.1 of [OIDC]; </t><t>shall require JWS signed ID Token be returned from endpoints; </t><t>shall verify that the <spanx style="verb" xml:space="preserve">acr</spanx> claim in an ID Token indicates that user authentication was performed at LoA3 or greater; </t><t>shall verify that the <spanx style="verb" xml:space="preserve">amr</spanx> claim in an ID Token contains values appropriate for the LoA indicated by the <spanx style="verb" xml:space="preserve">acr</spanx> claim; </t><t>shall verify that the authorization response was not tampered using ID Token as the detached signature </t></list></t><t>for write operations.  </t><t>To verify that the authorization response was not tampered using ID Token as the detached signature, the client shall verify that <spanx style="verb" xml:space="preserve">s_hash</spanx> value is equal to the value calculated from the <spanx style="verb" xml:space="preserve">state</spanx> value in the authorization response in addition to all the requirements in 3.3.2.12 of [OIDC].  </t></section><section title="Confidential Client" anchor="confidential-client" toc="default"><t>In addition to the provision to the Public Client and the provisions of clause 5.2.3, the Confidential Client </t><t><list style="numbers"><t>shall support [OAUTB] or [MTLS] as a holder of key mechanism; </t><t>shall require both JWS signed and JWE encrypted ID Tokens to be returned from endpoints </t></list></t><t>for write operations.  </t></section></section></section><section title="Accessing Protected Resources (Using tokens)" anchor="accessing-protected-resources-using-tokens" toc="default"><section title="Introduction" anchor="introduction-2" toc="default"><t>The FAPI endpoints are OAuth 2.0 protected resource endpoints that return various financial information for the resource owner associated with the submitted access token.  </t></section><section title="Read and write access provisions" anchor="read-and-write-access-provisions" toc="default"><section title="Protected resources provisions" anchor="protected-resources-provisions" toc="default"><t>The protected resources supporting this document </t><t><list style="numbers"><t>shall support the provisions specified in clause 6.2.1 Financial API - Part 1: Read Only API Security Profile; </t><t>shall adhere to the requirements in [MTLS].  </t></list></t></section><section title="Client provisions" anchor="client-provisions" toc="default"><t>The client supporting this document shall support the provisions specified in clause 6.2.2 of Financial API - Part 1: Read Only API Security Profile.  </t></section></section></section><section title="Request object endpoint" anchor="request-object-endpoint" toc="default"><section title="Introduction" anchor="introduction-3" toc="default"><t>The client may not want to send the request object by value, either because it is too large, or because it contains sensitive data and the client doesn't want to encrypt the request object. In such cases it is possible to send the request object by reference using a <spanx style="verb" xml:space="preserve">request_uri</spanx>.  </t><t>Note that <spanx style="verb" xml:space="preserve">request_uri</spanx> can be either URL or URN.  If it is a URL, it shall be based on a cryptographic random value so that it is difficult to predict for the attacker.  </t><t>The request URI can be hosted by the client or by the authorization server. The advantage of the authorization server hosting the request object is that it doesn't have to support outbound requests to a client specified request URI nor rely on the entropy of the URI for the confidentiality of the request object.  </t><t>When the request object is stored at the authorization server, the <spanx style="verb" xml:space="preserve">request_uri</spanx> value typically is a URN.  </t><t>This section defines the specification for the authorization server to provide an endpoint for a client to exchange a request object for a request URI.  </t></section><section title="Request" anchor="request" toc="default"><t>The request object endpoint is a RESTful API endpoint at the authorization server that accepts a signed request object as an HTTPS POST payload. The request object needs to be signed for the client authentication and as the evidence of the client submitting the request object, which sometimes is called 'non-repudiation'.  </t><t>The following is an example of such a request.  </t><figure title="" suppress-title="false" align="left" alt="" width="" height=""><artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
POST https://as.example.com/ros/ HTTP/1.1
Host: as.example.com
Content-Type: application/jws
Content-Length: 1288

eyJhbGciOiJSUzI1NiIsImtpZCI6ImsyYmRjIn0.ew0KICJpc3MiOiA
(... abbreviated for brevity ...)
zCYIb_NMXvtTIVc1jpspnTSD7xMbpL-2QgwUsAlMGzw
</artwork></figure></section><section title="Successful response" anchor="successful-response" toc="default"><t>The authorization server shall verify that the request object is valid, the signature algorithm is not <spanx style="verb" xml:space="preserve">none</spanx>, and the signature is correct as in clause 6.3 of [OIDC].  </t><t>If the verification is successful, the server shall generate a request URI and return a JSON payload that contains <spanx style="verb" xml:space="preserve">request_uri</spanx>, <spanx style="verb" xml:space="preserve">aud</spanx>, <spanx style="verb" xml:space="preserve">iss</spanx>, and <spanx style="verb" xml:space="preserve">exp</spanx> claims at the top level with <spanx style="verb" xml:space="preserve">201 Created</spanx> HTTP response code.  </t><t>The value of these claims in the JSON payload shall be as follows: </t><t><list style="symbols"><t><spanx style="verb" xml:space="preserve">request_uri</spanx> : The request URI corresponding to the request object posted.  </t><t><spanx style="verb" xml:space="preserve">aud</spanx> : A JSON string that represents the client identifier of the client that posted the request object.  </t><t><spanx style="verb" xml:space="preserve">iss</spanx> : A JSON string that represents the issuer identifier of the authorization server as defined in [RFC7519]. When a pure OAuth 2.0 is used, the value is the redirection URI. When OpenID Connect is used, the value is the issuer value of the authorization server.  </t><t><spanx style="verb" xml:space="preserve">exp</spanx> : A JSON number that represents the expiry time of the request URI as defined in [RFC7519].  </t></list></t><t>The following is an example of such a response.  </t><figure title="" suppress-title="false" align="left" alt="" width="" height=""><artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
HTTP/1.1 201 Created
Date: Tue, 2 May 2017 15:22:31 GMT
Content-Type: application/json

{
    'iss':'https://as.example.com/',
    'aud':'s6BhdRkqt3',
    'request_uri':'urn:example:MTAyODAK',
    'exp':1493738581
}
</artwork></figure><t>The request URI shall be bound to the client identifier of the client that posted the request object. Since the request URI can be replayed, its lifetime should be short and preferably one-time use.  </t></section><section title="Error responses" anchor="error-responses" toc="default"><section title="Authorization required" anchor="authorization-required" toc="default"><t>If the signature validation fails, the authorization server shall return <spanx style="verb" xml:space="preserve">401 Unauthorized</spanx> HTTP error response.  </t></section><section title="Invalid request" anchor="invalid-request" toc="default"><t>If the request object received is invalid, the authorization server shall return <spanx style="verb" xml:space="preserve">400 Bad Request</spanx> HTTP error response.  </t></section><section title="Method Not Allowed" anchor="method-not-allowed" toc="default"><t>If the request did not use POST, the authorization server shall return <spanx style="verb" xml:space="preserve">405 Method Not Allowed</spanx> HTTP error response.  </t></section><section title="Request entity too large" anchor="request-entity-too-large" toc="default"><t>If the request size was beyond the upper bound that the authorization server allows, the authorization server shall return a <spanx style="verb" xml:space="preserve">413 Request Entity Too Large</spanx> HTTP error response.  </t></section><section title="Too many requests" anchor="too-many-requests" toc="default"><t>If the request from the client per a time period goes beyond the number the authorization server allows, the authorization server shall return a <spanx style="verb" xml:space="preserve">429 Too Many Requests</spanx> HTTP error response.  </t></section></section></section><section title="Security Considerations" anchor="security-considerations" toc="default"><section title="Introduction" anchor="introduction-4" toc="default"><t>As a profile of The OAuth 2.0 Authorization Framework, this specification references the security considerations defined in section 10 of [RFC6749], as well as [RFC6819] - OAuth 2.0 Threat Model and Security Considerations, which details various threats and mitigations.  </t></section><section title="Uncertainty around the resource server's handling of the access token" anchor="uncertainty-around-the-resource-servers-handling-of-the-access-token" toc="default"><t>There is no way that the client can find out whether the resource access was granted for the Bearer token or holder of key token.  The two differ in the risk profile and the client may want to differentiate them. The protected resources that conforms to this document shall not accept a plain Bearer token. They shall only support token bound access tokens via [MTLS] or [OAUTB].  </t></section><section title="Attacks that involves the weak binding of authorization server endpoints" anchor="attacks-that-involves-the-weak-binding-of-authorization-server-endpoints" toc="default"><section title="Introduction" anchor="introduction-5" toc="default"><t>In [RFC6749] and [RFC6750], the endpoints that the authorization server offers are not tightly bound together. There is no notion of authorization server identifier (issuer identifier) and it is not indicated in the authorization response unless the client uses different redirection URI per authorization server. While it is assumed in the OAuth model, it is not explicitly spelled out and thus many clients use the same redirection URI for different authorization servers exposing attack surface. Several attacks are identified by now and many of them are explained in more details in [RFC6819] in more detail.  </t></section><section title="Client credential and authorization code phishing at token endpoint" anchor="client-credential-and-authorization-code-phishing-at-token-endpoint" toc="default"><t>In this attack, the client developer is social engineered into believing that the token endpoint has changed to the URL that is controlled by the attacker. As the result, the client sends the <spanx style="verb" xml:space="preserve">code</spanx> and the client secret to the attacker, which will be replayed subsequently.  </t><t>When the FAPI client uses [MTLS] or [OAUTB], the authorization code is bound to the TLS channel, any phished client credentials and authorization codes submitted to the token endpoint cannot be used since the authorization code is bound to a particular TLS channel.  </t></section><section title="IdP Mix-up attack" anchor="idp-mix-up-attack" toc="default"><t>In this attack, the client has registered multiple IdPs and one of them is a rogue IdP that returns the same <spanx style="verb" xml:space="preserve">client_id</spanx> that belongs to one of the honest IdPs. When a user clicks on a malicious link or visits a compromised site, an authorization request is sent to the rogue Idp. The rogue Idp then redirects the client to the honest IdP that has the same <spanx style="verb" xml:space="preserve">client_id</spanx>. If the user is already logged on at the honest IdP, then the authentication may be skipped and a code is generated and returned to the client.  Since the client was interacting with the rogue IdP, the code is sent to the rogue IdP's token endpoint. At the point, the attacker has a valid code that can be exchanged for an Access Token at the honest IdP.  </t><t>This is mitigated by the use of Hybrid flow in which the Honest IdP's issuer identifier is included as the value of <spanx style="verb" xml:space="preserve">iss</spanx>. The client then sends the <spanx style="verb" xml:space="preserve">code</spanx> to the token endpoint that is associated with the issuer identifier thus it will not get to the attacker.  </t></section><section title="Request object endpoint phishing resistance" anchor="request-object-endpoint-phishing-resistance" toc="default"><t>An attacker can use social engineering to have the administrator of the client set the request object endpoint to a URL under the attacker's control. In this case, sensitive information included in the request object will be revealed to the attacker. To prevent this, the authorization server should communicate to the client developer the proper change process repeatedly to help client developers to be less susceptible to such social engineering.  </t></section><section title="Access token phishing" anchor="access-token-phishing" toc="default"><t>When the FAPI client uses [MTLS] or [OAUTB], the access token is bound to the TLS channel, it is access token phishing resistant as the phished access tokens cannot be used.  </t></section></section><section title="Attacks that involves the modification of authorization requests and responses" anchor="attacks-that-involves-the-modification-of-authorization-requests-and-responses" toc="default"><section title="Introduction" anchor="introduction-6" toc="default"><t>In [RFC6749] the authorization request and responses are not integrity protected. Thus, an attacker can modify them.  </t></section><section title="Authorization Request parameter injection attack" anchor="authorization-request-parameter-injection-attack" toc="default"><t>In [RFC6749], the authorization request is sent as query parameter. Although [RFC6749] mandates the user of TLS, the TLS is terminated in the browser and thus not protected within the browser. Leveraging on it, an attacker can tamper the authorization request and insert his own parameter values.  </t><t>Attacks like Malicious Endpoint Attack requires this property to succeed.  </t><t>The use of a <spanx style="verb" xml:space="preserve">request</spanx> object or <spanx style="verb" xml:space="preserve">request_uri</spanx> in the authorization request will prevent tampering with the request parameters.  </t><t>IdP confusion attack reported in <eref target="https://www.nds.rub.de/media/ei/veroeffentlichungen/2017/01/30/oidc-security.pdf">SoK: Single Sign-On Security &#8211; An Evaluation of OpenID Connect</eref> is this kind of attack.  </t></section><section title="Authorization Response parameter injection attack" anchor="authorization-response-parameter-injection-attack" toc="default"><t>This attack occurs when the victim and attacker use the same relying party client. The attacker is somehow able to capture the authorization code and state from the victim's authorization response and uses them in his own authorization response.  </t><t>This can be mitigated by using hybrid flow where the <spanx style="verb" xml:space="preserve">c_hash</spanx>, <spanx style="verb" xml:space="preserve">at_hash</spanx>, and <spanx style="verb" xml:space="preserve">s_hash</spanx> can be used to verify the validity of the authorization code, access token, and state parameters. The server can verify that the state is the same as what was stored in the browser session at the time of the authorization request.  </t></section></section><section title="TLS considerations" anchor="tls-considerations" toc="default"><t>As confidential information is being exchanged, all interactions shall be encrypted with TLS (HTTPS).  </t><t>The recommendations for Secure Use of Transport Layer Security in BCP195 shall be followed, with the following additional requirements: </t><t><list style="numbers"><t>Only the following 4 cipher suites shall be permitted: <list style="symbols"><t><spanx style="verb" xml:space="preserve">TLS_DHE_RSA_WITH_AES_128_GCM_SHA256</spanx> </t><t><spanx style="verb" xml:space="preserve">TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256</spanx> </t><t><spanx style="verb" xml:space="preserve">TLS_DHE_RSA_WITH_AES_256_GCM_SHA384</spanx> </t><t><spanx style="verb" xml:space="preserve">TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384</spanx> </t></list> </t><t>TLS version 1.2 or later shall be used for all communications.  </t><t>A TLS server certificate check shall be performed, as per [RFC6125].  </t></list></t></section><section title="JWS algorithm considerations" anchor="jws-algorithm-considerations" toc="default"><t>JWS signatures shall use the <spanx style="verb" xml:space="preserve">PS256</spanx> or <spanx style="verb" xml:space="preserve">ES256</spanx> algorithms for signing.  </t></section></section><section title="Privacy Considerations" anchor="privacy-considerations" toc="default"><t><list style="symbols"><t>If the client is to be used by a single user, the client certificate will provide the means for the websites that belong to different administrative domains to collude and correlate the user's access. For this reason, public clients that reside on a user's terminal should avoid [MTLS] and use [OAUTB] instead.  </t><t>When claims related to the subject are returned in the ID Token in the front channel, implementations should consider encrypting the ID Token to lower the risk of personal information disclosure.  </t></list></t></section><section title="Acknowledgement" anchor="acknowledgement" toc="default"><t>Following people contributed heavily towards this document.  </t><t><list style="symbols"><t>Nat Sakimura (Nomura Research Institute) -- Chair, Editor </t><t>Anoop Saxana (Intuit) -- Co-chair, FS-ISAC Liaison </t><t>Anthony Nadalin (Microsoft) -- Co-chair, SC 27 Liaison </t><t>Edmund Jay (Illumila) -- Co-editor </t><t>Dave Tonge (Momentum Financial Technology) -- UK Implementation Entity Liaison </t><t>Paul A. Grassi (NIST) -- X9 Liaison </t><t>Joseph Heenan (Authlete) </t><t>Sascha H. Preibisch (CA) </t><t>John Bradley (Ping Identity) </t><t>Henrik Bearing (Peercraft) </t><t>Tom Jones (Independent) </t><t>Axel Nenker (deutsche telekom) </t><t>Torsten Lodderstedt (YES) </t><t>Ralph Bragg (Raidiam) </t></list></t></section><section title="Bibliography" anchor="bibliography" toc="default"><t><list style="symbols"><t>[OFX2.2] Open Financial Exchange 2.2 </t><t>[HTML4.01] &#8220;HTML 4.01 Specification,&#8221; World Wide Web Consortium Recommendation REC-html401-19991224, December 1999 </t><t>[RFC7662] OAuth 2.0 Token Introspection </t><t>[DDA] Durable Data API, (2015), FS-ISAC </t><t>[SoK] Mainka, C., Mladenov, V., Schwenk, J., and T. Wich: SoK: Single Sign-On Security &#8211; An Evaluation of OpenID Connect </t></list></t></section> </middle>
  <back/>
</rfc>
