GHSA-MQ4W-P2GW-PQP4
LAPR: missing endpoint authorization lets any LAPR operator rotate arbitrary privileged Linux accounts and capture the resulting password
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-MQ4W-P2GW-PQP4 divulgada · CVSS 9.9 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The LAPR (Linux Account Password Rotation) module scopes managed *items* by folder, but never scopes *endpoints*. Any user holding the `can_manage_lapr` permission can attach a managed account to any enrolled endpoint — including endpoints whose SSH credential item lives in a folder they cannot read — and then trigger a rotation. The rotation worker reads the endpoint's SSH credential as `TP_USER` (server-side key chain, bypassing per-user folder ACLs), connects to the target host, changes the password of the Linux account named in the attacker's own item, and writes the newly generated password back into that item.
The result is a full privilege escalation from "LAPR operator with access to one folder" to "root on any enrolled Linux server".
Details
`laprAddAccount()` in `app/sources/lapr_accounts.queries.php` validates that the caller can write the item's folder, but its only endpoint validation is an existence-and-status check:
$endpoint = DB::queryFirstRow(
'SELECT id, hostname, os_info, ssh_username, ssh_auth_method, ssh_credential_source
FROM ' . prefixTable('lapr_endpoints') . ' WHERE id = %i AND status = %s',
$endpointId,
'active'
);The same omission affects `laprStartRotation()`, `laprStartDiscover()` and `laprResetAccount()`, and the three list handlers (`laprListAccounts()`, `laprListEndpointsOptions()`, `laprListEndpoints()`) disclose every endpoint — hostname, port and SSH username included — to every LAPR operator.
That this is an oversight rather than a design decision is shown by `laprStartTest()` and `laprAddEndpoint()` in `app/sources/lapr_endpoints.queries.php`, which both verify `laprUserCanReadFolder()` on the credential item before using it. The check is simply absent once the endpoint is enrolled.
PoC
- Alice and Bob both hold `can_manage_lapr`. Alice enrolled endpoint `prod-db` (SSH credential item in a folder only Alice can read). Bob has no access to that folder.
- Bob creates an item in a folder he can write, with `login = root`.
- Bob calls `add_account` with `endpoint_id = <prod-db>` and `item_id = <his item>`. The endpoint check passes (the endpoint exists and is active).
- Bob calls `start_rotation`. The folder check passes — it inspects *his* item's folder.
- The worker decrypts `prod-db`'s SSH credential as `TP_USER`, connects, runs `chpasswd` for `root`, and stores the new root password in Bob's item.
- Bob reads root's password for a server he was never authorized to touch.
Impact
Horizontal and vertical privilege escalation leading to remote system compromise. Requires an authenticated TeamPass account with the `can_manage_lapr` flag and write access to at least one folder. Affects all installations with LAPR enabled (`lapr_enabled = 1`).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Versiones afectadas
3.2.2.0Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistnilsteampassnet/teampass |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/nilsteampassnet/TeamPass/security/advisories/GHSA-mq4w-p2gw-pqp4Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
