superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.61k stars 303 forks source link

[feature] Use the `sub` claim for OIDC Accounts #917

Closed theSuess closed 1 year ago

theSuess commented 1 year ago

Is your feature request related to a problem ?

As currently OIDC accounts are tied to email address, this can lead to issues when changing the email of a user. Per the OIDC spec, the email claim is neither guaranteed to be stable or unique. The only reliable identifier is the sub claim.

Describe the solution you'd like.

For externally authenticated user, store an additional field to have a stable reference to the correct user. This prevents account takeovers (accidental or with malicious intent)

Describe alternatives you've considered.

There really is no other stable way to prevent hostile account takeovers in a self-service OIDC environment

Additional context.

Relevant OIDC spec for reference: https://openid.net/specs/openid-connect-core-1_0.html#ClaimStability

tsmethurst commented 1 year ago

closed by https://github.com/superseriousbusiness/gotosocial/pull/961