CVE-2026-47727
8.6TriliumNext · Trilium
An improper template neutralization flaw in Trilium allows unauthenticated attackers to achieve remote code execution via malicious import archives.
Executive summary
Trilium versions prior to 0.104.0 are vulnerable to remote code execution due to improper template engine security, posing a critical risk to server integrity.
Vulnerability
This vulnerability involves the improper neutralization of special elements used in a template engine (CWE-1336) and code injection (CWE-94). The application fails to sanitize the shareTemplate relation during note imports, allowing an attacker to inject malicious EJS code that is subsequently executed by the server process when a shared note is accessed by an unauthenticated user.
Business impact
The successful exploitation of this vulnerability allows an unauthenticated attacker to execute arbitrary JavaScript with the privileges of the Node process running the Trilium server. This provides the attacker with full access to the underlying filesystem, network resources, and sensitive data, potentially leading to total system compromise and unauthorized data exfiltration. With a CVSS score of 8.6, this high-severity flaw represents an immediate threat to the confidentiality, integrity, and availability of the hosting environment.
Remediation
Immediate Action: Upgrade to version 0.104.0 or later immediately to apply the necessary security filters for imported archives.
Proactive Monitoring: Review web server and application logs for unusual requests directed at shared notes or suspicious patterns originating from external IP addresses.
Compensating Controls: Implement strict Web Application Firewall (WAF) rules to inspect incoming traffic for malicious import payloads and restrict public access to note-sharing features if the application is exposed to the internet.
Exploitation status
Public Exploit Available: No
Analyst recommendation
Given the potential for remote code execution and the lack of authentication required to trigger the payload, this vulnerability should be treated with high urgency. Administrators must prioritize patching their Trilium instances to version 0.104.0 to neutralize the code injection vector. In environments where immediate updates are not feasible, consider restricting public access to the application until the patch can be verified and deployed.