GHSA-4462-CJQ3-PCXV
Password change handler stores the submitted current password in plain text in users.last_pw
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-4462-CJQ3-PCXV divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
`changePassword()` (`app/sources/main.queries.php`) copied the `current_pw` value of a `change_pw`
request verbatim into `users.last_pw`, and the sign-in (`app/sources/identify.php`) loaded that
column into the session. Nothing ever read it back. A database dump or backup would contain, in
clear, any current password submitted through that request.
No shipped client sends a non-empty `current_pw` on a reachable path, so the column holds no
password on installations used through the web interface. The issue is a plaintext-password sink,
fixed as hardening.
Details
- Write — `'last_pw' => $post_current_password` in the `users` update of `changePassword()`,
- Read — `$session->set('user-last_pw', $userInfo['last_pw'])` in `identify.php`. No code uses
- Reachability with the shipped clients — none of them sends a non-empty `current_pw`:
- the Profile → change password form (`app/pages/profile.js.php`, change request
- the forced password change card of the login page (`app/core/login.js.php`, change request
A value is therefore stored only when an authenticated user hand-crafts a `change_pw` request
that contains their own current password.
- What a stored value would expose — a password change re-encrypts the same RSA private key
under the new password and keeps the previous copy in `user_private_keys` (`is_current = 0`).
The previous password stored next to it opens that copy, so a database dump alone would yield
the user's private key, and through it every sharekey and item the user holds — the at-rest
boundary restored by GHSA-fv78-jwjv-pj25.
Proof of concept
On an affected version, signed in, send a `change_pw` request (`type_category: action_password`)
to `sources/main.queries.php` whose encrypted payload contains `current_pw` set to the account's
current password, alongside `new_pw`, a `complexity` that meets the role requirement and
`change_request: user_decides_to_change_password`. After the request,
`SELECT last_pw FROM <prefix>users WHERE id = <own id>` returns the submitted current password,
HTML-entity encoded.
The same query on an account whose password was only ever changed through the interface returns
an empty string.
Impact
Low. Installations used through the shipped interface hold no plaintext password in
`users.last_pw`. The defect is a sink that a client change, or a revival of the login-page card,
would have turned into a disclosure of previous passwords — and, with the retained private key
copies, of the user's items — to anyone able to read the database or a backup of it.
Installations upgraded from 2.x may still hold the 2.x list of previous password hashes in the
column.
Fix
Fixed in 3.2.3.0:
- `changePassword()` no longer writes `users.last_pw`, and the sign-in no longer loads it into
- The 3.2.3 upgrade empties every stored `last_pw` value, including the 2.x hash lists. The step
- A sentinel test (`tests/Unit/LastPasswordNotStoredTest.php`) fails if any shipped file writes a
Workarounds
Empty the column on the database:
UPDATE <prefix>users SET last_pw = '' WHERE last_pw <> '';The `change_pw` handler of an unpatched version will refill it only for a request that carries a
non-empty `current_pw`, which the shipped interface does not send.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistnilsteampassnet/teampass |
Corregida | 3.2.3.0 | — | — |
3.2.3.0Arsenal 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-4462-cjq3-pcxvLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
