/

CVE-2026-53580

Severity:

HIGH RISK

(8.1)

Arbitrary File Read (CWE-73) in Trilium Image Fetcher

CVE-2026-53580

Analyzed

Vulnerability type

Category:

External File or Directory Handling

CWE:

CWE-73, CWE-400, CWE-552

Impact:

Arbitrary File Disclosure and Denial of Service

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Trilium's automatic image-download feature can treat local file URLs in note images as readable resources, allowing an authenticated user to disclose files accessible to the Trilium process. The same behavior may also enable uncontrolled memory consumption when the feature reads an effectively unbounded local source, potentially crashing the server.

Affected context

The issue occurs in Trilium deployments where automatic image downloading is enabled and note HTML is processed through the image-fetching workflow. It may be reachable through the web interface, ETAPI, web clipper, or note-import mechanisms when an authenticated session or valid ETAPI token can create or update notes containing image references.

Exploit preconditions

  • Attack surface: Note creation or modification flows that scan HTML image sources
  • Required access: An authenticated Trilium session or an ETAPI token
  • Trigger point: Saving or importing a note causes image sources to be fetched and stored as attachments
  • Why exploitation is possible: Local-file schemes remain accepted after sanitization, and the resulting paths are passed to filesystem-reading logic without sufficient path validation

Why this happens

The vulnerability results from trusting a user-controlled image source as though it were an external network resource while allowing local-file schemes to reach filesystem access code. Without restricting resource schemes and validating permitted paths, the application can read files available to its process and persist their contents as note attachments. This maps primarily to CWE-73: External Control of File Name or Path, with related consequences involving excessive resource consumption and exposure of files to unauthorized users.

Potential impact

  • An attacker may disclose sensitive files readable by the Trilium process.
  • Retrieved contents could expose credentials, configuration data, or application secrets.
  • The application may store unauthorized local data as note attachments.
  • An attacker could cause excessive memory allocation and crash the server process.
  • Repeated abuse could reduce availability for other users.

General mitigation guidance

Mitigation generally focuses on removing local filesystem access from user-controlled resource-fetching workflows.

Common defensive patterns include:

  • Allowing only explicitly required network schemes and rejecting local-file and device-oriented schemes by default.
  • Separating remote media retrieval from local filesystem APIs.
  • Enforcing strict URL parsing, canonicalization, destination validation, and bounded resource sizes.
  • Applying response-size, time, and memory limits to automatic downloads.
  • Restricting the Trilium process to the minimum filesystem permissions needed for operation.
  • Using isolated temporary storage and avoiding retention of fetched content unless it is authorized and validated.
  • Applying the vendor's security fix through the organization's normal supported update process.

How teams detect issues like this

Organizations can look for this vulnerability through:

  • Static analysis rules identifying user-controlled URLs passed to filesystem or generic resource-reading APIs.
  • Code review checks for local-file, device, loopback, and other non-network schemes accepted by media fetchers.
  • Tests confirming that sanitization and URL allowlists reject local resources before any I/O occurs.
  • Monitoring note-save, import, and ETAPI activity for unusual attachment creation, repeated fetch failures, or abnormal resource sizes.
  • Runtime alerts for unexpected access to sensitive filesystem locations and memory or process exhaustion.
  • Policy enforcement requiring bounded downloads and explicit scheme allowlists.

Automated application-security review tools may help identify unvalidated path and URL flows during development.

Sources

SourceLink
github.comgithub.com/TriliumNext/Trilium/commit/c417c901dfe45222c321fab1685f26730cc2068f
github.comgithub.com/TriliumNext/Trilium/security/advisories/GHSA-3gxr-j6g6-q75c

Frequently asked

questions

An authenticated user, or a party holding a valid ETAPI token, may be able to reach the vulnerable note-processing workflow. The account's ability to create or modify notes and the deployment's enabled features affect practical exposure.

Files readable by the Trilium process could be disclosed, including application data, configuration files, credentials, or other sensitive local content.

Reject local and device-oriented URL schemes before fetching, use a strict network-scheme allowlist, validate destinations, and enforce bounded download and memory limits.

Treat all note HTML and media URLs as untrusted input, keep filesystem permissions minimal, test every supported ingestion path, and monitor for unexpected local-resource access or abnormal attachment activity.

Find out what's already
exploitable in your codebase.