Am I affected?

type your ash_authentication version to check

Description

Authentication Bypass by Spoofing vulnerability in team-alembic AshAuthentication allows account takeover of local users via OAuth2/OIDC sign-in.

AshAuthentication's OAuth2 and OIDC family strategies matched the local user by email address (an upsert on the email field, or a user-defined sign-in filter) rather than by the OpenID Connect iss/sub claim combination. Per OpenID Connect Core §5.7, only iss/sub uniquely and stably identifies an end-user; other claims, including email, MUST NOT be used as unique identifiers.

A provider login presenting a victim's email, including an unverified email, a reused email, or an account with email_verified: false, resolved to and signed in as the victim's existing local account. An unauthenticated attacker who can register an account on any accepted OAuth provider with the victim's email (or who benefits from provider-side email reuse or reclamation) obtains the victim's full local privileges.

The fix resolves users by the (strategy, sub) identity stored in a user identity resource, and only links a new sub to an existing local account by email when the provider's email_verified claim is trusted (trust_email_verified?).

This issue affects ash_authentication from 0.1.0 before 4.14.0 and from 5.0.0-rc.0 before 5.0.0-rc.10.

Weaknesses & attack patterns

Weakness

CWE-290 · Authentication Bypass by Spoofing in catalog → MITRE ↗

Attack patterns

CAPEC-21 · Exploitation of Trusted Identifiers MITRE ↗

Affected — Hex / ash_authentication Hex.pm ↗ Repository ↗

0.1.0 < 4.14.0 affected
5.0 series 5.0.0-rc.0 < 5.0.0-rc.10 affected
every other version: unaffected
default status unaffected
cpe cpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshAuthentication.Strategy.OAuth2.IdentityChange' · 'Elixir.AshAuthentication.Strategy.OAuth2.SignInPreparation'
source files lib/ash_authentication/strategies/oauth2/identity_change.ex · lib/ash_authentication/strategies/oauth2/sign_in_preparation.ex
routines 'Elixir.AshAuthentication.Strategy.OAuth2.IdentityChange':change/3 · 'Elixir.AshAuthentication.Strategy.OAuth2.SignInPreparation':prepare/3

Affected — GitHub / team-alembic/ash_authentication Repository ↗

c5f5890 and up affected
728b8d2 not affected
6453064 not affected
every other version: unaffected
default status unaffected
cpe cpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshAuthentication.Strategy.OAuth2.IdentityChange' · 'Elixir.AshAuthentication.Strategy.OAuth2.SignInPreparation'
source files lib/ash_authentication/strategies/oauth2/identity_change.ex · lib/ash_authentication/strategies/oauth2/sign_in_preparation.ex
routines 'Elixir.AshAuthentication.Strategy.OAuth2.IdentityChange':change/3 · 'Elixir.AshAuthentication.Strategy.OAuth2.SignInPreparation':prepare/3

References

Credits

Jarl André Hübenthal Finder
James Harton Remediation developer
Jonatan Männchen / EEF Analyst

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
« All CVEs