Am I affected?

type your ash_authentication version to check

Description

Insufficient Session Expiration vulnerability in team-alembic AshAuthentication and AshAuthentication Phoenix allows a revoked session to remain fully authenticated.

A resource configured with session_identifier :jti and require_token_presence_for_authentication? disabled stores its session value as <jti>:<subject>. The jti is there so that signing out can revoke that one session. Neither reader consults it: AshAuthentication.Plug.Helpers.authenticate_resource_from_session/4 and AshAuthentication.Phoenix.LiveSession.on_mount/4 both split the value with split_identifier/2, discard the jti and pass the bare subject to AshAuthentication.subject_to_user/3, which reloads the record. The token-presence branch of each function does check its token, calling AshAuthentication.TokenResource.Actions.get_token/3 with the jti and the purpose user. Because the revocation record is never read, neither its revoked state nor its expiry constrains the session, so a session captured before sign-out keeps working.

This issue affects ash_authentication: from 4.9.1 before 4.15.0 and from 5.0.0-rc.0 before 5.0.0-rc.14; ash_authentication_phoenix: from 2.10.0 before 2.17.4 and from 3.0.0-rc.0 before 3.0.0-rc.11.

Weaknesses & attack patterns

Weakness

CWE-613 · Insufficient Session Expiration in catalog → MITRE ↗

Attack patterns

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

Affected — Hex / ash_authentication Hex.pm ↗ Repository ↗

4.9.1 < 4.15.0 affected
5.0 series 5.0.0-rc.0 < 5.0.0-rc.14 affected
every other version: unaffected
cpe cpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshAuthentication.Plug.Helpers'
source files lib/ash_authentication/plug/helpers.ex
routines 'Elixir.AshAuthentication.Plug.Helpers':retrieve_from_session/3 · 'Elixir.AshAuthentication.Plug.Helpers':authenticate_resource_from_session/4

Affected — GitHub / team-alembic/ash_authentication Repository ↗

fcaeb73 and up affected
a3f49f7 not affected
e28e911 not affected
every other version: unaffected
cpe cpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshAuthentication.Plug.Helpers'
source files lib/ash_authentication/plug/helpers.ex
routines 'Elixir.AshAuthentication.Plug.Helpers':retrieve_from_session/3 · 'Elixir.AshAuthentication.Plug.Helpers':authenticate_resource_from_session/4

Affected — Hex / ash_authentication_phoenix Hex.pm ↗ Repository ↗

2.10.0 < 2.17.4 affected
3.0 series 3.0.0-rc.0 < 3.0.0-rc.11 affected
every other version: unaffected
cpe cpe:2.3:a:team-alembic:ash_authentication_phoenix:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshAuthentication.Phoenix.LiveSession'
source files lib/ash_authentication_phoenix/live_session.ex
routines 'Elixir.AshAuthentication.Phoenix.LiveSession':on_mount/4

Affected — GitHub / team-alembic/ash_authentication_phoenix Repository ↗

a3253fb and up affected
f7ab005 not affected
0135217 not affected
0135217 and up affected
f7ab005 not affected
0135217 not affected
every other version: unaffected
cpe cpe:2.3:a:team-alembic:ash_authentication_phoenix:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshAuthentication.Phoenix.LiveSession'
source files lib/ash_authentication_phoenix/live_session.ex
routines 'Elixir.AshAuthentication.Phoenix.LiveSession':on_mount/4

References

Credits

Peter Ullrich Reporter
Jonatan Männchen / EEF Analyst
James Harton Remediation developer

CVSS breakdown

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