CVE-2026-82761: CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition in team-alembic ash_authentication
Time-of-check Time-of-use (TOCTOU) Race Condition vulnerability in team-alembic AshAuthentication allows an attacker holding a leaked magic link to replay its single-use token and authenticate as the target subject. A magic link configured with single_use_token?, which is the default, is meant to be redeemable exactly once, but nothing serialises the token's validity check against its consumption, so concurrent redemptions of one token all succeed and each yields a full user token. Sign-in verifies the JWT with Jwt.verify/4 and revokes it only afterwards: AshAuthentication.Strategy.MagicLink.SignInPreparation revokes in a Query.after_action callback, and AshAuthentication.Strategy.MagicLink.SignInChange in an after_transaction hook that runs once the sign-in has already committed. AshAuthentication.TokenResource.Actions.revoke/3 writes the revocation as an upsert, so a concurrent duplicate revocation silently succeeds instead of conflicting and no request ever loses the race. This issue affects ash_authentication: from 3.9.0 before 4.15.0 and from 5.0.0-rc.0 before 5.0.0-rc.14.
AI Analysis
Technical Summary
The vulnerability in ash_authentication involves a TOCTOU race condition where the single-use magic link token can be redeemed multiple times concurrently. The sign-in process verifies the JWT token before revoking it, but the revocation occurs asynchronously after the sign-in has committed, allowing multiple concurrent requests to validate the same token successfully. The revocation is implemented as an upsert operation that does not conflict on concurrent attempts, so no request loses the race. This flaw enables attackers holding a leaked magic link token to authenticate repeatedly as the victim, violating the intended single-use token policy. The affected versions are >=3.9.0 <4.15.0 and >=5.0.0-rc.0 <5.0.0-rc.14.
Potential Impact
An attacker with access to a leaked single-use magic link token can replay the token multiple times concurrently to authenticate as the target user multiple times. This breaks the single-use token security model, potentially allowing unauthorized access to user accounts without needing additional credentials or privileges. The vulnerability has a high severity with a CVSS 4.0 score of 9.1, indicating critical impact on confidentiality and integrity without requiring user interaction or privileges.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch links are provided in the available data. Until a patch is available, users should consider mitigating the risk by avoiding use of single-use magic link tokens or implementing external synchronization to serialize token redemption. Monitor vendor communications for updates on an official fix.
CVE-2026-82761: CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition in team-alembic ash_authentication
Description
Time-of-check Time-of-use (TOCTOU) Race Condition vulnerability in team-alembic AshAuthentication allows an attacker holding a leaked magic link to replay its single-use token and authenticate as the target subject. A magic link configured with single_use_token?, which is the default, is meant to be redeemable exactly once, but nothing serialises the token's validity check against its consumption, so concurrent redemptions of one token all succeed and each yields a full user token. Sign-in verifies the JWT with Jwt.verify/4 and revokes it only afterwards: AshAuthentication.Strategy.MagicLink.SignInPreparation revokes in a Query.after_action callback, and AshAuthentication.Strategy.MagicLink.SignInChange in an after_transaction hook that runs once the sign-in has already committed. AshAuthentication.TokenResource.Actions.revoke/3 writes the revocation as an upsert, so a concurrent duplicate revocation silently succeeds instead of conflicting and no request ever loses the race. This issue affects ash_authentication: from 3.9.0 before 4.15.0 and from 5.0.0-rc.0 before 5.0.0-rc.14.
CVSS v4.0
Score 9.1critical
Affected software
team-alembic
ash_authentication
team-alembic
ash_authentication
pkg:hex/ash_authenticationpkg:github/team-alembic/ash_authenticationcpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in ash_authentication involves a TOCTOU race condition where the single-use magic link token can be redeemed multiple times concurrently. The sign-in process verifies the JWT token before revoking it, but the revocation occurs asynchronously after the sign-in has committed, allowing multiple concurrent requests to validate the same token successfully. The revocation is implemented as an upsert operation that does not conflict on concurrent attempts, so no request loses the race. This flaw enables attackers holding a leaked magic link token to authenticate repeatedly as the victim, violating the intended single-use token policy. The affected versions are >=3.9.0 <4.15.0 and >=5.0.0-rc.0 <5.0.0-rc.14.
Potential Impact
An attacker with access to a leaked single-use magic link token can replay the token multiple times concurrently to authenticate as the target user multiple times. This breaks the single-use token security model, potentially allowing unauthorized access to user accounts without needing additional credentials or privileges. The vulnerability has a high severity with a CVSS 4.0 score of 9.1, indicating critical impact on confidentiality and integrity without requiring user interaction or privileges.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch links are provided in the available data. Until a patch is available, users should consider mitigating the risk by avoiding use of single-use magic link tokens or implementing external synchronization to serialize token redemption. Monitor vendor communications for updates on an official fix.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- EEF
- Date Reserved
- 2026-08-31T01:00:10.817Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6aabe86855bf5e2cf56c51c5
Added to database: 09/17/2026, 13:17:28 UTC
Last enriched: 09/17/2026, 13:31:40 UTC
Last updated: 09/18/2026, 00:44:18 UTC
Views: 11
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.