Am I affected?

type your ash_authentication version to check

Description

Improper Verification of Cryptographic Signature vulnerability in team-alembic AshAuthentication allows a caller of the token revocation action to neutralise a revocation or write arbitrary rows into the token resource.

AshAuthentication.TokenResource.RevokeTokenChange.change/3 reads the :token argument and decodes it with AshAuthentication.Jwt.peek/1, which delegates to Joken.peek_claims/1 and performs no signature check, unlike Jwt.verify/4. The jti, exp and sub claims it returns are written straight onto the revocation record, guarded only by byte_size(token) > 0. Because expires_at derives from the attacker-chosen exp, a forged copy of a genuine token that keeps the real jti but backdates exp yields a revocation row that is already expired: expunge_expired removes it and the genuine token passes revoked? again. Arbitrary jti and sub values can be inserted the same way.

This issue affects ash_authentication: from 0.2.0 before 4.15.0 and from 5.0.0-rc.0 before 5.0.0-rc.14.

Weaknesses & attack patterns

Weakness

CWE-347 · Improper Verification of Cryptographic Signature in catalog → MITRE ↗

Attack patterns

CAPEC-475 · Signature Spoofing by Improper Validation MITRE ↗

Affected — Hex / ash_authentication Hex.pm ↗ Repository ↗

0.2.0 < 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.TokenResource.RevokeTokenChange'
source files lib/ash_authentication/token_resource/revoke_token_change.ex
routines 'Elixir.AshAuthentication.TokenResource.RevokeTokenChange':change/3

Affected — GitHub / team-alembic/ash_authentication Repository ↗

a939dde and up affected
344cebb not affected
eb86353 not affected
every other version: unaffected
cpe cpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshAuthentication.TokenResource.RevokeTokenChange'
source files lib/ash_authentication/token_resource/revoke_token_change.ex
routines 'Elixir.AshAuthentication.TokenResource.RevokeTokenChange':change/3

References

Credits

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

CVSS breakdown

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