GHSA-J3PH-4847-695H
Managers can grant any role access to any folder, and edit, delete or AD-map any role
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-J3PH-4847-695H divulgada · CVSS 8.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The Roles page is open to managers and HR managers, who are meant to administer the roles
they hold or created, on the folders they can access. Its server-side handlers did not enforce
that scope. A manager could change the folder rights of any role — including granting their own
role read/write access to every shared folder — and rename, re-flag or delete any role. When the
LDAP AD group to role mapping is enabled, a manager could also map any AD group to any role,
an administrator-only setting.
Details
All handlers live in `roles.queries.php` and only checked the session key (and, for some, a
read-only flag that was compared with the wrong type):
- `change_access_right_on_folder` only required `roleId > 0`. Neither the role nor the submitted
- `change_role_definition` (actions `edit_role` / `edit_folder`) updated any role by id: title,
- `delete_role` deleted any role by id, with its folder rights, its user assignments and its item
- `get_list_of_groups_in_ldap` and `map_role_with_adgroup` had no administrator check, although
- `build_matrix` returned the folder rights of any role.
The read-only check compared `user-read_only === 1`, while some sign-in paths store the raw
database value (`'1'`): read-only accounts were not stopped by it.
Proof of concept
Signed in as a manager, on Roles (`index.php?page=roles`), in the browser console — the
session key is the one the page embeds in its own scripts:
$.post('sources/roles.queries.php', {
type: 'change_access_right_on_folder',
key: '<session key>',
data: prepareExchangedData(JSON.stringify({
roleId: <id of a role the manager holds>,
selectedFolders: [999999], // any id that is not a folder
access: 'W',
propagate: 1
}), 'encode', '<session key>')
})The request succeeds. At the next page load the manager's folder tree contains every
shared folder, and their items open. Replacing `roleId` with another role, `access` with `''`,
or calling `delete_role` with `{"roleId": <any role>}` works the same way.
Impact
Any account with the Manager or HR manager privilege can:
- read — and, with `W`, modify and delete — every item of every shared folder, by granting its
- remove the access of any role to its folders, or delete any role;
- change another role's complexity requirement or its "can edit any visible item" flag;
- with LDAP and the AD group mapping enabled, give any role to every member of an AD group.
Administrators are not concerned (they already hold these rights), nor are standard users: the
Roles page and its handlers are closed to them. Items in personal folders stay protected: their
keys are only shared with their owner.
Patches
Fixed in 3.2.3.0. The role handlers now only act on the roles the caller holds or created
(every role for an administrator), and on the folders the caller can access, personal and denied
folders excluded. A request naming a folder outside that scope is refused as a whole, and
propagation never leaves it. The AD group mapping is restricted to administrators, and read-only
accounts are refused consistently. The role list of the Roles page shows the same scope.
Workarounds
Until the upgrade:
- only give the Manager and HR manager privileges to accounts trusted with the whole vault;
- review the permission matrix of each role and the AD group mappings (**Roles → LDAP
```sql
SELECT v.role_id, v.folder_id, v.type
FROM teampass_roles_values AS v
LEFT JOIN teampass_nested_tree AS t ON t.id = v.folder_id
WHERE t.id IS NULL OR t.personal_folder = 1;
```
- if roles are not derived from AD groups, keep AD user roles mapped with their AD groups
References
- Release notes: https://github.com/nilsteampassnet/TeamPass/releases/tag/3.2.3.0
- Documentation: https://documentation.teampass.net/#/features/roles
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.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-j3ph-4847-695hLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
