Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issuer Mix-Up #162

Closed
PedramHD opened this issue May 7, 2024 · 0 comments · Fixed by #172
Closed

Issuer Mix-Up #162

PedramHD opened this issue May 7, 2024 · 0 comments · Fixed by #172
Labels
sec-analysis spec:SSF v3 Address this issue before the v3 cutoff (June 15, 2024)

Comments

@PedramHD
Copy link

PedramHD commented May 7, 2024

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

As detailed in our report, we assume that Transmitters identify Receivers by dynamically created nonces which the Transmitter issues when responding to a configuration discovery request. More precisely, we assume that the Transmitters provide 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 both parties agreed upon.

Overview

Let t be an honest Transmitter and r an honest Receiver, with u_r being the audience value assigned from t to r. Furthermore, let att be the attacker, and let u_att be the audience value that t assigned to att.
Intuitively, r should not accept a SET created by t with the audience value of the attacker. As shown in the following, this might happen under the setting described above, breaking the Session Integrity property from our report (see Section 4.2).

Detailed Description

We now give more details, based on the following diagram:

issuer-mix-up

  • Configuration Discovery
    • Both the honest Receiver r and the attacker att get the configuration discovery metadata of t (Steps 1 - 4 of the diagram). As noted previously, we assume that the Transmitter assigns the audience values u_r and u_att.
    • The Receiver r obtains the configuration from att in Steps 5-6. Here, the attacker re-uses the audience value that it obtained from t, i.e., u_att.
    • The Receivers obtain the JWKS from the corresponding endpoints (not shown in the diagram).
  • Stream Creation using Poll Delivery
    • The Receiver r sends a request to att to create a new stream (see Step 7)
    • The attacker creates a stream at t and receives the polling endpoint pollEP_t and the stream identifier s_att (see Steps 8 - 9).
    • The attacker responds to the stream creation request with the same stream configuration that it obtained from t in Step 10.
  • Adding Subjects to Stream (Steps 11 - 13): This is only necessary if streams at t do not contain subjects for the corresponding audiences upon creation. In this case, the attacker sends an add subject request to t for a subject that the attacker is authorized to add to streams. The details of this step are not relevant to this issue.
  • Polling
    • The receiver selects a stream configuration (in this case, the configuration that it obtained in Step 10) and sends a poll request to the endpoint_url, i.e., to the polling endpoint of t (Step 14).
    • The Transmitter responds with a SET in Step 15. As per Section 4.1.3 of RFC 7519 (JSON Web Token), the Receiver must check the audience value of the SET: “Each principal intended to process the JWT MUST identify itself with a value in the audience claim.” In this case, the check of the audience value is successful if the Receiver (1) checks the audience value against a list of all audience values of the Receiver, or (2) checks the audience value against the value in the stream configuration. Furthermore, the issuer value of the SET is the same value as in the stream configuration.

We note that in our report (as described in Section 2.4.1), we assumed that the polling endpoint is protected by a bearer token that the receiver chooses when creating the stream. This is omitted from the diagram and would not mitigate this issue, as the attacker could re-use the token that it receives in Step 7 for the request in Step 8. The Receiver r would choose this token when sending the poll request in Step 14 (as the Receiver associated this token with the stream).

Possible Fix

Upon receiving the stream configuration (Step 10), the Receiver should check whether the stream configuration has the expected issuer value, i.e., the issuer value of the configuration from which the Receiver selected the stream configuration endpoint (in Step 7). (This check should also be done when reading, updating, and replacing stream configurations).

@timcappalli timcappalli added sec-analysis spec:SSF spec:Interop Issues with the interop spec. and removed spec:Interop Issues with the interop spec. labels May 8, 2024
@FragLegs FragLegs added the v3 Address this issue before the v3 cutoff (June 15, 2024) label May 9, 2024
@FragLegs FragLegs linked a pull request May 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sec-analysis spec:SSF v3 Address this issue before the v3 cutoff (June 15, 2024)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants