A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-39311

CVE-2026-39311: Trilium Notes RCE Vulnerability

CVE-2026-39311 is a remote code execution flaw in Trilium Notes caused by unsanitized SVG rendering and disabled CSP. Attackers can execute arbitrary code by tricking users into viewing malicious attachments. This article covers technical details, affected versions, impact, and mitigation.

Published: May 21, 2026

CVE-2026-39311 Overview

Trilium Notes is a cross-platform, hierarchical note-taking application used to build personal knowledge bases. Versions 0.102.1 and prior contain an unauthenticated Remote Code Execution (RCE) flaw triggered through a malicious SVG attachment. The application serves SVG files with the image/svg+xml MIME type without sanitization and explicitly disables Helmet's Content Security Policy (CSP) middleware. A crafted SVG executes under the Same-Origin Policy, extracts the csrfToken from the document body, and submits a signed request to /api/script/exec to run arbitrary Node.js code on the server. The issue is fixed in version 0.102.2.

Critical Impact

An attacker can fully compromise a Trilium server instance by tricking an authenticated user into viewing a shared SVG attachment, gaining arbitrary Node.js code execution.

Affected Products

  • TriliumNext Trilium Notes versions 0.102.1 and earlier
  • Trilium server deployments serving user-supplied SVG attachments
  • Multi-user Trilium instances where attachments can be shared between accounts

Discovery Timeline

  • 2026-05-20 - CVE-2026-39311 published to NVD
  • 2026-05-20 - Last updated in NVD database

Technical Details for CVE-2026-39311

Vulnerability Analysis

The flaw is an insecure-by-design composition of three weaknesses that, combined, yield unauthenticated RCE. Trilium serves user-supplied SVG attachments with the image/svg+xml content type and performs no sanitization of embedded <script> elements or event handlers. The server also disables Helmet's CSP middleware, removing the primary browser-side defense against inline script execution in served assets. Finally, the backend exposes a /api/script/exec endpoint that accepts arbitrary Node.js code when called with a valid CSRF token. This combination is classified as Cross-site Scripting [CWE-79] but escalates to server-side code execution.

Root Cause

The root cause is the lack of SVG sanitization at the attachment-serving layer paired with the explicit disabling of Helmet's contentSecurityPolicy middleware. SVG files are XML documents that browsers parse and execute as active content when served with the image/svg+xml MIME type. Without CSP or sanitization, embedded JavaScript runs with the privileges of the Trilium origin.

Attack Vector

An attacker uploads a malicious SVG containing JavaScript and shares it with a target user. When the victim views the attachment, the script runs under Trilium's Same-Origin Policy context. The script issues fetch('/') to retrieve the page body and parses out the csrfToken. It then posts that token to /api/script/exec, which accepts and runs arbitrary Node.js code on the server. The result is full server compromise tied to the authenticated victim's session.

No verified public exploit code is available. See the GitHub Security Advisory GHSA-p837-cxw3-m964 for technical details.

Detection Methods for CVE-2026-39311

Indicators of Compromise

  • SVG attachments in the Trilium attachment store containing <script> tags, onload, or onerror handlers
  • HTTP POST requests to /api/script/exec originating from browser sessions that previously fetched an SVG attachment
  • Unexpected child processes spawned by the Trilium Node.js process, such as shells, package managers, or network utilities
  • Outbound network connections from the Trilium server to unfamiliar hosts following SVG attachment access

Detection Strategies

  • Inspect stored attachments for SVG files containing executable content prior to user access
  • Correlate image/svg+xml GET requests with subsequent /api/script/exec POSTs from the same client session
  • Monitor the Trilium application logs for script-execution API calls outside of expected administrative workflows
  • Apply file-content scanning rules that flag SVG attachments with embedded JavaScript on upload

Monitoring Recommendations

  • Alert on any invocation of /api/script/exec, treating it as a high-privilege administrative action
  • Track process lineage from the Trilium service to identify execution of sh, bash, node, or other interpreters spawned post-exploitation
  • Capture and retain web server access logs that include attachment MIME types and referer chains for forensic review

How to Mitigate CVE-2026-39311

Immediate Actions Required

  • Upgrade Trilium Notes to version 0.102.2 or later, which contains the official fix
  • Restrict access to Trilium instances to trusted networks until the patch is applied
  • Audit existing attachments for malicious SVG files and remove any with embedded scripts
  • Rotate session secrets and CSRF tokens after upgrading if compromise is suspected

Patch Information

The maintainers released the fix in Trilium v0.102.2. The patch sanitizes SVG attachments and addresses the missing CSP protections. Administrators should review the GitHub Security Advisory GHSA-p837-cxw3-m964 for the complete remediation notes.

Workarounds

  • Block uploads of files with the .svg extension or image/svg+xml MIME type at a reverse proxy until the upgrade is complete
  • Enforce a strict Content Security Policy at the reverse proxy layer that disallows inline script execution for served attachments
  • Serve attachments with Content-Disposition: attachment to force download rather than inline rendering
  • Limit Trilium to single-user deployments where attachment sharing between accounts is not possible
bash
# Example nginx workaround: block SVG attachment delivery until patched
location ~* \.svg$ {
    return 403;
}

# Force download instead of inline render for attachments
location /api/attachments/ {
    add_header Content-Disposition "attachment" always;
    add_header Content-Security-Policy "default-src 'none'; sandbox" always;
    proxy_pass http://trilium_backend;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechTrilium Notes

  • SeverityMEDIUM

  • CVSS Score6.8

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityLow
  • AvailabilityHigh
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Release v0.102.2

  • GitHub Security Advisory GHSA-p837-cxw3-m964
  • Related CVEs
  • CVE-2026-39310: Trilium Notes Auth Bypass Vulnerability

  • CVE-2026-39309: Trilium Notes Auth Bypass Vulnerability

  • CVE-2026-35593: Trilium Notes Path Traversal Vulnerability

  • CVE-2025-68621: Trilium Notes Auth Bypass Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English