openid / sharedsignals

OpenID Shared Signals Working Group Repository
45 stars 11 forks source link

Attacker Stream Subject Insertion #160

Closed PedramHD closed 3 weeks ago

PedramHD commented 1 month ago

Under certain conditions, an attacker might receive SETs for subjects without being authorized to access information on these subjects. We give the details in the following.

Please note that this issue is part of the ongoing formal security analysis of the SSF specification. We already created a formal model of the specification, identified and formalized security properties, and described the assumptions (as also agreed upon with the Working Group) upon which the analysis is based here: https://github.com/openid/sharedsignals/files/15014966/2024-04-09_WP4.1a-Report.pdf

Setting

We start with a brief summary of the relevant assumptions from our report.

  1. There is no Receiver authentication, as the SSF specification has no requirements on authentication of the Receiver at the Transmitter.
  2. Transmitters identify Receivers by dynamically created nonces which the Transmitter issues during configuration discovery. More precisely, we assume that the Transmitter provides different endpoints for each configuration discovery request, with the URLs containing a unique part u, which is also used as the audience value for this Receiver. However, this issue also applies more generally to cases in which the identifier is chosen by the Transmitter for the Receiver out-of-band and transmitted from the Receiver to the Transmitter in a way that the parties agreed upon.
  3. Subjects are added to a stream based on authorization tokens contained in the request to the add subject endpoint. We assume that these tokens are pre-shared and that receivers select the appropriate token to include in a request based on the service, i.e., the endpoint to which the request is sent.

Detailed Description

The attacker receives a SET with information on a subject that the attacker is not authorized to receive (i.e., breaking the authorization property described in Section 4.4 of our report). This happens by a mix-up in which the attacker acts as a Receiver towards an honest Transmitter t and as a Transmitter towards an honest Receiver r. At first glance, it might seem unreasonable to expect security guarantees if a Receiver is interacting with a malicious Transmitter. However, even in this case, the malicious Transmitter should not be able to compromise the security guarantees between the Receiver and any other Transmitter that the Receiver is using. Let iss_t be an issuer identifier of the Transmitter t and iss_att an issuer identifier of the attacker. Furthermore, let at_subID be an access token that the Receiver r shares with the Transmitter t, and which authorizes access to the subject subID, i.e., upon receiving this access token at the add subject endpoint, the Transmitter would add subID to the corresponding stream. Furthermore, we assume that only r is authorized to access information about subID. In a nutshell, the attacker tricks the honest Receiver r to add the subject subID to a stream of the attacker at the honest Transmitter t. This is shown in the following diagram (with a detailed description following the diagram):

att-stream-subject-insertion

Possible Fixes

One possible fix is to ensure that the create stream and the add subject requests come from the same party, e.g., via proof-of-possession of some key pair or via a suitable authentication mechanism (i.e., the Receiver would need to authenticate both at the configuration endpoint for stream creation and at the add subject endpoint). Another potential fix is to require that Receivers choose subjects (for the add subject request) based on the issuer identifier.