llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · remdex/livehelperchat

GHSA-XGGF-JJQ9-VQ84

Admin session from an empty token at restapi/loginbytoken

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
8.1
Alta
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición39 dDesde la divulgación, 12 oct 2026, 1:51 a. m.
Detección37 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Monitoreo
Detectada +1
12 oct 26
19 nov 26
20 nov 26
12 oct 26
22 oct 26
1 nov 26
10 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-XGGF-JJQ9-VQ84 divulgada · CVSS 8.1 (GitHub)
Divulgación Modificada Última actualización del registro
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

`modules/lhrestapi/loginbytoken.php:9` rejects a missing `token` parameter and nothing else:

if (!isset($_GET['token'])) { throw new Exception('Token not found!'); }
$token = $_GET['token'];
$uSession = erLhcoreClassModelUserSession::findOne(array('filter' => array('token' => $token)));

An empty string passes that check and is looked up as a value. `modules/lhrestapi/logout.php:19` produces exactly such a row: logging out of the mobile app sets `$uSession->token = ''` instead of deleting the record.

The endpoint is unauthenticated by construction. `modules/lhrestapi/module.php:158` routes it with no function entry, and the handler never calls `erLhcoreClassRestAPIHandler::validateRequest()`, which its neighbour `modules/lhrestapi/notifications.php:5` does call before touching the same model.

Result: once such a row exists, one anonymous GET returns a session for the account behind it.

Details

`loginbytoken.php:9` tests only `isset()`, so `?token=` reaches the lookup at `:15` with an empty string, and `findOne` matches the row that `logout.php:19` left behind. `modules/lhrestapi/module.php:158` declares the view without a `functions` entry, so the dispatcher applies no check, and `loginbytoken.php` calls `setHeaders()` but never `validateRequest()`. The product treats an empty token as revoked everywhere else: `lib/core/lhmobile/lhmobile.php` filters every push delivery with `'filternot' => array('token' => '')` at lines 109, 147, 238 and 311. The vendor's own API documentation describes `logout` as revoking the token.

Not reachable on a fresh install: `lh_users_session` is empty and the request returns HTTP 400.

The required row is created by `restapi/login` with `generate_token=true`, which needs `lhrestapi/use_direct_logins`. The installer does not grant that to the Operators role, so in a default deployment the account behind such a row is an administrator.

`expires_on` is never evaluated and no scheduled task prunes the table. A row disappears only when an administrator deletes it under `mobile/sessions`, or when the same `device_token` logs in again and the row is reused.

The attacker cannot choose the account. `findOne` applies `limit 1` ordered by id descending (`lib/core/lhcore/lhdbtrait.php:227`, `:367-377`), so the row returned is the highest id among the empty tokens, which is the most recently registered device session and not necessarily the one logged out last. Older empty-token rows are unreachable.

The attacker cannot create the precondition either: `restapi/logout` requires a valid token.

Proof of concept

LiveHelperChat 4.94v (`d8787d04`), Docker, default configuration, anonymous requests with a fresh cookie jar.

  1. Precondition, created through the product's own path.
POST /index.php/restapi/login
Authorization: Basic <user:pass>
username=<u>&password=<p>&generate_token=true&device=android&device_token=<any>
-> session_token

POST /index.php/restapi/logout     token=<session_token>
-> Token was revoked

`lh_users_session` now holds one row with `token = ''`. Without `device` the login returns `400 Device not provided!`.

  1. Three requests in the identical state.
GET /index.php/restapi/loginbytoken?&api=true                    -> 400 {"error":true,"msg":"Token not found!"}
GET /index.php/restapi/loginbytoken?token=ZZZnotarealtoken&api=true -> 400 {"error":true,"msg":"Token not found"}
GET /index.php/restapi/loginbytoken?token=&api=true              -> 200 {"error":false,"msg":"Session started", ...}
  1. Both modes set a session cookie; without `api=true` the response redirects into the panel.
HTTP/1.1 302 Found
Set-Cookie: PHPSESSID=...; path=/; HttpOnly; SameSite=Lax
Location: /index.php/site_admin/

With that cookie, `user/account` shows `value="admin"`, and `user/userlist`, `system/configuration`, `permission/roles` and `mobile/sessions` all answer 200.

Controls
  1. On an untouched install the same request returns 400: `SELECT COUNT(*) FROM lh_users_session` is 0.
  2. `?token=%20` also succeeds where the collation is PAD SPACE, as here with MySQL 5.7 and `utf8mb4_unicode_ci`; on a NO PAD collation that variant fails. `?token[]=` succeeds through the `IN` branch regardless.
  3. `setLoggedUser` checks `disabled == 0` (`lib/core/lhuser/lhuser.php:233`), so a disabled account does not get a session. `loginbytoken.php:30` ignores that return value, so the response is `200` either way. This control is source level; it was not executed on the shared instance.

Live-verified: an anonymous GET with an empty token returned an administrator session, and that session reached every administrative view.

Impact
  • Full administrative access from one unauthenticated GET, with no credential and no secret.
  • A single request is an anonymous oracle: 200 against 400 reveals that a row with an empty token exists, without any credential.
  • The window does not close on its own: nothing expires the row, and no application log records the request; `lh_users_login` stays unchanged.
  • The session reaches `user/account`, whose password form requires no current password (`lib/core/lhuser/lhuservalidator.php:1119-1131`, `account.tpl.php:79-84`). That is a separate defect and is reported on its own.

Credit

Jan Kahmen, turingpoint https://www.turingpoint.de (jan@turingpoint.de)

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

Rangos afectados

Afectada Corregida
remdex/livehelperchat≤ 4.94v
4.94v
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistremdex/livehelperchat
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/LiveHelperChat/livehelperchat/security/advisories/GHSA-xggf-jjq9-vq84

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