GHSA-9G8H-6QG5-CMHX
Stored cross-site scripting through item labels, folder titles and directory attributes
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-9G8H-6QG5-CMHX divulgada · CVSS 8.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Several screens build their markup by concatenating user-controlled values into HTML strings and inserting the
result with jQuery `.html()`. A user who can create an item or a folder — or who controls a display name in a
connected LDAP/Entra directory — can store a value that executes JavaScript in the browser of another user who later
opens the affected screen, including an administrator.
Details
The client-side helper `purifyData()`, which every AJAX response passes through, returns plain, unescaped text:
`simplePurifier()` strips tags but decodes HTML entities twice — once through an explicit replacement chain, once
through the `innerHTML` → `textContent` round-trip it uses to flatten the sanitized output. Values that the server
correctly stored escaped therefore arrive at the rendering code as live characters, and the affected screens
interpolate them without re-encoding.
Three sinks are reachable:
1. Search results panel — `app/pages/search.js.php`
The item label is placed in an attribute without encoding:
data-label="' + data.label + '"A double quote is enough, because the entity the server stores is decoded on the way back:
typed as an item label : boom" onmouseover="alert(1)
stored in the database : boom" onmouseover="alert(1)
after purifyData() : boom" onmouseover="alert(1)
rendered : data-label="boom" onmouseover="alert(1)"Triggered when any user expands that item in the search results.
2. Role permission matrix — `app/pages/roles.js.php`
Folder titles, folder paths and role names are concatenated into the table markup. Here the value reaches a text
context, so it takes one additional encoding layer — which the server's own escaping supplies:
typed as a folder title : <img src=x onerror=alert(1)>
stored in the database : &lt;img src=x onerror=alert(1)&gt;
after purifyData() : <img src=x onerror=alert(1)>Triggered when an administrator or a manager opens the role matrix.
3. LDAP and OAuth2 user synchronisation screens — `app/pages/users.js.php`
Logins, display names, mail addresses and group names are taken straight from the directory and written into
`data-user-*` and `title` attributes. These values are never stored by TeamPass, so no server-side escaping applies
at all; `purifyData()` removes tags but preserves quotes, which is sufficient to break out of the attribute. The
`title` attribute additionally carries `data-html="true"`, so its content is rendered as HTML by the tooltip.
Triggered when an administrator opens the directory synchronisation screen.
Impact
Arbitrary JavaScript execution in the session of another authenticated user, in most cases an administrator or a
manager, on the origin serving the vault. Within that session an attacker can reach the AJAX endpoints with the
victim's privileges, read secrets rendered in the page, and perform user- and vault-management actions. Scope is
marked *changed* because the code executes in a browser context that is not the vulnerable component itself.
Exploitation requires an authenticated account holding creation rights on a folder (sinks 1 and 2), or control over
an account name in a directory synchronised with TeamPass (sink 3), and requires the victim to open the affected
screen.
Patches
Fixed in 3.2.1.6. Every user-controlled value interpolated into markup on these screens is now encoded at the
point of insertion. A regression test (`tests/Unit/ClientHtmlEncodingSentinelTest.php`) enforces the rule across the
front-end sources so that a new screen cannot reintroduce the pattern.
The upgrade also normalises identity fields and folder titles already stored unescaped by earlier releases; this
runs automatically as part of the standard upgrade procedure.
Workarounds
None. Restricting item and folder creation, and reviewing directory display names, reduces exposure but does not
remove it. Upgrading to 3.2.1.6 is the only fix.
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-9g8h-6qg5-cmhxLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
