Trilium Notes: Stored XSS Leads to Unauthorized Remote Code Execution (RCE) via Unsanitized SVG Attachments
Key facts
- Attack vector
- Network
- Privileges required
- High
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Cross-site scripting, Code execution
- Confidentiality · integrity · availability
- Low · Low · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-79 and CWE-94.
Summary
Trilium Notes is a cross-platform, hierarchical note taking application focused on building large personal knowledge bases. Versions 0.102.1 and prior contain a critical security flaw where lack of SVG sanitization combined with a disabled Content Security Policy (CSP) and a publicly reachable backend execution API results in an unauthenticated Remote Code Execution (RCE). The vulnerability arises from an insecure-by-design architecture: Trilium serves SVG attachments with the image/svg+xml MIME type without any sanitization, and it explicitly disables Helmet's Content Security Policy middleware, removing the primary defense against script execution in served assets. Because the malicious SVG runs under the Same-Origin Policy, it can issue a fetch('/') to extract the csrfToken from the document body. With that token, it can send a signed request to /api/script/exec to execute arbitrary Node.js code on the server. An attacker can compromise the entire server instance simply by tricking an authenticated user into viewing a shared SVG attachment. The issue has been fixed in version 0.102.2.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| TriliumNext | Trilium | before 0.102.2 | 0.102.2 | Patch available | CNA |
- Trilium VendorTriliumNext Affected before 0.102.2 Fixed in 0.102.2 Patch available CNA
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:triliumnotes:trilium:*:*:*:*:*:*:*:* | — | — | TriliumNext |
- cpe:2.3:a:triliumnotes:trilium:*:*:*:*:*:*:*:* Versions — — ·TriliumNext
Remediation
- Fix · CNA Trilium (TriliumNext) Fixed in 0.102.2
Timeline
- 2026-10-02 Threatist record created from CVE-2026-39311
References
More TriliumNext vulnerabilities
- TI-2026-28300 Trilium Notes: Authentication Bypass in Clipper API for Electron (Desktop) Builds CVSS 3.1HIGH 8.6
- TI-2026-36250 Trilium: Malicious import with GeoMap marker title XSS leads to RCE on the desktop client CVSS 4.0CRITICAL 9.3
- TI-2026-33410 Trilium Notes : Note Import to RCE via #docName Path Traversal (Safe Import Enabled) CVSS 4.0CRITICAL 9.3
- TI-2026-38639 Trilium: Note Import to RCE via Mind Elixir dangerouslySetInnerHtml CVSS 4.0CRITICAL 9.3
- TI-2026-54012 Trilium unauthenticated share-search discloses password-protected and hidden shared notes CVSS 3.1HIGH 7.5
- TI-2026-35228 Code injection in TriliumNext Trilium CVSS 4.0HIGH 8.6
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences