/

CVE-2026-32938

Severity:

CRITICAL RISK

(9.9)

Path Traversal and Information Disclosure in SiYuan Desktop

CVE-2026-32938

Analyzed

Vulnerability type

Category:

Path Traversal and Information Disclosure

CWE:

CWE-22, CWE-200, CWE-284

Impact:

Arbitrary Local File Read / Sensitive Data Exfiltration

Severity:

CRITICAL RISK

(9.9)

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

SiYuan desktop up to version 3.6.0 exposes a critical file exfiltration issue where HTML paste handling copies local files referenced by file:// URLs into the workspace assets directory without proper path validation.

When combined with an authenticated /assets/*path endpoint, a publish-service visitor can cause the desktop kernel to copy and then download arbitrary readable files from the host system, potentially leaking highly sensitive data.

Affected context

This vulnerability arises in SiYuan desktop deployments that:

  • Use the publish service to expose content to visitors
  • Run a desktop kernel that processes pasted HTML via /api/lute/html2BlockDOM
  • Allow the kernel process to access local files on the host file system

In these conditions, file:// links in pasted HTML can reference arbitrary files readable by the kernel's OS user account, which are then mirrored into the workspace assets directory and exposed over HTTP.

Exploit preconditions

  • Attack surface: Network-accessible publish service and the local desktop kernel.
  • Required access: Ability to act as an authenticated visitor to the publish service (or equivalent level of authenticated access to /assets/*path), and to submit or influence HTML content processed by /api/lute/html2BlockDOM.
  • Trigger point: Submission of HTML containing file:// links that the desktop kernel processes; the kernel copies the referenced local files into the workspace assets directory.
  • Why exploitation is possible: The paste-processing endpoint copies local files pointed to by file:// URLs into a web-accessible assets directory without validating paths against a sensitive-path list or enforcing robust path restrictions, while the /assets/*path endpoint serves those files to any authenticated visitor.

Why this happens

The issue stems from treating file paths derived from externally influenced HTML content as trusted, and automatically copying the referenced local files into a directory served over HTTP.

This behavior maps to:

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because the application fails to constrain which local files may be accessed through file:// references.
  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, since arbitrary host files become available to remote visitors.
  • CWE-284: Improper Access Control, as access checks on /assets/*path do not distinguish between benign workspace assets and sensitive host files mirrored into that directory.

Conceptually, this is an insecure coupling between a local file access feature and a web-exposed file-serving endpoint without a strong trust boundary or sensitive-path protection.

Potential impact

  • Exfiltration of sensitive operating system files (e.g., configuration files, logs) readable by the SiYuan desktop process.
  • Exposure of user-specific secrets stored on disk, such as SSH keys, API tokens, or application configuration files, depending on file permissions.
  • Leakage of proprietary documents, notes, or other private content on the host machine.
  • Expansion of an attacker's foothold through harvested credentials or configuration secrets used to access other systems.

General mitigation guidance

Effective mitigation focuses on decoupling local file access from web exposure and enforcing strict path controls:

  • Introduce a strict allowlist of directories and file types that the paste-processing logic may access and copy; treat any other paths as untrusted and reject them.
  • Implement a sensitive-path denylist for well-known locations such as user home secrets, SSH directories, system configuration paths, and application credential stores.
  • Normalize and canonicalize file paths before use, then enforce that they remain within a designated safe root (e.g., a dedicated media/import directory) rather than arbitrary host paths.
  • Ensure that the assets-serving endpoint is restricted to files that were explicitly created as workspace assets and not arbitrary files copied from the host filesystem.
  • Apply the principle of least privilege to the desktop kernel process so that it has minimal file-system permissions and cannot read highly sensitive directories by default.

How teams detect issues like this

Detection can leverage both code-level and behavioral analysis:

  • Static analysis: Search for code paths that:
  • Accept or derive paths from HTML or other remote inputs.
  • Use file:// URLs or user-controlled path segments to access the local file system.
  • Copy or move those files into directories served by HTTP endpoints.
  • Code review: Flag patterns where:
  • Local file reads are performed in response to web or paste events without explicit path validation.
  • Assets directories double as both upload targets and generic file-serving roots.
  • There is no clear separation between workspace content and host file imports.
  • Runtime monitoring: Log and alert on:
  • Unusual access patterns against /assets/*path, especially requests that align with sensitive OS locations or uncommon file names.
  • High volume or unexpected file imports triggered by /api/lute/html2BlockDOM.
  • Automated security tools can be configured to detect unvalidated file-system operations and web-exposed file-serving endpoints that rely on user-influenced paths.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/commit/294b8b429dea152cd1df522cddf406054c1619ad
github.comgithub.com/siyuan-note/siyuan/releases/tag/v3.6.1
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-fq2j-j8hc-8vw8

Frequently asked

questions

Yes. When the publish service is exposed, a remote visitor with the required authenticated access can influence HTML processed by the desktop kernel and then retrieve copied files via the /assets/*path endpoint.

The attacker generally needs authenticated access equivalent to a publish-service visitor and a way to trigger or supply HTML content that the /api/lute/html2BlockDOM endpoint will process. They do not need direct shell access to the host or file system.

The strongest fix is to strictly limit which local files can ever be imported or exposed, using canonical path validation against a dedicated safe directory, combined with sensitive-path blocking and a clear separation between imported host files and HTTP-served workspace assets.

Design features that touch the file system with clear trust boundaries: never treat remotely influenced data as a source of file paths, enforce robust path normalization and directory constraints, avoid exposing general-purpose file-import directories over HTTP, and include security-focused reviews and automated checks for any file access logic tied to web or paste events.

Find out what's already
exploitable in your codebase.