<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="none" docName="fapi-2_0-attacker-model-01" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" consensus="true">

<front>
<title abbrev="fapi-2_0-attacker-model">FAPI 2.0 Attacker Model</title><seriesInfo value="fapi-2_0-attacker-model-01" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="D." surname="Fett" fullname="Daniel Fett"><organization>yes.com</organization><address><postal><street></street>
</postal><email>mail@danielfett.de</email>
</address></author>
<date/>
<area>Internet</area>
<workgroup>connect</workgroup>
<keyword>security</keyword>
<keyword>openid</keyword>

<abstract>
<t>OIDF FAPI 2.0 is an API security profile suitable for high-security
applications based on the OAuth 2.0 Authorization Framework
<xref target="RFC6749"></xref>. This document describes that attacker model that informs
the decisions on security mechanisms employed by the FAPI security
profiles.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Since OIDF FAPI aims at providing an API protection profile for high-risk
scenarios, clearly defined security requirements are indispensable. In this
document, the security requirements are expressed through attacker models,
security goals, and non-repudiation requirements. From these requirements, the
utilized security mechanisms are derived in the Baseline and Advanced profiles.</t>
<t>The ultimate aim is to provide systematic proofs of the security of the FAPI
profiles similar to those in <xref target="arXiv.1901.11520"></xref>. Formal proofs can rule out
large classes of attacks rooted in the logic of security protocols. Until such
proofs are provided for FAPI, the attacker model laid out herein informs the
design decisions for FAPI, but, as with most security protocols, there is no
guarantee that all attacks for all types of attackers are excluded.</t>
<t>The security requirements in this document are expressed in a form that lends
itself well to a transfer into a formal representation required for an automated
or manual analysis of the security of FAPI. This work draws from the attacker
model and security goals formulated in <xref target="arXiv.1901.11520"></xref>.</t>

<section anchor="warning"><name>Warning</name>
<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>
</section>

<section anchor="copyright-notice-license"><name>Copyright notice &amp; license</name>
<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>
</section>

<section anchor="notational-conventions"><name>Notational Conventions</name>
<t>The keywords &quot;shall&quot;, &quot;shall not&quot;, &quot;should&quot;, &quot;should not&quot;, &quot;may&quot;, and &quot;can&quot; in
this document are to be interpreted as described in ISO Directive Part 2
<xref target="ISODIR2"></xref>. 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>
</section>
</section>

<section anchor="security-goals"><name>Security Goals</name>
<t>FAPI 2.0 profiles aim to achieve at least the following security goals
(with respect to the attacker models defined below):</t>

<section anchor="authorization"><name>Authorization</name>
<t>FAPI 2.0 profiles shall ensure that <strong>no attacker can access resources
belonging to a user.</strong></t>
<t>The access token is the ultimate credential for access to resources in
OAuth. Therefore, this security goal is fulfilled if no attacker can
successfully obtain and use an access token belonging to a user.</t>
</section>

<section anchor="authentication"><name>Authentication</name>
<t>FAPI 2.0 profiles shall ensure that <strong>no attacker is able to log in at
a client under the identity of a user.</strong></t>
<t>The ID token is the credential for authentication in OpenID Connect.
This security goal therefore is fulfilled if no attacker can obtain
and use an ID token carrying the identity of a user for login.</t>
</section>

<section anchor="session-integrity"><name>Session Integrity</name>
<t>Session Integrity is concerned with attacks where a user is tricked
into logging in under the attacker’s identity or inadvertently using
the resources of the attacker instead of the user’s own resources.
Attacks in this field include CSRF attacks (traditionally defended
against by using “state” in OAuth) and session swapping attacks.</t>
<t>In detail:</t>

<ul>
<li><t>For authentication: FAPI 2.0 profiles shall ensure that <strong>no
attacker is able to force a user to be logged in under the
identity of the attacker.</strong></t>
</li>
<li><t>For authorization: FAPI 2.0 profiles shall ensure that <strong>no
attacker is able to force a user to use resources of the
attacker.</strong></t>
</li>
</ul>
</section>
</section>

<section anchor="attacker-model"><name>Attacker Model</name>

<section anchor="assumptions"><name>Assumptions</name>
<t>This attacker model assumes that certain parts of the infrastructure
are working correctly. Failures in these parts likely lead to attacks
that are out of the scope of this attacker model and shall be
considered and analyzed separately.</t>
<t>For example, if a major flaw in TLS was found that undermines data integrity in
TLS connections, a network attacker (A2, below) would be able to compromise
practically all OAuth and OpenID Connect sessions in various ways. This would be
fatal, as even application-level signing and encryption is based on key
distribution via TLS connections. As another example, if a human error leads to
the disclosure of secret keys for authentication and an attacker would be able
to misuse these credentials, this attack would not be covered by this attacker
model.</t>
<t>The following parts of the infrastructure are out of the scope of this
attacker model:</t>

<ul>
<li><t><strong>TLS:</strong> It is assumed that TLS connections are not broken, i.e.,
data integrity and confidentiality are ensured. The correct public
keys are used to establish connections and private keys are not
known to attackers (except for explicitly compromised parties).</t>
</li>
<li><t><strong>JWKS:</strong> Where applicable, key distribution mechanisms work as
intended, i.e., encryption and signature verification keys of
uncompromised parties are retrieved from the correct endpoints.</t>
</li>
<li><t><strong>Browsers and Endpoints:</strong> Devices and
browsers used by resource owners are considered not compromised. Other
endpoints not controlled by an attacker behave according to the
protocol.</t>
</li>
</ul>
</section>

<section anchor="attackers"><name>Attackers</name>
<t>FAPI 2.0 profiles aim to ensure the security goals listed above for arbitrary
combinations of the following attackers, potentially collaborating to reach a
common goal:</t>

<section anchor="a1-web-attacker"><name>A1 - Web Attacker</name>
<t>Standard web attacker model. Can send and receive messages just like any other
party controlling one or more endpoints on the internet. Can participate in
protocols flows as a normal user. Can use arbitrary tools (e.g., browser
developer tools, custom software, local interception proxies) on their own
endpoints to tamper with messages and assemble new messages. Can send links to
honest users that are then visited by these users. This means that the web
attacker has the ability to cause, arbitrary requests from users' browsers, as
long as the contents are known to the attacker.</t>
<t>Cannot intercept or block messages sent between other parties, and cannot break
cryptography unless the attacker has learned the respective decryption keys.
Deviating from the common web attacker model, A1 cannot play the role of a
legitimate AS in the ecosystem (see A1a).</t>
</section>

<section anchor="a1a-web-attacker-participating-as-as"><name>A1a - Web Attacker (participating as AS)</name>
<t>Like the web attacker A1, but can also participate as an AS in the ecosystem.
Note that this AS can reuse/replay messages it has received from honest ASs and
can send users to endpoints of honest ASs.</t>
</section>

<section anchor="a2-network-attacker"><name>A2 - Network attacker</name>
<t>Controls the whole network (like a rogue WiFi access point or any other
compromised network node). Can intercept, block, and tamper with messages
intended for other people, but cannot break cryptography unless the attacker has
learned the respective decryption keys.</t>
<t>Note: Most attacks that are exclusive to this kind of attacker can be defended
against by using transport layer protection like TLS.</t>
</section>

<section anchor="attackers-at-the-authorization-endpoint"><name>Attackers at the Authorization Endpoint</name>
<t><strong>Note:</strong> The attackers for the authorization request are more
fine-grained than those for the token endpoint and resource endpoint,
since these messages pass through the complex environment of the
user's browser/app/OS with a larger attack surface. This demands for a
more fine-grained analysis.</t>

<section anchor="a3a-read-authorization-request"><name>A3a - Read Authorization Request</name>
<t>The capabilities of the web attacker, but can also read the authorization
request sent in the front channel from a user's browser to the authorization
server. This might happen on mobile operating systems (where apps can register
for URLs), on all operating systems through the browser history, or due to
Cross-Site Scripting on the AS. There have been cases where anti-virus software
intercepts TLS connections and stores/analyzes URLs.</t>
</section>

<section anchor="a3b-read-authorization-response"><name>A3b - Read Authorization Response</name>
<t>The capabilities of the web attacker, but can also read the authorization
response. This can happen e.g., due to the URL leaking in proxy logs, web
browser logs, web browser history, or on mobile operating systems.</t>
</section>
</section>

<section anchor="attackers-at-the-token-endpoint"><name>Attackers at the Token Endpoint</name>

<section anchor="a5-read-and-tamper-with-token-requests-and-responses"><name>A5 - Read and Tamper with Token Requests and Responses</name>
<t>This attacker makes the client use a token endpoint that is not the one of the
honest AS. This attacker can read and tamper with messages sent to and from this
token endpoint that the client thinks as of an honest AS.</t>
<t>Note: When the token endpoint address is obtained from an authoritative source and via a protected channel, e.g., through OAuth Metadata obtained from the honest AS, this attacker is not relevant.</t>
</section>
</section>

<section anchor="attackers-at-the-resource-server"><name>Attackers at the Resource Server</name>

<section anchor="a7-read-resource-requests-and-responses"><name>A7 - Read Resource Requests and Responses</name>
<t>The capabilities of the web attacker, but this attacker can also read requests
sent to and from the resource server, for example because the attacker can read
TLS intercepting proxy logs on the RS's side.</t>
</section>

<section anchor="a8-tamper-with-resource-responses"><name>A8 - Tamper with Resource Responses</name>
<t>The capabilities of A7, but this attacker can also tamper with responses from
the resource servers (e.g., a compromised reverse proxy in front of the resource
server).</t>
</section>
</section>
</section>
</section>

<section anchor="non-repudiation-requirements"><name>Non-Repudiation Requirements</name>
<t>Beyond what is captured by the security goals and the attacker model, parties
could try to deny having sent a particular message, for example, a payment
request. For this purpose, non-repudiation is needed. This is usually achieved
by providing application-level signatures that can be stored together with the
payload and meaningful metadata of a request or response.</t>

<section anchor="affected-messages"><name>Affected messages</name>

<ul>
<li><t>NR1: Pushed Authorization Requests</t>
</li>
<li><t>NR2: Responses to Pushed Authorization Requests</t>
</li>
<li><t>NR3: Authorization Requests (Front-Channel)</t>
</li>
<li><t>NR4: Authorization Responses (Front-Channel)</t>
</li>
<li><t>NR5: ID Token Contents</t>
</li>
<li><t>NR6: Introspection Responses</t>
</li>
<li><t>NR7: Userinfo Responses</t>
</li>
<li><t>NR8: Resource Requests</t>
</li>
<li><t>NR9: Resource Responses</t>
</li>
</ul>
</section>
</section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>We would like to thank Dave Tonge, Nat Sakimura, Brian Campbell and Torsten Lodderstedt for their valuable feedback and contributions that helped to evolve this document.</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6749.xml"/>
<reference anchor="ISODIR2" target="https://www.iso.org/sites/directives/current/part2/index.xhtml">
  <front>
    <title>ISO/IEC Directives Part 2 - </title>
    <author fullname="International Organization for Standardization">
      <organization></organization>
    </author>
    <date></date>
  </front>
</reference>
</references>
<references><name>Informative References</name>
<reference anchor="arXiv.1901.11520" target="http://arxiv.org/abs/1901.11520/">
  <front>
    <title>An Extensive Formal Security Analysis of the OpenID Financial-grade API</title>
    <author fullname="Daniel Fett" initials="D." surname="Fett">
      <organization></organization>
    </author>
    <author fullname="Pedram Hosseyni" initials="P." surname="Hosseyni">
      <organization></organization>
    </author>
    <author fullname="Ralf Küsters" initials="R." surname="Küsters">
      <organization></organization>
    </author>
    <date year="2019" month="January" day="31"></date>
  </front>
</reference>
</references>

<section anchor="notices"><name>Notices</name>
<t>Copyright (c) 2021 The OpenID Foundation.</t>
<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>
</section>

</back>

</rfc>
