GHSA-H25R-8CC9-2CG8
LAPR: SSH host key is verified after authentication, disclosing the privileged SSH credential to a man-in-the-middle
CVSS:3.1/AV:N/AC:H/PR:N/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-H25R-8CC9-2CG8 divulgada · CVSS 9 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
`LAPRSshService::connect()` authenticates to the remote host before the TOFU host key fingerprint is ever computed or compared. When an attacker is able to intercept the connection (ARP/DNS spoofing, a compromised network segment, a hijacked IP), the SSH password is transmitted to the impostor server and the mismatch is only detected afterwards — too late.
Because the credential used by LAPR is by construction a privileged account (root, or an account with passwordless `sudo` for `chpasswd`), a single intercepted rotation hands the attacker a reusable privileged credential for the real target.
Details
In `app/includes/libraries/teampassclasses/lapr/src/LAPRSshService.php`, `connect()` calls `$ssh->login()` (which sends the credential) and only then sets `$this->ssh`, which is the precondition for `getFingerprint()`:
$authenticated = $ssh->login($username, $secret); // credential already on the wire
...
$this->ssh = $ssh;
return ['success' => true, 'fingerprint' => $this->getFingerprint() ?? ''];The only TOFU comparison lives in the *caller*, `app/scripts/traits/LAPRRotationTrait.php`, after `connect()` has already returned:
if ((int) $account['ssh_hostkey_verified'] === 1) {
$currentFp = (string) $service->getFingerprint();
...
}`app/scripts/traits/LAPRDiscoverTrait.php` performs no fingerprint comparison at all, so a discovery scan always leaks the credential to whatever host answers.
phpseclib3 makes no trust decision on its own; `SSH2::getServerPublicHostKey()` performs the key exchange and validates the host key signature without authenticating, so the fingerprint is available *before* `login()` is called. The check was simply placed on the wrong side of the authentication step.
PoC
- Endpoint `prod-app` is enrolled with password authentication and `ssh_hostkey_verified = 1`.
- An attacker on the path redirects the endpoint's hostname/IP to a host running their own sshd.
- A scheduled rotation fires. `connect()` runs the key exchange against the impostor and calls `login()`, sending the plaintext SSH password.
- The impostor logs the credential; TeamPass then detects the fingerprint mismatch and aborts.
- The attacker now holds a valid privileged SSH credential for the real `prod-app`. Every subsequent scheduled rotation re-exposes it with no user interaction.
Impact
Disclosure of a privileged SSH credential to a network-positioned attacker, leading to remote system compromise. Password authentication (the default) is fully affected. Key authentication is materially less severe — the private key itself is not disclosed — but the connection is still established with an unverified host.
Requires the attacker to be able to intercept traffic between the TeamPass server and the managed endpoint. Affects all installations with LAPR enabled.
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-h25r-8cc9-2cg8Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
