CVE-2026-39311: Trilium Notes - Remote Code Execution
- Cve: CVE-2026-39311
- Name: Trilium Notes - Remote Code Execution
- Description: 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.
- Impact: Attackers can execute arbitrary code on the server, leading to full server compromise.
- Remediation: Update to version 0.102.2 or later.
- Vulnerability type: remote_code_execution
- Vulnerability impact: remote_code_execution
- Requirement type: user_interaction
- Requirements: Victim must view a malicious shared SVG attachment while authenticated.
- Labels source: projectdiscovery
- Severity: medium
- Cvss score: 6.8
- Cvss vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:H
- Epss score: 0.00288
- Epss percentile: 0.21378
- Assignee: [email protected]
- Published at: 2026-05-20T20:16:39Z
- Age in days: 188
- Modified at: 2026-07-23T12:10:00Z
- Patch available: yes
- References total: 2
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2026-39311
- Nvd status: deferred
- Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
- Not known: hackerone
Cwe
| Id | Name |
|---|---|
| CWE-79 | Improper Neutralization of Input During Web Page Generation |
References
| Url | Source | Tags |
|---|---|---|
| https://github.com/TriliumNext/Trilium/releases/tag/v0.102.2 | nvd | |
| https://github.com/TriliumNext/Trilium/security/advisories/GHSA-p837-cxw3-m964 | nvd |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| triliumnotes:trilium | < 0.102.2 | no | cna_alias_text | /v1/products/triliumnotes/trilium |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| TriliumNext/Trilium | releases, security_advisory | yes | /v1/repositories/TriliumNext/Trilium |
Index
- Checked, none or zero: repositories, repositories high signal, packages
Exploitation
- Remote: yes
- Authentication required: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports, exposed hosts