llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/siyuan-note/siyuan/kernel

GHSA-6865-QJCF-286F

SiYuan: Unauthenticated Reflected XSS via SVG Injection in /api/icon/getDynamicIcon Endpoint

Parche disponible
Descargar PNG JSON
CVSS
—
critical
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versióncommit d68bd5a
Exposición260 dDesde la divulgación, 4 mar 2026, 4:45 p. m.
Detección257 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Monitoreo
Detectada
4 mar 26
2 abr 26
17 nov 26
20 nov 26
4 mar 26
9 may 26
13 jul 26
16 sept 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-6865-QJCF-286F divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

### Summary
An unauthenticated reflected XSS vulnerability exists in the dynamic icon API endpoint:

  • `GET /api/icon/getDynamicIcon`

When `type=8`, attacker-controlled `content` is embedded into SVG output without escaping. Because the endpoint is unauthenticated and returns `image/svg+xml`, a crafted URL can inject executable SVG/HTML event handlers (for example `onerror`) and run JavaScript in the SiYuan web origin.

This can be chained to perform authenticated API actions and exfiltrate sensitive data when a logged-in user opens the malicious link.

### Details
The issue is caused by unsafe output construction and incomplete sanitization:

  1. Endpoint is exposed without auth middleware
  2. Source: https://github.com/siyuan-note/siyuan/blob/master/kernel/api/router.go#L27-L37
  3. `GET /api/icon/getDynamicIcon` is registered in the unauthenticated section.
  1. User input is inserted into SVG via string formatting
  2. Source: https://github.com/siyuan-note/siyuan/blob/master/kernel/api/icon.go#L115-L175
  3. Source: https://github.com/siyuan-note/siyuan/blob/master/kernel/api/icon.go#L537-L585
  4. In `generateTypeEightSVG`, `%s` directly injects `content` into `<text>...</text>` without XML/HTML escaping.
  1. Sanitizer only removes `<script>` tags
  2. Source: https://github.com/siyuan-note/siyuan/blob/master/kernel/util/misc.go#L235-L281
  3. `RemoveScriptsInSVG` removes `<script>` nodes, but does not remove dangerous attributes (`onerror`, `onload`, etc.) or unsafe elements.

As a result, payloads such as `</text><image ... onerror=...><text>` survive and execute.

PoC

#### Minimal browser execution PoC
Open this URL in a browser:

GET /api/icon/getDynamicIcon?type=8&content=%3C%2Ftext%3E%3Cimage%20href%3Dx%20onerror%3Dalert(document.domain)%3E%3C%2Fimage%3E%3Ctext%3E

Example full URL:

http://127.0.0.1:6806/api/icon/getDynamicIcon?type=8&content=%3C%2Ftext%3E%3Cimage%20href%3Dx%20onerror%3Dalert(document.domain)%3E%3C%2Fimage%3E%3Ctext%3E

Expected result:

  • JavaScript executes (`alert(document.domain)`), confirming reflected XSS.

#### Authenticated impact demonstration
If a victim is authenticated in the same browser session, JavaScript running in origin can call privileged APIs and exfiltrate returned data.

### Impact
This is a reflected XSS in an unauthenticated endpoint, with realistic account/data compromise impact:

  • Arbitrary JavaScript execution in SiYuan web origin.
  • Authenticated action abuse via same-origin API calls.
  • Sensitive data exposure (notes/config/API responses) from victim context.
  • Potential chained server-impact actions depending on victim privileges and deployment mode.

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

Versiones

Rangos afectados

Afectada Corregida
github.com/siyuan-note/siyuan/kernel< 0.0.0-20260304034809-d68bd5a79391
0.0.0-20260304034809-d68bd5a79391
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Gogithub.com/siyuan-note/siyuan/kernel
Corregida commit d68bd5a — —
Versiones corregidascommit d68bd5a
Explotación

Arsenal público

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

Referencias
Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-29183
Otrahttps://github.com/siyuan-note/siyuan/security/advisories/GHSA-6865-qjcf-286f
Otrahttps://github.com/siyuan-note/siyuan/commit/d68bd5a79391742b3cb2e14d892bdd9997064927
Otrahttps://github.com/siyuan-note/siyuan

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