Skip to main content

Trilium Notes EUVDEUVD-2026-31173

| CVE-2026-39311 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-05-20 GitHub_M
6.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Upload malicious SVG attachment
  2. Delivery
    Generate public share link
  3. Exploit
    Phish authenticated user to open link
  4. Install
    Browser executes SVG JavaScript on Trilium origin
  5. C2
    Fetch CSRF token from document body
  6. Execute
    POST signed request to /api/script/exec
  7. Impact
    Execute arbitrary Node.js on server

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires an authenticated Trilium user to open the malicious SVG attachment in their browser while logged into the same Trilium instance - the SVG must be served as a top-level document from the application origin, not embedded via an img tag in a sanitized context. The attacker must have the ability to upload or place the SVG attachment within Trilium (the exact privilege level required for this step is not confirmed by the available data and conflicts with the PR:H CVSS rating versus the description's 'unauthenticated' claim - treat this as unresolved). The backend /api/script/exec endpoint must be reachable from the application origin, which is a default condition. Exploitation is limited by the requirement for user interaction (UI:R): the attack fails if no authenticated user views the SVG. The high attack complexity (AC:H) further limits exploitation by requiring the attacker to successfully social-engineer a specific authenticated user into clicking the share link.

Impact

The CVSS 3.1 base score of 6.8 with vector AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:H presents notable inconsistencies against the written description that security teams should verify before deprioritizing this finding. The description explicitly characterizes the vulnerability as enabling 'unauthenticated Remote Code Execution,' yet the CVSS vector encodes PR:H, indicating the scorer believed the attacker requires high-privilege credentials - this conflict is not explained in the available data and should be clarified with the vendor or by reviewing GHSA-p837-cxw3-m964 in detail. The AC:H designation may reflect the social engineering prerequisite (tricking an authenticated user to view the SVG), but it arguably understates ease of exploitation given that public SVG share links are a normal use case. Similarly, the impact subscores of C:L and I:L seem conservative for a vulnerability that reaches /api/script/exec and can execute arbitrary Node.js - full server compromise (C:H/I:H) is plausible; the A:H designation alone suggests the scorer acknowledged severe downstream impact. No EPSS score was available. No CISA KEV listing exists, indicating no confirmed mass exploitation. Despite the moderate CVSS score, the technical severity of the chained attack (XSS → CSRF exfiltration → server-side RCE) and the public advisory detail make this a high-priority patch for any Trilium instance with share functionality exposed to untrusted parties.

Exploit ScenarioDerived

An attacker crafts an SVG file containing embedded JavaScript that, when rendered by a browser as a top-level document from the Trilium origin, issues a fetch('/') request to extract the CSRF token from the DOM and then posts that token to /api/script/exec with a Node.js payload that, for example, spawns a reverse shell or exfiltrates server credentials. The attacker uploads this SVG as an attachment within a Trilium note, generates a public share link, and distributes it via phishing or embeds it in content the target user will visit while authenticated in the same browser. No public exploit code (POC) has been confirmed in the provided intelligence, but the GitHub security advisory provides sufficient technical detail to reconstruct the chain.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 20, 2026

Stored XSS-to-RCE chain in Trilium Notes versions 0.102.1 and prior allows a network attacker to execute arbitrary Node.js code on the server by tricking an authenticated user into viewing a malicious SVG attachment. The vulnerability exploits three compounding design flaws - unsanitized SVG serving with the image/svg+xml MIME type, a deliberately disabled Content Security Policy, and an unauthenticated-from-same-origin script execution endpoint at /api/script/exec - enabling full server compromise through a single user interaction. No public exploit code or CISA KEV listing has been identified at time of analysis, but the detailed disclosure in the GitHub security advisory provides a near-complete attack recipe; EPSS data was not available in the provided intelligence.

RemediationAI

Upgrade immediately to Trilium Notes v0.102.2, which the vendor release notes at https://github.com/TriliumNext/Trilium/releases/tag/v0.102.2 describe as containing 'important security fixes' and which specifically addresses SVG handling in share routes and the main API, re-enables content security controls, and hardens the Electron desktop application. The vendor strongly encourages updating before the next scheduled release. No workarounds that fully mitigate the chained attack are documented by the vendor. As a partial compensating control while patching, operators can restrict access to Trilium's share routes at the network or reverse-proxy layer - blocking unauthenticated external access to share URLs prevents untrusted parties from delivering the malicious SVG to authenticated users, though this does not protect against insider-threat scenarios where an internal attacker has upload access. Disabling the /api/script/exec endpoint is not straightforward without code changes and would break legitimate scripting functionality.

Affected VersionsENISA

Trilium < 0.102.2

Affected Packages

euvd trilium fix: 0.102.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Trilium Notes (cpe:2.3:a:triliumnext:trilium:*:*:*:*:*:*:*:*) is a Node.js-based hierarchical knowledge base application. The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation / Cross-site Scripting), specifically stored XSS via SVG attachments. When browsers fetch an SVG served with the Content-Type image/svg+xml as a top-level document - rather than as an embedded img element - they execute any embedded script tags. Trilium's backend serves SVG attachments with this MIME type without stripping JavaScript, and Helmet's CSP middleware is explicitly disabled in the application, removing the primary browser-side defense against inline script execution. Because the malicious SVG is served from the application's own origin, the Same-Origin Policy permits the embedded JavaScript to read the application's DOM (extracting a CSRF token from the page body) and issue credentialed fetch requests to backend API endpoints. The /api/script/exec endpoint accepts a CSRF-signed POST and executes arbitrary Node.js code server-side, completing the escalation from stored XSS to full server-side code execution.

Know when Trilium gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 6.8 MEDIUM
AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:H

Primary rating from Vendor (GitHub_M) · only source for this CVE.

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
High
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
High

Lifecycle Timeline

1
Patch available
May 20, 2026 - 20:02 EUVD

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.1%
Top 70% exploitable
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2025-68621 HIGH POC
7.4 Feb 06

Trilium Notes is an open-source, cross-platform hierarchical note taking application with focus on building large person

CVE-2022-2290 MEDIUM POC
6.1 Jul 03

Cross-site Scripting (XSS) - Reflected in GitHub repository zadam/trilium prior to 0.52.4, 0.53.1-beta. Rated medium sev

CVE-2023-3067 MEDIUM POC
5.4 Jun 02

Cross-site Scripting (XSS) - Stored in GitHub repository zadam/trilium prior to 0.59.4. Rated medium severity (CVSS 5.4)

CVE-2022-2365 MEDIUM POC
5.4 Jul 10

Cross-site Scripting (XSS) - Stored in GitHub repository zadam/trilium prior to 0.53.3. Rated medium severity (CVSS 5.4)

CVE-2026-53579 CRITICAL
9.3 Aug 27

Stored cross-site scripting escalating to remote code execution affects TriliumNext Trilium versions up to and including

CVE-2026-53578 CRITICAL
9.3 Aug 27

Stored cross-site scripting escalating to remote code execution affects TriliumNext Trilium through version 0.103.0, whe

CVE-2026-48996 CRITICAL
9.3 Aug 27

Stored cross-site scripting escalating to remote code execution affects TriliumNext Trilium through version 0.103.0, whe

CVE-2026-45668 CRITICAL
9.3 May 29

Remote code execution in TriliumNext Trilium Notes desktop client prior to 0.102.2 allows attackers to achieve arbitrary

CVE-2026-47727 HIGH
8.6 Aug 27

Remote code execution in Trilium versions prior to 0.104.0 is achievable by exploiting a bypass in the application's Saf

CVE-2026-39310 HIGH
8.6 May 20

Authentication bypass in Trilium Notes Desktop (Electron build) versions 0.102.1 and earlier allows remote unauthenticat

CVE-2026-53580 HIGH
8.1 Aug 27

Arbitrary local file disclosure and denial-of-service exist in Trilium's automatic image-download feature, affecting all

CVE-2026-77438 HIGH
7.5 Aug 27

Unauthenticated content exfiltration in Trilium up to 0.103.0 is possible through the public share-search endpoint, whic

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy