GHSA-JXJ9-MCX4-H34J
Any authenticated user can read the attachments of every shared item through the image preview handler
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-JXJ9-MCX4-H34J divulgada · CVSS 6.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The `image_preview_preparation` web handler returns the decrypted content of an item attachment. Its only check was that the caller holds a sharekey for the file. The attachments of a shared (non-personal) item are keyed for every user of the instance, whatever their folder rights, so any authenticated user could read any attachment of any shared item by its id.
Details
Paths under `app/sources/`, line numbers as of 3.2.4.0.
- `items.queries.php:7585-7664`: the handler checks the session key, looks up the caller's sharekey for the file (7599-7620), decrypts the file (7630-7640) and returns its name, type and content (7655-7663). It never checks the item's folder, the item restriction or the administrator exclusion, and it accepts any file type, not only images.
- A sharekey is not an authorization for shared items. On upload, every user with a public key, system accounts aside, receives one (`upload.attachments.php:464-481`), and the background fan-out does the same (`main.functions.php:7542-7553`). Removing a user's folder rights, or restricting the item, does not remove those keys.
- `downloadFile.php:266-270` serves the same files and does check access (`userHasAccessToFile()`, with the comment "even when a sharekey exists"). The preview handler was a second route to the same content without that check.
- File ids (`files.id`) are sequential integers.
Before 3.2.1.0, the attachments of personal items were keyed for every user as well. Those keys remain on instances where `app/scripts/remediate_personal_sharekeys.php` was never run, so such personal attachments were exposed too.
Proof of concept
As any authenticated user, including one who can open no folder: `POST sources/items.queries.php` with `type=image_preview_preparation`, `id=<N>`, `key=<own session key>`, for N = 1, 2, 3… Each response decodes to the base64 content, file name and MIME type of attachment N.
Impact
Any authenticated user reads every attachment of every shared item of the instance: certificates, key files, documents. No folder right is needed.
Patches
Fixed in 3.2.4.1: the handler requires read access to the attachment's item (`userHasAccessToFile()`, the check `downloadFile.php` applies) before decrypting it.
Workarounds
None short of upgrading. Administrators who still have personal items created before 3.2.1.0 should run `php app/scripts/remediate_personal_sharekeys.php --dry-run`, then `--execute` (see `docs/install/security-hardening.md`).
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.1 | — | — |
3.2.4.1Arsenal 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-jxj9-mcx4-h34jLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
