GHSA-G797-4RH6-M2XP
Authorization Bypass Through User-Controlled Key
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-G797-4RH6-M2XP divulgada · CVSS 6.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The `copy_item` action in `items.queries.php` checks the source folder but not the destination folder. Any authenticated non-read-only user can copy an item they have access to into any folder in the instance, including administrator-restricted folders.
Details
The source folder is verified at line 2501:
if (in_array($originalRecord['id_tree'], $session->get('user-accessible_folders')) === false) {
// rejected
}The destination folder `$post_dest_id` is assigned at line 2566 without any equivalent check:
if ($key === 'id_tree') {
$aSet['id_tree'] = $post_dest_id; // no access check
}The `move_item` action in the same file correctly verifies both source (line 5748) and destination (line 5766) via `getCurrentAccessRights()`. The missing check in `copy_item` appears to be an oversight.
After the copy, `storeUsersShareKey()` at line 2592 generates sharekeys for all users of the destination folder, making the planted item visible and decryptable by those users.
PoC
Prerequisites: an authenticated account with write access to at least one shared folder. A second folder the user does not have access to (e.g. an admin-only folder) with a known ID.
- Open any item in an accessible folder and use the "Copy" function
- Intercept the POST request (Burp Suite or browser dev tools)
- In the encrypted payload, change `dest_id` to the ID of the restricted folder
- Forward the request
- Log in as an administrator the copied item appears in the restricted folder
The POST data is encrypted via `prepareExchangedData` with the session key, so reproducing this requires intercepting and modifying the request before encryption or replaying a crafted encrypted payload.
Impact
Any authenticated user with write access to at least one folder can plant items into folders they are not authorized to access, including admin-only folders.
When combined with GHSA-cpgh-9h3x-r8gm (stored XSS via URL field), this becomes a delivery mechanism for cross-privilege XSS: a low-privilege user creates an item with a malicious URL, copies it into an admin folder, and the payload executes when the admin views the item.
Suggested fix - add after line 2509:
if (in_array((int) $post_dest_id, $session->get('user-accessible_folders')) === false) {
echo (string) prepareExchangedData(
array(
'error' => true,
'message' => $lang->get('error_not_allowed_to_access_this_folder'),
),
'encode'
);
break;
}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 |
Sin parche | — | — | — |
Arsenal 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-g797-4rh6-m2xpLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
