GHSA-P84Q-3H9H-QVH6
Password change and password recovery do not end the sessions opened before them
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-P84Q-3H9H-QVH6 divulgada · CVSS 6.8 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
A password change or a password recovery does not end the web session it is meant to evict. TeamPass accepts a web request while `users.key_tempo` equals the session's key and `users.session_end` is still in the future. The self-service password change and the e-mail recovery touch neither value, nor the session id. A session opened before the change, for instance a stolen session cookie, therefore keeps working after the change. The same holds when an administrator generates new keys and a new password for a user. API sessions (JWT) issued before the change are not revoked either.
Details
Paths under `app/sources/`, line numbers as of 3.2.4.0.
`PerformChecks::checkSession()` (`app/vendor/teampassclasses/performchecks/src/PerformChecks.php:86-102`) accepts a request when `key_tempo` equals the session key and `session_end` has not passed. Logout (`app/core/logout.php`) and the administrator disconnect (`users.queries.php:1294-1306`) clear both columns. The paths below clear neither:
- Password change dialog: `change_user_auth_password` → `changeUserAuthenticationPassword()` (`main.queries.php:3671-3787`).
- What it changes: the password hash and the re-encrypted private key.
- What it keeps: the session id, `key_tempo`, `session_end` and the API sessions.
- The key pair does not change, and the session keeps the private key in clear, so a session holder keeps decrypting every item.
- E-mail recovery: `reset-password.php:159-189` → `handleUserKeys()`.
- What it changes: a new password and key pair. Personal access tokens and device credentials are deleted.
- What it keeps: `key_tempo`, `session_end` and the API sessions.
- The owner's next sign-in, which would replace `key_tempo`, is refused until the background re-key finishes.
- Administrator key generation for another user: `user_new_keys_generation` with a `user_id` (`main.queries.php:869-911`). Same as the recovery.
- Profile path `change_pw`: `changePassword()` (`main.queries.php:1314-1461`).
- It has the same gap, and it never verifies the current password.
- On a standard schema it fails before writing anything, because it updates `users.fonction_id`, a column dropped in 3.1.5. That is why it only ran in the lab after the column was added back.
Lifetime: the session is not bounded by the 60-minute post-login window. `increase_session_time` (`main.queries.php:453-456`, `4078-4100`) added a client-supplied duration with no upper limit, so an active session holder could extend the session at will.
Who can still hold a session: every sign-in writes its new key to `key_tempo`, which evicts the account's other sessions. So after a change made by the user, the only remaining holder is whoever shares the user's own session id, typically through a copied cookie.
Not covered here: GHSA-2vf9-2qw7-8hmr. There, any session holder can replace the account password through the key generation endpoint without the current password.
Proof of concept
As reported:
- Hold a session of user U (a copy of U's session cookie).
- U changes their password in the dialog, or recovers it by e-mail.
- Requests made with the copied cookie still pass. After the dialog change, they still decrypt U's items.
Impact
The attacker must already hold a live session of the user; the issue grants no initial access. Given that session, the attacker:
- keeps it after the user changes or recovers the password, which is the standard reaction to a suspected compromise;
- could extend it beyond the configured maximum session duration.
Patches
Fixed in 3.2.4.1:
- A password change made by the user regenerates the session id, destroys the old one, and revokes the user's API sessions.
- A recovery, or an administrator key generation for another user, ends the account's web and API sessions, as an administrator disconnect does.
- `change_pw` verifies the current password before any write.
- `increase_session_time` can no longer extend a session beyond the maximum session duration counted from now.
Workarounds
After changing the password, sign out and sign in again: signing out clears the session key and ends the copied session. After a recovery, an administrator can disconnect the account (Users > Disconnect).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistnilsteampassnet/teampass |
Corregida | 3.2.4.1 | — | — |
3.2.4.1Arsenal 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-p84q-3h9h-qvh6Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
