GHSA-57WW-WX2C-HX7X
Rights propagation lets a manager or HR account grant the administrator-only root-folder creation right
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-57WW-WX2C-HX7X divulgada · CVSS 4.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The "propagate rights" action of the Users page (`update_users_rights_sharing` in `app/sources/users.queries.php`) wrote the client-supplied root-folder flag on every destination account. Its privileged-flags check stops a non-administrator from propagating the administrator, HR and manager flags, but not `can_create_root_folder`. A manager or HR account could therefore grant root-folder creation, a right only an administrator may change on the user edit form, to every account they administrate, including an account they created themselves. The same write let them clear the flag an administrator had set on those accounts.
Details
Paths and line numbers as of 3.2.4.1 (identical in 3.2.4.0).
- Source: `POST type=update_users_rights_sharing`. The `data` blob carries `user_rootfolder` (`users.queries.php:2453`), cast to an integer (`:2468`). The value is supplied by the client. The web page sends the flag of the source account, but the server never reads it from the source row.
- Gates:
- The action is not in `$all_users_can_access` (`:106-127`), so only administrators, managers and HR managers reach it (`:139-151`).
- Inside the case: session key (`:2420`) and read-only caller (`:2429`).
- Privileged-flags check (`:2500-2512`, added for GHSA-58ph-5gg6-h2v8 in 3.2.1.0): a non-administrator is refused when `user_admin`, `user_hr` or `user_manager` is 1. `user_rootfolder` is not tested.
- Scope check (`:2517-2528`): `callerMayManageUser()` (`app/sources/main.functions.php:13647`) on the source and on every entry of `destination_ids`.
- A manager passes for the non-privileged accounts administrated by one of their roles.
- An HR manager passes for every non-privileged account.
- This check limits *which* accounts are written, not *what* is written.
- Sink (`:2556-2569`): `DB::update(users, [..., 'can_create_root_folder' => $inputData['user_rootfolder'], ...])` on each destination (`:2562`).
- Effect: the flag is loaded into the session at sign-in (`app/sources/identify.php:1254`) and has two effects in `FolderManager` (`app/sources/folders.class.php`):
- `isParentFolderAllowed()` (`:580-591`) allows a folder whose parent is the root (`parent_id == 0`) without any further folder-access check. Without the flag, a non-administrator cannot create a root folder.
- `canCreateFolder()` (`:766`) also counts it as permission to create folders at all. This matters when `enable_user_can_create_folders` is off.
The other write paths do not let a manager or HR account set this flag the same way:
- `store_user_changes` (user edit form) keeps the stored value when the caller is not an administrator (`:1805-1808`). The checkbox is shown to administrators only (`app/pages/users.php`).
- `add_new_user` clears it when the creator is neither an administrator nor a holder of the flag (`:876-879`). A manager or HR account that an administrator gave the flag to could still grant it to the accounts it creates. The checkbox is not rendered for them, so only a crafted request reaches this.
Affected versions. The propagation has written the client-supplied flag since 3.0.0.0. Before 3.2.1.0, the action also let a manager write the administrator flag on any account, which is the broader escalation fixed with GHSA-58ph-5gg6-h2v8.
Proof of concept
- Sign in with a manager account (`gestionnaire=1`, not an administrator) that holds role R. Account V is managed by R and does not have `can_create_root_folder`.
- V can be an account the manager created, with R as its "managed by" role.
- With the manager's session, send `POST /sources/users.queries.php` with `type=update_users_rights_sharing`, the session `key`, and a `data` blob encrypted with the session key containing:
- `source_id`: any account the manager administrates;
- `destination_ids`: `[V]`;
- `user_rootfolder`: `1`;
- `user_admin`, `user_hr` and `user_manager`: `0`;
- the other fields copied from the source account.
- The response is `error: false`, and `users.can_create_root_folder` is now 1 for V.
- Sign in as V. A folder can now be created at the root of the shared tree.
Impact
A manager or HR account can confer a right reserved to administrators on the accounts it administrates. Through an account it created, it can use that right itself: creating top-level folders in the shared tree, outside the folders an administrator has given it. The same write can also clear the flag an administrator set on those accounts.
The caller does not become an administrator. No item, password or key is read (C:N), and the gain is limited to one structural right (I:L).
Patches
Fixed in 3.2.4.2. Only an administrator can now set or clear `can_create_root_folder`, on every write path:
- Rights propagation: when the caller is not an administrator, `can_create_root_folder` is no longer written, and each destination keeps its own value, as on the user edit form. The value is dropped, not refused, so a manager can still propagate the rights of an account an administrator gave the flag to.
- Account creation: the flag is cleared for every non-administrator creator, including one who holds it.
Administrators still set and propagate the flag.
Workarounds
None that keeps the propagation available to managers. Review the root-folder column (branch icon) of the Users page for accounts that hold `can_create_root_folder` without an administrator having granted it, and remove it where needed.
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-57ww-wx2c-hx7xLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
