Skip to content

Insecure OpenID Connect Authentication Flow

Moderate
hf published GHSA-9wqv-qhrh-87f4 Feb 13, 2023

Package

gomod github.com/supabase/gotrue (Go)

Affected versions

<2.47.0

Patched versions

2.47.0

Description

Impact

Under a very specific set of circumstances an attacker could use an OpenID Connect compliant ID token issuer in their control to authenticate as a legitimate user.

This would only be possible if the attacker used the POST /token?grant_type=id_token endpoint with a JSON body that:

  • Has an unspecified or empty string provider
  • A valid OIDC ID token issuer URL in issuer
  • A valid client_id property for the issuer

Furthermore, the attacker would have to use this endpoint prior to a non-OIDC sign-up of the legitimate user being targeted.

Patches

The problem is patched since version 2.47.0. All OIDC issuers you trust must now be specified in the GOTRUE_EXTERNAL_ALLOWED_ID_TOKEN_ISSUERS environment variable.

For example, to use Firebase ID tokens you should use:

GOTRUE_EXTERNAL_ALLOWED_ID_TOKEN_ISSUERS=https://securetoken.google.com/<firebase-project-id>

You can specify multiple issuers with commas.

Projects using Supabase Auth will progressively receive this patch. Until then the vulnerable endpoint has been scoped down to allow three issuer groups:

Please open a new support ticket if your project relies on another issuer.

Projects will be automatically configured with the GOTRUE_EXTERNAL_ALLOWED_ID_TOKEN_ISSUERS config value once the patched version is made available on all projects.

Workarounds

There are no workarounds to mitigate the issue. If you do not use OIDC ID tokens for sign-in in your self-hosted instance of GoTrue, you can block any requests to the POST /token endpoint only when grant_type is id_token in the query parameters.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

CVE ID

No known CVE

Weaknesses

No CWEs