llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · @logto/core

GHSA-3XJ6-982X-2R3G

One-time token can be verified twice concurrently due to missing status predicate in UPDATE query

Texto original en inglés · Ver en español

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
6.5
Media
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición12 dDesde la divulgación, 9 nov 2026, 2:03 a. m.
Detección9 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. No hay versión corregida: aplique mitigaciones.
Revisa, agenda, parchea. El clásico de siempre.Agenda, parchea y celebra con un mate.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
9 nov 26
19 nov 26
21 nov 26
9 nov 26
12 nov 26
15 nov 26
18 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-3XJ6-982X-2R3G divulgada · CVSS 6.5 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

Logto's one-time token verification contains a TOCTOU race condition. The `verifyOneTimeToken()` function reads a token's status as Active, validates it, then issues an UPDATE query that has no WHERE status = Active predicate. Under PostgreSQL Read Committed isolation, two concurrent transactions can both read Active, both pass validation, and both update the row to Consumed - each returning success to the caller.

Impact

A one-time password-reset token or magic-link token that should be single-use can be consumed by two concurrent flows:
- Password reset replay: An attacker with the token can race the verification to establish two independent password-reset sessions and call resetPassword() on each to set a password of their choice (account takeover).
- Magic-link dual sign-in: Two tabs loading the same sign-in token URL can both complete sign-in, creating two authenticated sessions from one token.

Root Cause

packages/core/src/queries/one-time-tokens.ts has an updateOneTimeTokenStatus function that issues:
UPDATE one_time_tokens SET status = Consumed WHERE token = $token RETURNING *
There is no AND status = Active predicate. Both concurrent writers succeed.

packages/core/src/libraries/one-time-token.ts#verifyOneTimeToken() performs a read-then-write: checkOneTimeToken() reads and validates the token is Active, then updateOneTimeTokenStatus() updates to Consumed without checking current status.

Under PostgreSQL Read Committed:
- T1 reads status=Active (passes check)
- T2 reads status=Active (passes check, T1 has not committed yet)
- T1 UPDATE to Consumed, commits
- T2 UPDATE to Consumed (finds row by token, no status predicate - succeeds)

Affected Routes

  • Management API: POST /api/one-time-tokens/verify
  • Experience API: POST /experience/verification/one-time-token/verify
  • Forgot-password flow: identifyForgotPasswordWithOneTimeToken()

Proof

PostgreSQL-backed concurrency test: 30/30 race iterations both transactions successfully verified the same Active token (100% reproduction).

Remediation

Add AND status = Active to the UPDATE WHERE clause:
UPDATE one_time_tokens SET status = Consumed WHERE token = $token AND status = Active RETURNING *

Credit

Anonymous researcher

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
7.1/ 10Alto
Vector 7.1 (fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida
@logto/core≤ 1.45.0
1.45.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npm@logto/core
Sin parche — — —
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/logto-io/logto/security/advisories/GHSA-3xj6-982x-2r3g

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.