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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.6
- **CVSS:** 8.6 (v4.0, CNA) `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`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: None; Privileges required: None; User interaction: Active; Confidentiality impact: High; Integrity impact: High; Availability impact: High; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.73% (percentile 50, 2026-11-26)
- **CWE:** CWE-94, CWE-1336
- **Published:** 2026-08-27T16:51:35.090Z
- **Modified:** 2026-10-14T15:52:52.463Z

## Who should check

- Anyone running 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.

## Affected and fixed versions

- TriliumNext Trilium: 0.104.0 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-47727. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-47727.md
Affected: TriliumNext Trilium 0.104.0
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for TriliumNext Trilium: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-47727 being exploited?

There is no confirmed exploitation: CVE-2026-47727 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.73% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-47727?

High: CVSS 8.6 (v4.0, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2026-47727?

TriliumNext Trilium 0.104.0.

### Is there a fix for CVE-2026-47727?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-47727?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

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

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-47727>

HTML: <https://flawdb.com/CVE-2026-47727> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-47727>
