GHSA-VRHQ-38VX-9VJP
A Manager or HR manager can grant any shared folder to an account they create or manage, and read its items through it
CVSS:3.1/AV:N/AC:L/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-VRHQ-38VX-9VJP divulgada · CVSS 8.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Since GHSA-j3ph-4847-695h (fixed in 3.2.3.0), a Manager or HR manager may only hand out the roles they hold or created, on the folders they can access. The Users page applies that limit to roles only. The per-user Allowed Folders were stored exactly as submitted, and a direct folder grant gives full write access to the folder, whatever the roles of the account. A manager could therefore create an account, grant it any shared folder by id, sign in with it, and read or modify every item of folders the manager cannot open.
Details
Paths and line numbers are those of 3.2.4.1 (`app/sources/users.queries.php` is identical on the development branch).
- `add_new_user` (`users.queries.php:799`) accepts administrators, HR managers and managers (`:822`). The role ids are reduced to the ones the caller may grant (`:858`, `mergeGrantableRoleSets(..., callerGrantableRoleIds())`). The folder ids `allowed_flds` only go through `FILTER_SANITIZE_NUMBER_INT` (`:853`) and reach `setUserGroups()` unchanged (`:975`).
- `setUserGroups()` (`main.functions.php:11410`) replaces the account's `users_groups` rows with every submitted id.
- `identUser()` (`main.functions.php:722`) turns each `users_groups` row into an accessible folder with full write access, overriding a read-only role (`:770`).
- The new account receives a sharekey for every shared item, whatever its folder (`app/scripts/traits/UserHandlerTrait.php`, `generateNewUserStep20`, `:319`). Access to shared items is decided by folder only, so the granted folder opens all its items.
- `add_new_user` returns the account's temporary password (`:1093`), so the manager can sign in with it.
The same unscoped write exists on `store_user_changes` (input `:1724`, sink `:1991`) and `update_users_rights_sharing` (input `:2446`, sink `:2547`), for accounts the manager is allowed to manage. The Users form only lists the caller's own folders (`get_user_info`, `:1574` and `:1606`), but the write paths did not repeat that check. The forbidden folders (`forbidden_flds`, `users_groups_forbidden`) had the same gap, with a lower impact: they can only restrict an account.
Affected versions. 3.0.0.0 already stored `allowed_flds` unchecked (`sources/users.queries.php`, `add_new_user`, column `groupes_visibles`), merged it into the accessible folders in `identUser()`, and gave a new account a sharekey for every shared item.
Proof of concept
- As an administrator, with local accounts and personal folders off:
- create the role and folder `ManagerSandboxOnly` (Write);
- create a manager `mgrhip38` holding that role;
- create the shared folder `Finance-Reports-2026` (id `2`) with an item whose password is `DummySecret-NotTheTarget-42!`. The manager has no right on folder `2`.
- As the manager, `get_item_password` on that item answers `Access to password item denied!`.
- As the manager, `POST /sources/users.queries.php`, `type=add_new_user`, with the manager's session key:
```json
{"login": "puppet38", "admin": 0, "manager": 0, "hr": 0,
"groups": [<ManagerSandboxOnly role id>], "allowed_flds": [2], "forbidden_flds": []}
```
The answer is `error=false`, with the `user_id` and the temporary `user_password`. `SELECT group_id FROM teampass_users_groups WHERE user_id = <puppet>` returns `2`.
4. Once `is_ready_for_usage = 1`, sign in as `puppet38`. `get_item_password` on the same item returns the password (`base64` of `DummySecret-NotTheTarget-42!`). The manager's own session is still refused.
Impact
Any account with the Manager or HR manager privilege can grant any shared folder to an account they create or manage. Through that account, they can read every item of those folders, passwords included, and modify them: a direct grant is full write. This includes folders the manager cannot open themselves. The privilege boundary set by GHSA-j3ph-4847-695h is bypassed.
Not concerned:
- administrators already hold these rights;
- standard users, who are refused by the Users handlers;
- items in personal folders: other users' personal folders are skipped at key generation and when the account's folders are resolved.
No victim interaction is needed.
Patches
Fixed in 3.2.4.2. The folder lists submitted by a non-administrator are reconciled with the caller's scope, with the same rule as the roles: the caller's accessible folders, minus personal folders and the folders denied to the caller. That is also the list the Users form displays.
- A submitted folder outside that scope is dropped.
- A folder already stored outside that scope is kept, so saving the form never revokes a folder the caller cannot see.
This applies to the allowed and forbidden folders of `add_new_user`, `store_user_changes` and `update_users_rights_sharing`. Administrators are not affected. The unit test `tests/Unit/UserFolderGrantScopeTest.php` covers the scope and fails if any write of these lists skips it.
Workarounds
None by configuration. Until the upgrade, give the Manager and HR manager privileges only to trusted accounts. Administrators can review the direct grants (Users → Allowed Folders, table `users_groups`) of the accounts created or edited by managers.
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.2 | — | — |
3.2.4.2Arsenal 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-vrhq-38vx-9vjpLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
