/

CVE-2026-130683

Severity:

HIGH RISK

(8.2)

Path Traversal (CWE-22) in SiYuan File Copy Endpoint

CVE-2026-130683

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary file write with potential command execution

Severity:

HIGH RISK

(8.2)

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's file-copy API can allow authenticated administrators to write files outside the workspace because its sensitive-path deny-list omits locations such as shell initialization files and ~/.local. A malicious or misused copy operation could place a payload that runs under the user's account when a shell starts or the user logs in.

Affected context

The issue affects SiYuan deployments with a vulnerable IsSensitivePath deny-list and an API path that permits absolute destination paths outside the workspace. Shell initialization files such as .zshenv and .bash_profile, as well as ~/.local, are among the omitted locations. The risk is relevant when an authenticated administrator can invoke /api/file/copyFile and the SiYuan process has write access to those destinations.

Exploit preconditions

  • Attack surface: The /api/file/copyFile API.
  • Required access: Authenticated administrator access.
  • Trigger point: A copy request specifying an absolute destination outside the workspace.
  • Why exploitation is possible: The sensitive-path deny-list is incomplete, allowing certain destinations to be written. A written shell initialization payload may execute when the corresponding user next starts a shell or logs in.

Why this happens

The file-copy operation relies on an incomplete deny-list to determine which paths are sensitive. Because some destinations outside the workspace are not covered, path handling may permit writes beyond the intended boundary. This is a path traversal and improper path restriction issue associated with CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Potential impact

  • An attacker with the required administrative access could write files outside the workspace.
  • A payload placed in a shell initialization file could execute as the affected user on a later shell start or login.
  • The user account and accessible data or resources could be compromised.
  • Changes to files under ~/.local could affect user-level programs or configuration.

General mitigation guidance

Defensive patterns include resolving and canonicalizing destination paths, then enforcing that they remain within an explicitly permitted directory. Prefer an allow-list of approved destinations over a deny-list of sensitive paths, and reject absolute paths or path components that escape the workspace when they are not required. Reduce trust in client-supplied paths, restrict file operations to the minimum necessary locations, and run the service with least-privilege filesystem permissions.

How teams detect issues like this

  • Review file-copy and file-management code for path checks based solely on deny-lists.
  • Use static analysis to identify writes involving user-controlled paths, absolute destinations, or insufficient canonicalization.
  • Audit API authorization and filesystem permissions to confirm which users and processes can write outside the workspace.
  • Monitor file changes to shell initialization files and unexpected locations under user-level directories.
  • Enforce policies that restrict application writes to designated directories, and include path-boundary tests in security reviews.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-4xfj-946m-258h

Frequently asked

questions

It can be triggered through the API, but the described use requires authenticated administrator access. Exposure also depends on the deployment's network and access controls.

An attacker needs administrator access sufficient to call /api/file/copyFile and must be able to select a destination outside the workspace.

Resolve destinations to canonical paths and allow writes only within explicitly approved directories. Do not rely on an incomplete deny-list to protect sensitive locations.

Treat destination paths as untrusted input, enforce directory-boundary checks, restrict filesystem permissions, and test path handling against destinations outside the intended workspace.

Find out what's already
exploitable in your codebase.