Am I affected?

type your ash_authentication version to check

Description

Improper Session Invalidation after Authentication Credential Change vulnerability in team-alembic ash_authentication allows an attacker holding a victim's session token to stay signed in after the victim resets or changes their password.

With apply_on_password_change? true, AshAuthentication.AddOn.LogOutEverywhere.Transformer adds OnPasswordChange to update actions as a global change guarded by where: changing(hashed_password). That condition is evaluated before the action's before_action hooks run, but AshAuthentication.Strategy.Password.HashPasswordChange sets the new hash in a before_action hook, so for every non-atomic password change the condition is false and the user's stored tokens are not revoked. The generated password reset action and the installer's change_password action are both non-atomic.

This issue affects ash_authentication: from 4.5.0 before 4.15.1 and from 5.0.0-rc.0 before 5.0.0-rc.16.

Weaknesses & attack patterns

Weakness

CWE-1466 · Improper Session Invalidation after Authentication Credential Change in catalog → MITRE ↗

Attack patterns

CAPEC-60 · Reusing Session IDs (aka Session Replay) MITRE ↗

Affected — Hex / ash_authentication Hex.pm ↗ Repository ↗

≥ 4.5.0 < 4.15.1 affected
5.0 series ≥ 5.0.0-rc.0 < 5.0.0-rc.16 affected
every other version: unaffected
cpe cpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*
version type semver
modules · source files · routines
modules 'Elixir.AshAuthentication.AddOn.LogOutEverywhere.Transformer' · 'Elixir.AshAuthentication.AddOn.LogOutEverywhere.OnPasswordChange'
source files lib/ash_authentication/add_ons/log_out_everywhere/transformer.ex · lib/ash_authentication/add_ons/log_out_everywhere/on_password_change.ex
routines 'Elixir.AshAuthentication.AddOn.LogOutEverywhere.Transformer':transform/2 · 'Elixir.AshAuthentication.AddOn.LogOutEverywhere.OnPasswordChange':change/3

Affected — GitHub / team-alembic/ash_authentication Repository ↗

≥ 0993f94 and up affected
→ 954697f not affected
→ 2baef4e not affected
every other version: unaffected
cpe cpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules 'Elixir.AshAuthentication.AddOn.LogOutEverywhere.Transformer' · 'Elixir.AshAuthentication.AddOn.LogOutEverywhere.OnPasswordChange'
source files lib/ash_authentication/add_ons/log_out_everywhere/transformer.ex · lib/ash_authentication/add_ons/log_out_everywhere/on_password_change.ex
routines 'Elixir.AshAuthentication.AddOn.LogOutEverywhere.Transformer':transform/2 · 'Elixir.AshAuthentication.AddOn.LogOutEverywhere.OnPasswordChange':change/3

Configurations

The log_out_everywhere add-on sets apply_on_password_change? true, as mix ash_authentication.install writes, and the password is changed through a non-atomic update action, which includes the generated password reset action and the installer's change_password action. The attacker must already hold one of the victim's session tokens.

References

Credits

azmaveth Finder Reporter Remediation developer

CVSS breakdown

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