/

CVE-2026-77086

Severity:

CRITICAL RISK

(9.1)

Path Traversal (CWE-22) in SiYuan Bazaar Endpoints

CVE-2026-77086

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Recursive Directory Deletion

Severity:

CRITICAL RISK

(9.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

SiYuan versions before 3.7.4 do not sufficiently validate the packageName parameter used by Bazaar installation and uninstallation endpoints. An authenticated administrator could exploit directory traversal sequences to write files to unintended locations or recursively delete directories.

Affected context

The vulnerability occurs in SiYuan Bazaar install and uninstall functionality when the packageName parameter is used to construct filesystem paths without adequate canonicalization and boundary checks. Risk is higher where authenticated administrators can invoke these endpoints and the application process has write or delete permissions beyond its intended package directory.

Exploit preconditions

  • Attack surface: Bazaar package installation and uninstallation endpoints
  • Required access: Authenticated administrator privileges
  • Trigger point: Processing a crafted packageName value containing directory traversal sequences
  • Why exploitation is possible: The supplied parameter can influence filesystem locations without sufficient restriction to the intended Bazaar directory

Why this happens

The underlying bug is improper limitation of a user-controlled path component. When an application combines packageName with a trusted base directory without canonicalizing the result and verifying that it remains within the permitted directory, traversal sequences can escape the intended path.

This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The same unchecked path resolution can affect both file-writing and recursive deletion operations.

Potential impact

  • An attacker may write arbitrary files to locations accessible to the SiYuan process.
  • An attacker could overwrite application, configuration, or operational files.
  • An attacker may recursively delete directories within the process's filesystem permissions.
  • The application could become unavailable or behave unpredictably.
  • Additional compromise could be possible if written files are later executed or loaded by privileged components.

General mitigation guidance

Mitigation generally focuses on treating package identifiers as constrained names rather than filesystem paths.

Common defensive patterns include:

  • Resolve candidate paths against a fixed, dedicated package directory and verify the canonical result remains within that directory.
  • Reject path separators, traversal components, absolute paths, encoded equivalents, and unexpected characters before filesystem operations.
  • Use allowlisted package identifiers and secure-by-default path-joining abstractions.
  • Separate installation and deletion permissions from broader administrative capabilities where practical.
  • Run the application with the least filesystem privilege required and isolate package storage from sensitive directories.
  • Apply distinct safeguards to write, rename, extraction, and recursive deletion operations.

How teams detect issues like this

Organizations can look for path-construction code that combines request parameters with filesystem paths, especially where canonicalization and containment checks are absent.

Useful approaches include:

  • Static analysis for user-controlled values passed to file creation, move, extraction, deletion, or recursive directory APIs.
  • Code review checks for direct string concatenation or unsafe path-joining with request parameters.
  • Tests using traversal, encoded traversal, absolute-path, and platform-specific separator variants to verify containment enforcement.
  • Runtime logging and policy monitoring for unusual Bazaar requests, filesystem writes, and recursive deletion activity.
  • Automated security review tools can help identify untrusted path data reaching filesystem operations.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-wr4w-7vjm-mmx3
vulncheck.comvulncheck.com/advisories/siyuan-before-path-traversal-via-packagename

Frequently asked

questions

It may be exploitable through the application's Bazaar endpoints when they are reachable by an authenticated administrator. The exact exposure depends on network access controls and deployment configuration.

The described attack requires authenticated administrator access because the affected install and uninstall operations are administrative functions.

Treat packageName as an allowlisted identifier, resolve paths under a dedicated package directory, and verify canonical containment before every filesystem operation.

Combine strict input validation with least-privilege filesystem permissions, security-focused path-handling tests, code review rules, and monitoring for unexpected file changes or deletion activity.

Find out what's already
exploitable in your codebase.