llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · getgrav/grav-plugin-login

GHSA-MJ78-8GWC-VXJJ

Insufficient Session Expiration

Parche disponible
Descargar PNG JSON
CVSS 3.1
4.8
Media
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versión3.8.13
Exposición128 dDesde la divulgación, 14 jul 2026, 5:10 p. m.
Detección127 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
14 jul 26
18 nov 26
20 nov 26
14 jul 26
16 ago 26
17 sept 26
19 oct 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-MJ78-8GWC-VXJJ divulgada · CVSS 4.8 (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

Description
Component: classes/RememberMe/TokenStorage.php, method findTriplet()
Package: getgrav/grav-plugin-login (Composer: getgrav/grav-plugin-login)
Confirmed version: 3.8.12 (current develop HEAD, commit 322b6b9)
Root cause
TokenStorage implements the StorageInterface used by the birke/rememberme persistent-login library to validate the "Remember Me" cookie triplet (credential, token, persistentToken) on every auto-login attempt.
storeTriplet() persists the record as a nested array:
php$tokens[$persistentToken] = [$token => time()];
findTriplet() is intended to reject the triplet once it is older than the configured $timeout (constructor default 604800 seconds = 7 days):
phppublic function findTriplet($credential, $token, $persistentToken)
{
$persistentToken = sha1($persistentToken);
$token = sha1($token);

$file = $this->getFile($credential);
$tokens = (array)$file->content();

if (!isset($tokens[$persistentToken]) || $tokens[$persistentToken] < time() + $this->timeout) {
return self::TRIPLET_NOT_FOUND;
}
...
}
The bug: `tokens[tokens[
tokens[persistentToken]` is an array ([$token => time()]), not the stored timestamp — the timestamp is one level deeper. PHP's comparison rules state an array is always considered greater than a scalar in </> comparisons, regardless of contents. I confirmed this empirically:
Stored timestamp: 784010494 (~31 years in the past)
$tokens[$key] < time()+timeout → bool(false)
So the expiry branch of the || can never evaluate true — it is dead code. The only condition that actually causes rejection is !isset($tokens[$persistentToken]) (i.e., the record was deleted or overwritten). As a secondary, related defect, the $expire parameter accepted by storeTriplet()/replaceTriplet() is silently discarded and never used, so even an explicit expiry passed in by the caller has no effect.
Impact
The server-side validity window for a persistent "Remember Me" authentication token is supposed to be bounded (default 7 days) — this is the actual security boundary, since an attacker replaying a captured cookie value directly over HTTP is not constrained by client-side Expires/Max-Age cookie attributes. Due to this bug, a valid (token, persistentToken) pair remains accepted indefinitely — until the on-disk YAML record (user-data://rememberme/<sha1(credential)>.yaml) is overwritten by a subsequent auto-login or explicitly cleared (logout-everywhere / password change).
Practical consequence: if a Remember Me cookie is ever exposed — via device theft, browser sync/backup leakage, XSS, log/proxy capture, or a stale browser profile — the exposure window is unbounded rather than the administrator-configured timeout, directly undermining the security control the rememberme.timeout setting is meant to provide.
Proof of Concept
php$storage = new \Grav\Plugin\Login\RememberMe\TokenStorage('user-data://rememberme', 604800);
// Simulate a triplet stored 10 years ago
$storage->storeTriplet('admin@example.com', 'plaintoken', 'persistenttoken');
// manually backdate the YAML file's timestamp to 10 years ago, then:
$result = $storage->findTriplet('admin@example.com', 'plaintoken', 'persistenttoken');
// Expected: TRIPLET_NOT_FOUND (expired)
// Actual: TRIPLET_FOUND — auto-login succeeds
Suggested fix
php$entry = $tokens[$persistentToken] ?? null;
$storedTime = $entry ? current($entry) : null;
if ($storedTime === null || $storedTime + $this->timeout < time()) {
return self::TRIPLET_NOT_FOUND;
}
$stored = key($entry);
if (!hash_equals($token, $stored)) { // also fixes the non-constant-time compare below
return self::TRIPLET_INVALID;
}
(Also wire the ignored $expire parameter through, and switch $stored !== $token to hash_equals() while touching this method — that comparison is not currently timing-safe.)

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

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:L
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida
getgrav/grav-plugin-login< 3.8.13
3.8.13
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistgetgrav/grav-plugin-login
Corregida 3.8.13 — —
Versiones corregidas3.8.13
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/getgrav/grav/security/advisories/GHSA-mj78-8gwc-vxjj

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