CVE-2026-39311: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in TriliumNext Trilium
Trilium Notes versions 0.102.1 and earlier contain a critical vulnerability due to lack of SVG sanitization combined with a disabled Content Security Policy and a publicly accessible backend API. This flaw allows an attacker to execute arbitrary Node.js code on the server by tricking an authenticated user into viewing a malicious SVG attachment. The vulnerability arises from serving SVGs without sanitization and disabling Helmet's CSP middleware, enabling script execution under the Same-Origin Policy. The issue is fixed in version 0.102.2.
AI Analysis
Technical Summary
CVE-2026-39311 affects Trilium Notes versions prior to 0.102.2. The vulnerability is caused by improper neutralization of input during web page generation (CWE-79) and insecure code execution (CWE-94). Trilium serves SVG attachments with the image/svg+xml MIME type without sanitization and disables the Content Security Policy middleware, allowing malicious SVGs to execute scripts in the context of the application. These scripts can extract CSRF tokens and send signed requests to the /api/script/exec endpoint, resulting in unauthenticated remote code execution on the server. This is due to an insecure-by-design architecture and a publicly reachable backend execution API. The vulnerability has been addressed in version 0.102.2.
Potential Impact
An attacker can achieve unauthenticated remote code execution on the Trilium server by leveraging a malicious SVG attachment viewed by an authenticated user. This can lead to full compromise of the server instance, including execution of arbitrary Node.js code. The CVSS score is 6.8 (medium severity), reflecting the complexity and required user interaction but significant impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade Trilium Notes to version 0.102.2 or later, where this vulnerability has been fixed. The fix addresses SVG sanitization and re-enables Content Security Policy protections. Until upgraded, avoid opening or sharing SVG attachments from untrusted sources. Patch status is confirmed fixed in version 0.102.2.
CVE-2026-39311: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in TriliumNext Trilium
Description
Trilium Notes versions 0.102.1 and earlier contain a critical vulnerability due to lack of SVG sanitization combined with a disabled Content Security Policy and a publicly accessible backend API. This flaw allows an attacker to execute arbitrary Node.js code on the server by tricking an authenticated user into viewing a malicious SVG attachment. The vulnerability arises from serving SVGs without sanitization and disabling Helmet's CSP middleware, enabling script execution under the Same-Origin Policy. The issue is fixed in version 0.102.2.
CVSS v3.1
Score 6.8medium
Affected software
pkg:github/triliumnext/TriliumRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-39311 affects Trilium Notes versions prior to 0.102.2. The vulnerability is caused by improper neutralization of input during web page generation (CWE-79) and insecure code execution (CWE-94). Trilium serves SVG attachments with the image/svg+xml MIME type without sanitization and disables the Content Security Policy middleware, allowing malicious SVGs to execute scripts in the context of the application. These scripts can extract CSRF tokens and send signed requests to the /api/script/exec endpoint, resulting in unauthenticated remote code execution on the server. This is due to an insecure-by-design architecture and a publicly reachable backend execution API. The vulnerability has been addressed in version 0.102.2.
Potential Impact
An attacker can achieve unauthenticated remote code execution on the Trilium server by leveraging a malicious SVG attachment viewed by an authenticated user. This can lead to full compromise of the server instance, including execution of arbitrary Node.js code. The CVSS score is 6.8 (medium severity), reflecting the complexity and required user interaction but significant impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade Trilium Notes to version 0.102.2 or later, where this vulnerability has been fixed. The fix addresses SVG sanitization and re-enables Content Security Policy protections. Until upgraded, avoid opening or sharing SVG attachments from untrusted sources. Patch status is confirmed fixed in version 0.102.2.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-06T19:31:07.265Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a0e0ccfba1db473629e776f
Added to database: 05/20/2026, 19:34:39 UTC
Last enriched: 05/27/2026, 21:02:59 UTC
Last updated: 07/04/2026, 04:20:04 UTC
Views: 63
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.