Skip to content

Trilium

Trilium Notes: Stored XSS Leads to Unauthorized Remote Code Execution (RCE) via Unsanitized SVG Attachments

CVE-2026-39311Published 20 May 2026, 19:13 UTC

Real-world risk

0.2/ 10Low

Routine

PreliminaryFrom the CVSS vector only · confidence low

CVSS

6.8

scored by the vendor (CNA), CVSS 3.1

In plain words

No plain-language summary yet. The original description is below.

Original description (from GitHub_M)

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.

Am I affected?

ProductAffected versions (from the sources)Fixed in
TriliumNiche< 0.102.20.102.2

What to do

Update to a fixed version: 0.102.2.

Why this score

FactorValueEvidence×
ImpactDenial of serviceCrash or resource exhaustion onlyFrom the CVSS vector0.40
Attacker positionInternetAnyone on the Internet can reach a typical deploymentFrom the CVSS vector1.00
Privileges neededHighAdmin or equivalentFrom the CVSS vector0.20
Victim interactionRoutineA normal action: open a file, visit a page, click a linkFrom the CVSS vector0.70
ConfigurationDefaultOut-of-the-box installs are vulnerableFrom the CVSS vector1.00
ReliabilityHardNarrow race, needs an extra info leak, needs a man-in-the-middle position, or must be chained with another bugFrom the CVSS vector0.45

Threat level T3: Public proof of concept (× 0.95)

A qualifying GitHub proof of concept, an unverified Exploit-DB entry, CISA's SSVC says PoC, or a reference tagged as an exploit

  • Reference tagged as exploit (link)
  • CISA SSVC: proof of concept

EPSS 0.3% chance of exploitation in 30 days (percentile 23), as of 2026-12-03.

The arithmetic
  1. Prerequisites multiplied together0.063
  2. Threat T3: Public proof of concept0.950
  3. 10 × impact 0.4 × prerequisites 0.063 × threat 0.950.239
  4. Rounded to one decimal between 0.1 and 100.2

How the score works

Exploitation and evidence timeline

  1. 20 May 2026 Published
  2. 3 Dec 2026 Reference tagged as exploit first seen
  3. 3 Dec 2026 CISA SSVC: proof of concept first seen
  4. 3 Dec 2026 Risk 0.2 (cvss fallback)

Weakness

CWE-79, CWE-94

References

Get alerts for Trilium

Free email or text alerts when a vulnerability in Trilium reaches risk 8 or higher. Nothing else.