On this page
Atomicorp WAF Research Note: CVE-2026-39311
Trilium Notes: Stored XSS Leads to Unauthorized Remote Code Execution (RCE) via Unsanitized SVG Attachments
CVE Details
- Already protected by existing Atomicorp WAF rules
- Protection status: Understanding Atomicorp WAF Protection Status
- CVE: CVE-2026-39311
- Name: Trilium Notes: Stored XSS Leads to Unauthorized Remote Code Execution (RCE) via Unsanitized SVG Attachments
- Severity: Medium
- CVSS: 6.8 (v3.1) (Medium)
- CVSS version: 3.1
- CVSS source: GitHub_M CNA
- CVSS vector:
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:H- Attack vector: Network
- Attack complexity: High
- Privileges required: High
- User interaction: Required
- Scope: Changed
- Confidentiality impact: Low
- Integrity impact: Low
- Availability impact: High
- CWE: CWE-79 — Improper Neutralization of Input During Web Page Generation (‘Cross-site Scripting’), CWE-94 — Improper Control of Generation of Code (‘Code Injection’)
- Related CAPEC attack patterns (via MITRE CWE relationships): CAPEC-209 (opens in a new tab) , CAPEC-242 (opens in a new tab) , CAPEC-35 (opens in a new tab) , CAPEC-588 (opens in a new tab) , CAPEC-591 (opens in a new tab) , CAPEC-592 (opens in a new tab) , CAPEC-63 (opens in a new tab) , CAPEC-77 (opens in a new tab) , CAPEC-85 (opens in a new tab)
- Vendor: TriliumNext
- Vulnerable product: Trilium
- CVE published: 2026-05-20
- CVE last modified: 2026-07-23
- EPSS: 0.0029; 21.1th percentile (FIRST (opens in a new tab) )
- Latest Update: 2026-09-06
- Selected Rule IDs observed: 333140 , 333141 , 340095 , 340099 , 341099 , 342259 , 344363
- Matching rules: 7; rules with blocking actions: 7
- Would-block Rule IDs: 333140 , 333141 , 340095 , 340099 , 341099 , 342259 , 344363
- Request surfaces inspected: JSON request data, Request URI, Request argument names, Request arguments, Request cookies, Request headers, SOAP request data, XML request data
Vulnerability 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.
Recommended Actions
Maintain the observed Atomicorp protections. Keep your Atomicorp commercial rules current and confirm that the selected observed rules (333140 , 333141 , 340095 , 340099 , 341099 , 342259 , 344363 ) have not been locally disabled. Atomicorp commercial rules are enabled by default. If you use Atomic WAF, review the applicable policy and rule settings.
Apply the vendor’s remediation. WAF protection is defense in depth and does not replace upgrading or following the affected vendor’s guidance.
- Affected versions: TriliumNext Trilium version < 0.102.2.
- No specific CNA/vendor solution or workaround is included in the current CVE Record (opens in a new tab) . Review the vendor’s security advisories and supported-release guidance before making changes.
Validate after changes. Confirm rule updates are current, review WAF events for the affected application, and test application behavior after vendor upgrades, mitigations, or local policy changes.
Research Notes
Atomicorp WAF protections are designed around attack techniques and exploit behaviors, allowing existing protections to apply across multiple vulnerabilities without requiring a unique rule for every CVE.
Public Vulnerability References
- NVD (opens in a new tab)
- CVE Record (opens in a new tab)
- CVE authority reference: https://github.com/TriliumNext/Trilium/releases/tag/v0.102.2 (opens in a new tab)
- CVE authority reference: https://github.com/TriliumNext/Trilium/security/advisories/GHSA-p837-cxw3-m964 (opens in a new tab)
Test or Research Source
- Source: Atomicorp AI Research Framework
- Tags: cve, derived, waf-probe, xss
Research Note Context
This research note documents exploit-technique analysis associated with this vulnerability and references Atomicorp WAF protections observed during engineering review, testing, or validation activities.
Atomicorp security controls are generally designed to identify and mitigate attack techniques and exploit behaviors rather than individual CVE identifiers. As a result, protections developed for one vulnerability may also apply to related attack variants and future vulnerabilities using similar techniques.
Learn More
Atomicorp develops commercially supported security technologies for web applications, servers, endpoints, workloads, and legacy enterprise platforms.
Organizations interested in protecting systems against exploit techniques associated with vulnerabilities such as this one can learn more about:
- Atomic ModSecurity Rules: commercially maintained WAF rules for ModSecurity deployments, including protections for web attacks, bots, scanners, malware, exploitation attempts, and emerging vulnerability classes.
- Atomic WAF: an enterprise web application firewall with Atomicorp rules, centralized management, reporting, authentication controls, and operational tooling.
- Atomic ModSecurity Integrator: a special licensing option for MSPs, MSSPs, OEMs, VARs, reverse proxy providers, and other integrators who want to incorporate Atomicorp ModSecurity rule technology into their own products or services.
- Atomic OSSEC: an enterprise OSSEC-based intrusion detection, compliance, and security monitoring platform.
- Atomic Protector: workload protection for Linux, web, cloud, data center, and hybrid environments.
For additional information, product evaluations, or technical discussions, visit https://www.atomicorp.com/ or https://modsecurity.io/ (opens in a new tab) .