# 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: High 8.6 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.50%, higher than 44% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-08-27T16:51:35.090Z
- Modified: 2026-10-14T15:52:52.463Z
- Weaknesses: CWE-94, CWE-1336
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- TriliumNext Trilium: 0.104.0
- triliumnotes trilium: before 0.104.0

## Every score

- GitHub_M: CVSS:4.0 8.6 High `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`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/TriliumNext/Trilium/security/advisories/GHSA-c26q-6pwv-wf25> (exploit, vendor-advisory)
- <https://github.com/TriliumNext/Trilium/commit/0db3d4403ab26de13d19a8739f014ee72b716239> (patch)

## Sources

- CVE List: [CVE-2026-47727](https://www.cve.org/CVERecord?id=CVE-2026-47727), CVE Terms of Use, modified 2026-09-01
- NVD: [CVE-2026-47727](https://nvd.nist.gov/vuln/detail/CVE-2026-47727), Public domain, modified 2026-10-14

---

Page: https://cve.day/CVE-2026-47727 · Whole record: https://cve.day/CVE-2026-47727.json · Rebuilt by cve.day 2026-11-25T22:59:35.527Z
