Trilium: RCE via `shareTemplate` relation missing `isDangerous` flag — Safe import bypass leading to EJS SSTI (Incomplete Fix of CVE-2026-45668)
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-47727
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 20:26 UTC · Revision 1
Source evidence
Trilium: RCE via `shareTemplate` relation missing `isDangerous` flag — Safe import bypass leading to EJS SSTI (Incomplete Fix of CVE-2026-45668)
core-osv · Original sourcePublished 27 Aug 2026, 16:51 UTC
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.
osv:CVE-2026-47727
Complete source record
{
"id": "7ca5d984088969a1191af974ec0f5b41cc0da2363bf50b1ba197dc24a2788e0f",
"url": "https://osv.dev/vulnerability/CVE-2026-47727",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Trilium: RCE via `shareTemplate` relation missing `isDangerous` flag — Safe import bypass leading to EJS SSTI (Incomplete Fix of CVE-2026-45668)",
"summary": "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.",
"evidence": "osv:CVE-2026-47727",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2026-47727",
"aliases": [
"CVE-2026-47727",
"GHSA-c26q-6pwv-wf25"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "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"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/triliumnext/trilium",
"type": "GIT",
"events": [
{
"introduced": "97860e205cd34d5ba2cfc47cbbf6f7e830c30855"
},
{
"fixed": "0db3d4403ab26de13d19a8739f014ee72b716239"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0.104.0"
},
{
"last_affected": "0.104.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"fixed": "0db3d4403ab26de13d19a8739f014ee72b716239"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"0.104.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-47727.json"
}
}
],
"modified": "2026-10-28T02:30:39.072266799Z",
"provider": "osv",
"references": [
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47727.json",
"https://github.com/TriliumNext/Trilium/security/advisories/GHSA-c26q-6pwv-wf25",
"https://nvd.nist.gov/vuln/detail/CVE-2026-47727",
"https://github.com/TriliumNext/Trilium/commit/0db3d4403ab26de13d19a8739f014ee72b716239"
],
"provider_metadata": {
"cwe_ids": [
"CWE-1336",
"CWE-94"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47727.json"
}
},
"related_cves": [
{
"value": "CVE-2026-47727",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 506662,
"published_at": "2026-08-27T16:51:35.09+00:00"
}