llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · nilsteampassnet/teampass

GHSA-47XG-W656-J4V4

Stored XSS in Item Login Field via #card-item-login .html()

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
8.7
Alta
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición87 dDesde la divulgación, 26 ago 2026, 12:17 a. m.
Detección85 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir de cerca
Monitorear y programar la remediación
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico total. No hay versión corregida: aplique mitigaciones.
Más vale un parche a tiempo que un incidente de madrugada.Ni alarma ni olvido: seguimiento.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
26 ago 26
19 nov 26
21 nov 26
26 ago 26
17 sept 26
8 oct 26
30 oct 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-47XG-W656-J4V4 divulgada · CVSS 8.7 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Stored XSS in Item Login Field via #card-item-login .html()

Summary

When a non-administrator user opens an item's detail view, the item's login
field is rendered with jQuery's .html() using the raw value returned by the
show_details_item endpoint. The login is persisted with the PHP filter
FILTER_SANITIZE_FULL_SPECIAL_CHARS, which only HTML-entity-encodes the value;
the client-side decode path (purifyData, invoked inside decodeQueryReturn)
decodes those entities back to live markup before the value reaches the sink.

A login value containing an <img onerror> payload therefore renders as
executable HTML in the login card of every non-administrator who opens the
item. The login field is not covered by the client-side special-character
regex that protects the tags field, and the server applies no AntiXSS
stripping to the login, so the payload is plantable entirely through the
normal item creation / edit form.

Adjacent fields in the same detail block are defended correctly: the label
uses htmlEncode(), and the email and url fields use .text(). The login field
was missed, leaving it as an inconsistent, unencoded .html() sink.

Cross-user reach: the show_details_item handler sets show_details = 0 (and
omits the login) only when the requesting user is an administrator opening a
non-personal item. Any non-administrator with read access to the folder
receives show_details = 1 and the raw login, so any colleague who opens the
poisoned item executes the payload.

Affected Version

TeamPass 3.1.7.6

The same sink is present in the current git branch 3.2.1.6
(app/pages/items.js.php renders the login via
$('#card-item-login').html(data.login)).

PoC

The PoC requires the two accounts used below:

administrator : admin / admin123!
non-admin : deleter / deleter123! (write access to the shared
folder "E2E Folder", id 9002)

------------------------------------------------------------------
Step 1 - Attacker plants the payload (browser: New Item form)
------------------------------------------------------------------
1. Open teampass and log in as the non-administrator
(deleter / deleter123!).
2. Open the Items page.
(If a "generate the keys database for your account" prompt appears,
dismiss it; it does not affect item creation or the login field, which
is not encrypted.)
3. In the left folder tree, select the shared folder "E2E Folder" (id 9002).
4. Click "New item".
5. In the new-item form, fill:
Label = xssE2E
Login = <img src=x onerror=document.body.dataset.xssLogin=1>
Password = (any value that satisfies the folder complexity policy)
Leave Tags empty and click Save.

The server stores the login HTML-entity-encoded only
(FILTER_SANITIZE_FULL_SPECIAL_CHARS in sources/items.queries.php, case
new_item); no AntiXSS stripping is applied, and no database operation or
crafted request was used -- the value was typed into the standard login
input:

stored login = &lt;img src=x onerror=document.body.dataset.xssLogin=1&gt;

------------------------------------------------------------------
Step 2 - Victim triggers the payload (browser: open item)
------------------------------------------------------------------
1. Log in as a non-administrator who can see folder 9002 (the same "deleter"
account, or any colleague with read access).
2. Open the Items page, dismiss the keys prompt, and select folder 9002.
3. Click the item row "xssE2E" to open its detail view.

The application's own Details handler calls the show_details_item endpoint
and renders the login with the real sink in pages/items.js.php:

$('#card-item-login').html(data.login);

decodeQueryReturn runs purifyData() on the value first, which decodes the
HTML entities back to a live <img onerror> element string; .html() then
parses it as live DOM, so the onerror handler executes.

Expected result (observed in the browser DOM only, no database access):
document.body.dataset.xssLogin === "1"
document.querySelector('#card-item-login').innerHTML
=== '<img src="x" onerror="document.body.dataset.xssLogin=1">'

A live <img> element is present in the login card, confirming execution
through the application's own rendering path.

Root Cause Analysis

  1. Storage (sources/items.queries.php, cases new_item / update_item):

$post_login = filter_var($dataReceived['login'],
FILTER_SANITIZE_FULL_SPECIAL_CHARS);

  1. Read path (sources/items.queries.php, case show_details_item):

$arrData['login'] = $dataItem['login'];

The show_details gate only suppresses the login for administrators
opening non-personal items; every non-administrator with folder access
receives it.

  1. Client decode (includes/js/functions.js, purifyData / decodeQueryReturn):
  1. Sink (pages/items.js.php):

$('#card-item-login').html(data.login);

No htmlEncode() / escapeHtml() / .text() is applied at the sink, so the
decoded markup executes.

The encoding sentinel tests/Unit/ClientHtmlEncodingSentinelTest.php is meant
to enforce encoding at every sink, but its regex only matches the literal
concatenation pattern 'string' + ident.field and is blind to the direct
form .html(ident) used here, so this sink was not caught.

The minimal fix is to render the login via .text() or htmlEncode() at this
sink, matching the label (htmlEncode) and url (.text) fields in the same
detail block. (Hardening the shared simplePurifier "img" bypass would
additionally neutralise every sink that relies on it.)

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:R
NingunaRequerida
AlcanceS:C
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
7.2/ 10Alto
Vector 7.2 (fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida
nilsteampassnet/teampass≤ 3.2.1.6
3.2.1.6
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistnilsteampassnet/teampass
Sin parche — — —
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/nilsteampassnet/TeamPass/security/advisories/GHSA-47xg-w656-j4v4

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.