CVE-2026-54067
### Summary A CSS snippet body containing `</style>` breaks out of its surrounding `<style>` tag when `renderSnippet()` interpolates it via `insertAdjacentHTML`. A payload like `</style><img src=x onerror="...">` runs arbitrary JavaScript in the renderer. On Electron desktop builds the renderer runs with `nodeIntegration:true`, so `require('child_process')` is reachable from the injected handler and the XSS chains to host RCE. Snippets sync via the workspace repository, so an attacker with write access to any synced workspace plants the payload once and it fires on every device that pulls. The bug also bypasses the user's `enabledCSS` / `enabledJS` separation. A user who turned `enabledJS` off was making a deliberate call not to run untrusted JavaScript; the CSS path runs it anyway. ### Details Affected: - HEAD `96dfe0b` (v3.6.5, 2026-04-21) - Sink: `app/src/config/util/snippets.ts:32` - Source: `/api/snippet/getSnippet`, backed by `data/snippets/conf.json` - Default config: `EnabledCSS: true`, `EnabledJS: true` at `kernel/conf/snippet.go:26-27` - Electron config: `nodeIntegration:true`, `contextIsolation:false`, `webSecurity:false` on every `BrowserWindow` in `app/electron/main.js:307,408-411,1107-1110,1150-1153,1322` The write path stores raw content. `kernel/api/snippet.go:107-130` copies `Content` from the request straight into the snippet record with no HTML escape, no `</style>` check, no type-specific validation: ```go snippet := &conf.Snippet{ ID: m["id"].(string), Name: m["name"].(string), Type: m["type"].(string), Content: m["content"].(string), Enabled: m["enabled"].(bool), } ``` Storage is workspace-internal and syncs. `kernel/model/repository.go:1748,1798` reference `data/snippets/conf.json`, so the malicious record propagates to every sync peer. The renderer reads the snippet back through `/api/snippet/getSnippet` and interpolates it into a `<style>` tag, raw. `app/src/config/util/snippets.ts:32`, called on app b
Properties
- severity
- critical
- summary
- SiYuan: Stored XSS to RCE via CSS-snippet <style> breakout in renderSnippet()
- epss_score
- 0.00541
- cvss_score
- 9.9
- ghsa_published
- 2026-07-10T19:25:09Z
- source_url
- https://github.com/advisories/GHSA-mvjr-vv3c-w4qv
- ghsa_updated
- 2026-07-10T19:25:10Z
- ghsa_id
- GHSA-mvjr-vv3c-w4qv
- cve_id
- CVE-2026-54067
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- is_ghsa_only
- false
- epss_percentile
- 0.43033
Related Entities (6)
ENRICHED_BY (1)
REPORTED_BY (1)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (2)
Explore deeper with Ninja Signal's threat intelligence graph