# CVE-2026-47727: Trilium shareTemplate template injection leads to remote code execution

Source: https://junglewise.ai/threats/cve-2026-47727-trilium-sharetemplate-template-injection-leads-to-remote-code  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-27. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-47727 · Severity: info · CVSS 9 · Published 2026-08-27

Trilium is an open-source note-taking application that allows users to import note archives and publish notes for sharing. A flaw in the default-enabled "Safe import" filter allows attackers to bypass code-execution safeguards by importing a malicious archive. When a victim publishes an imported note via the share feature, the attacker's JavaScript executes on the server with full system access, enabling complete system compromise.

## Quick answers

**Is CVE-2026-47727 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-47727 being exploited in the wild.

**How severe is CVE-2026-47727?** Informational severity, with a CVSS score of 9, published 27 August 2026.

**Which products and versions are affected?** Trilium Trilium <0.104.0.

**Is there a fix for CVE-2026-47727?** A patch was published on 2026-08-27: Version 0.104.0 released Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-47727 attacked?** It is attacked over the network, in a web application.

**Am I affected by CVE-2026-47727?** Check whether anything you run is named in the advisory. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability is a server-side template injection (SSTI) in EJS templating caused by incomplete hardening of dangerous attributes. The shareTemplate relation was not marked isDangerous in BUILTIN_ATTRIBUTES, so the default-on "Safe import" filter failed to neutralize it during import by prefixing disabled:. An attacker can craft a ZIP archive containing a note with a shareTemplate relation pointing to an EJS code note filled with arbitrary JavaScript. When the victim publishes the imported note via the /share/ endpoint, the public-share renderer invokes ejs.render() on the attacker-supplied template without sandboxing, executing code with full access to require, process, filesystem, and network. No authentication is required for the RCE trigger (unauthenticated GET /share/). The fix in version 0.104.0 adds isDangerous: true to the shareTemplate relation definition.

## Affected products

- Trilium Trilium <0.104.0

## Timeline

- 2026-08-27: disclosed
- 2026-08-27: patched: Version 0.104.0 released

## References

- [https://github.com/TriliumNext/Trilium/commit/0db3d4403ab26de13d19a8739f014ee72b716239](https://github.com/TriliumNext/Trilium/commit/0db3d4403ab26de13d19a8739f014ee72b716239)
- [https://github.com/TriliumNext/Trilium/security/advisories/GHSA-c26q-6pwv-wf25](https://github.com/TriliumNext/Trilium/security/advisories/GHSA-c26q-6pwv-wf25)
