Vulnerabilities/

CVE-2026-82761

CVE

CVE-2026-82761

Magic link single-use tokens replayable via TOCTOU race in AshAuthentication

Severity

Critical

Base CVSS

0.0

Fixed in

9ef6864b8833d3b795427a7b8dc518a4997d41ab

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 singleusetoken?, 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.afteraction callback, and AshAuthentication.Strategy.MagicLink.SignInChange in an aftertransaction 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.

Severity scores

Source

Severity

Base score

CVSS version

Score vector

NVD

Critical

9.1

4.0

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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

OSV

0

Endor Labs

Required action

Known ransomware campaign use

References

https://cna.erlef.org/cves/CVE-2026-82761.html, https://github.com, https://osv.dev/vulnerability/EEF-CVE-2026-82761, https://repo.hex.pm, https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/82xxx/CVE-2026-82761.json, https://github.com/team-alembic/ashauthentication/security/advisories/GHSA-23gr-vcp4-r27q, https://nvd.nist.gov/vuln/detail/CVE-2026-82761, https://github.com/team-alembic/ashauthentication/commit/18dfdb36c14aa6a61df8572bce2d5ec36b1d9840, https://github.com/team-alembic/ashauthentication/commit/9ef6864b8833d3b795427a7b8dc518a4997d41ab, https://github.com/team-alembic/ashauthentication/commit/cf3d227ef25912cf1b0c5fa80f20001f5c46a102, https://github.com/team-alembic/ash_authentication

Basic information

Base CVSS

0.0

EPSS probability

0.0

EPSS percentile

0.36271

Introduced version

6767fe27eb952e5bc09aa2e5a7d8f96f5a1c424a

Fix available

9ef6864b8833d3b795427a7b8dc518a4997d41ab

Endor Patches

Fix critical vulnerabilities instantly

Secure your app without upgrading: detect a compatible fix, apply safe remediation, and ship it in a single pull request.

Fix without upgrading

Get a demo of Endor Labs today.