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.
Published: 2026-09-17
Score: 9.1 Critical
EPSS: n/a
KEV: No
Impact: Authentication Bypass via Magic Link Replay
Action: Immediate Patch
AI Analysis

Impact

The vulnerability is a time‑of‑check time‑of‑use race condition in AshAuthentication’s magic‑link flow. Because the token validity check is not serialized with its consumption, an attacker holding a leaked or intercepted magic‑link token can submit multiple concurrent requests that all succeed, each granting a fresh authentication token. This allows the attacker to authenticate as the target user, effectively bypassing intended single‑use restrictions. The weakness is a classic TOCTOU concurrency flaw, identified as CWE‑367.

Affected Systems

Vulnerable versions of the AshAuthentication library from team‑a­lembic include releases 3.9.0 up to and including 4.14.x, and releases 5.0.0‑rc.0 through 5.0.0‑rc.13. All other releases, starting at 4.15.0 and 5.0.0‑rc.14, contain the fix.

Risk and Exploitability

The CVSS base score of 9.1 indicates high severity, and the lack of a KEV listing suggests no known active exploitation yet. The EPSS score is not available, but the high rating and the nature of the race condition imply a non‑negligible likelihood of exploitation in environments where magic links are used and the token cannot be protected from replay. An attacker would need to obtain a legitimate magic link or token—via interception, phishing, or insider compromise—and then replay it through concurrent requests to succeed.

Generated by OpenCVE AI on September 17, 2026 at 22:17 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade AshAuthentication to the latest stable release (4.15.0 or newer, or 5.0.0‑rc.14 or newer) where the token validity check and revocation are properly synchronized.
  • Apply the code changes documented in the security advisory (GHSA‑23gr‑vcp4‑r27q) that add serialization and conflict detection to the revocation process; if the advisory does not provide an automatic update, manually merge the relevant commits from the project repository.
  • Implement a temporary mitigation by disabling the single_use_token feature or limiting magic link usage to a single request per session until the library can be upgraded.

Generated by OpenCVE AI on September 17, 2026 at 22:17 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 17 Sep 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 17 Sep 2026 13:30:00 +0000

Type Values Removed Values Added
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.
Title Magic link single-use tokens replayable via TOCTOU race in AshAuthentication
First Time appeared Team-alembic
Team-alembic ash Authentication
Weaknesses CWE-367
CPEs cpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*
Vendors & Products Team-alembic
Team-alembic ash Authentication
References
Metrics cvssV4_0

{'score': 9.1, 'vector': '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'}


Subscriptions

Team-alembic Ash Authentication
cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-09-17T18:26:08.563Z

Reserved: 2026-08-31T01:00:10.817Z

Link: CVE-2026-82761

cve-icon Vulnrichment

Updated: 2026-09-17T18:26:00.636Z

cve-icon NVD

Status : Received

Published: 2026-09-17T14:17:33.423

Modified: 2026-09-17T19:17:04.677

Link: CVE-2026-82761

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-18T00:00:12Z

Weaknesses
  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition