GHSA-5MFF-6G7V-9V6V
The Items folder list returns the title and path of any folder id, including folders the caller has no right on
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-5MFF-6G7V-9V6V divulgada · CVSS 4.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The Items page lists a folder through the `do_items_list_in_folder` action of `app/sources/items.queries.php`. When the caller may not open the requested folder, the action answers `not_authorized`, but it still returned the folder's full path (`arborescence`): the title of the folder and of each of its ancestors. It did so for any folder id. A signed-in user could send the ids one by one and read the title and path of every folder of the instance:
- folders on branches they have no right on;
- folders explicitly forbidden to them;
- the subfolders of other users' personal trees.
The report pointed at the Folder column of item search. That column only shows ancestors that the Items tree already shows by design (see "Scope of the original report" below). Following it up led to this handler, which leaks far more.
Details
Paths and line numbers are those of 3.2.4.1 (the file is identical on the development branch).
- `public/sources/items.queries.php` loads `app/sources/items.queries.php`. The case `do_items_list_in_folder` (`:4736`) checks the session key (`:4738`) and that the caller holds at least one role (`:4749`). Nothing else runs before the path is built.
- On the first page (`start = 0`), `:4799` calls `$tree->getPath($id, true)`. `:4800-4815` turns the result into `$arr_arbo`: id, title, visibility flag and icon of the requested folder and of every ancestor. `NestedTree::getPath()` applies no rights.
- `:4822` finds the folder outside `user-accessible_folders`. `:4823-4829` still answers `['error' => 'not_authorized', 'arborescence' => $arr_arbo]`, encrypted with the caller's own session key.
- The path only needs to go back for one kind of folder. The Items tree (`app/sources/tree.php`) displays a folder only when the folder itself or one of its descendants is in the user's scope (`:377-399`). A displayed folder outside the scope appears greyed out with its title (`show_but_block`, `:596-608`), so the user can walk down to the folder below it. The code comment above the path says the same, but no check limited the answer to that case.
- Folder ids are sequential integers, and an unknown id returns an empty path, so enumeration takes no guessing.
Personal trees. A personal tree's root folder is named after its owner's numeric user id. The handler only renames the caller's own root (`:4802`). For another user's personal folder, the path therefore reveals the owner's user id followed by the real subfolder titles.
Affected versions. The path has been returned with `not_authorized` since 3.0.0.0 (`sources/items.queries.php`, case `do_items_list_in_folder`).
Scope of the original report
Item search (`search.queries.php`, `find.queries.php`), favourites and the quick-access panel show the cached `cache.folder` breadcrumb. They only return items in folders of the caller's scope, so that breadcrumb is always the path to a folder the caller can open. Its ancestors are exactly the folders the caller already sees elsewhere:
- the Items tree shows them with their real title, a red cross and a "No access" tooltip;
- `do_items_list_in_folder` shows them in the breadcrumb when the caller opens the folder;
- the API `folder/listFolders` returns them with `isVisible: false`.
This holds whether "Hide inaccessible folders" is on or off: that setting only removes the branches that lead to nothing accessible. In the reported scenario, Bob sees `Alice-Secret-HR-Folder` in his tree as soon as he signs in, before any search. Showing those ancestor titles is the intended navigation model, and it is unchanged.
Proof of concept
- As an administrator, create the root folders `HR-Restricted` and `Finance`. Give a role Write on `Finance` only, and assign that role to a non-admin user `bob`.
- Sign in as `bob`. The tree shows `Finance` only.
- On the Items page, run in the browser console:
```js
const k = store.get('teampassUser').sessionKey
for (let id = 1; id <= 100; id++) {
$.post('sources/items.queries.php', {
type: 'do_items_list_in_folder',
data: prepareExchangedData(JSON.stringify({id: id, restricted: '', start: 0, nb_items_to_display_once: 10}), 'encode', k),
key: k
}, r => {
const d = decodeQueryReturn(r, k)
if (d.error === 'not_authorized' && d.arborescence.length > 0) {
console.log(id, d.arborescence.map(e => e.title).join(' / '))
}
})
}
```
- Every folder `bob` may not open is printed with its full path: `HR-Restricted`, its subfolders, and `<user id> / <subfolder>` for each personal tree.
Impact
Any authenticated user, read-only accounts included, can read the name and position of every folder of the instance. No item, password or folder content is disclosed, and nothing can be modified. Folder names often carry information of their own: customers, projects, departments, systems, or the structure of colleagues' personal trees.
Patches
Fixed in 3.2.4.2. A folder outside the caller's scope now keeps its path only when a folder of the caller's scope lies below it, which is exactly the folder the tree shows greyed out. Any other folder id gets `not_authorized` with an empty path. The scope is the same as for item access: accessible folders and the caller's own personal folders, minus explicit denials and other users' personal folders. The unit test `tests/Unit/ItemsListFolderPathDisclosureTest.php` covers the scope and the handler.
Workarounds
None by configuration. Until the upgrade, keep confidential information out of folder titles.
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-5mff-6g7v-9v6vLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
