/

CVE-2026-45733

Severity:

HIGH RISK

(8.3)

Stored XSS (CWE-79) in Trilium Notes Search Interface

CVE-2026-45733

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79, CWE-83, CWE-693

Impact:

Remote Code Execution through Stored XSS in a Privileged Electron Context

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Trilium Notes contains a stored cross-site scripting vulnerability in search and note-autocomplete interfaces that insert a note icon value into an HTML class attribute without adequate encoding. When a victim opens a new tab or uses the Ctrl+J shortcut, stored content may execute in the Electron application context and could allow operating-system command execution as the victim.

Affected context

The issue occurs in Trilium Notes versions before the security fix when the #iconClass label value is retrieved and rendered by the quick-search or note-autocomplete interfaces. Risk is higher when an attacker can create or modify notes or labels and when the application runs with Node.js integration enabled and context isolation disabled, allowing renderer-side script execution to access operating-system capabilities.

Exploit preconditions

  • Attack surface: The desktop application's quick-search and note-autocomplete rendering paths
  • Required access: Ability to create or modify stored note or label content that is later viewed by another user
  • Trigger point: The victim opens a new tab or invokes the Ctrl+J search interface
  • Why exploitation is possible: A stored label value is inserted into an HTML class attribute without sufficient attribute encoding, and the Electron renderer has elevated integration capabilities

Why this happens

The underlying bug is context-insensitive output handling: a value returned from getNoteIcon() is treated as trusted markup when inserted into an HTML attribute. This permits stored data to alter the rendered document and execute script, mapping primarily to CWE-79: Improper Neutralization of Input During Web Page Generation. The related CWE-83 and CWE-693 classifications reflect unsafe script-related HTML handling and insufficient defensive controls in the rendering environment.

Potential impact

  • A malicious stored value may execute script when a vulnerable interface is opened.
  • An attacker could act with the victim's application privileges.
  • Operating-system commands could be executed as the victim where Electron integration permits it.
  • Local notes, application data, or connected services could be accessed or modified.
  • The application environment could be used as a stepping stone for further compromise.

General mitigation guidance

Mitigation generally focuses on treating all note, label, and metadata values as untrusted before rendering them.

Common defensive patterns include:

  • Apply context-appropriate HTML attribute encoding at every rendering sink.
  • Prefer DOM APIs that assign data as text or attributes rather than concatenating markup.
  • Validate icon-class values against a narrow allowlist of permitted class names.
  • Reduce renderer privileges by disabling Node.js integration and enabling context isolation where compatible.
  • Expose only narrowly scoped, least-privilege functionality through secure preload bridges.
  • Apply a restrictive content security policy and avoid inline script execution.
  • Limit which users or synchronization sources can create stored metadata.

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying string interpolation or concatenation into HTML attributes.
  • Code review checks for raw values returned from note metadata, labels, or search results.
  • Tests that render special-character and markup-like values in every search and autocomplete view.
  • Policy enforcement requiring contextual output encoding and safe DOM APIs.
  • Electron configuration checks for Node.js integration, disabled context isolation, and broad preload exposure.
  • Runtime monitoring for unexpected renderer process behavior or child-process creation.

Automated security review tools can help identify likely DOM XSS sinks, but findings should be confirmed against the actual rendering context and Electron security configuration.

Sources

SourceLink
github.comgithub.com/TriliumNext/Trilium/commit/c06939448bcc2879fc3c4d328ff7dc63ed6b5009
github.comgithub.com/TriliumNext/Trilium/releases/tag/v0.103.0
github.comgithub.com/TriliumNext/Trilium/security/advisories/GHSA-h45q-4qc4-8hhg

Frequently asked

questions

Exploitation depends on how note content is created or synchronized. An attacker generally needs a way to place or modify stored metadata that a victim's desktop application later renders.

Yes. The vulnerable rendering path must be reached, such as by opening a new tab or using the Ctrl+J search interface.

The impact is increased when Electron exposes Node.js integration to the renderer and context isolation is disabled. In that configuration, script running in the renderer may reach capabilities beyond those normally available to web content.

Encode values for the exact HTML context or assign them through safe DOM APIs, validate icon values with an allowlist, and reduce Electron renderer privileges through isolation and least-privilege bridges.

Find out what's already
exploitable in your codebase.