/

CVE-2026-87815

Severity:

HIGH RISK

(8.7)

Path Traversal (CWE-73) in SiYuan Riff API Endpoint

CVE-2026-87815

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-73

Impact:

Arbitrary File Deletion

Severity:

HIGH RISK

(8.7)

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.8.2 contain a path traversal vulnerability in the /api/riff/removeRiffDeck endpoint because the deckID parameter is not adequately validated. An authenticated administrator may use crafted path references to delete .deck and .cards files outside the intended workspace directory.

Affected context

The vulnerability occurs in SiYuan deployments that expose the Riff deck removal API and use user-controlled deckID values to construct filesystem paths. It becomes risky when an authenticated administrator can reach the endpoint and the application does not constrain resolved paths to the designated workspace or restrict deletion to expected file locations and extensions.

Exploit preconditions

  • Attack surface: The /api/riff/removeRiffDeck HTTP endpoint
  • Required access: An authenticated account with administrator-level permissions
  • Trigger point: Processing the deckID parameter during Riff deck removal
  • Why exploitation is possible: The parameter is used without sufficient path canonicalization and boundary validation, allowing references to resolve outside the intended workspace and target supported file types.

Why this happens

The underlying bug is improper validation of a filesystem path derived from external input. When an application treats an identifier as a path component without canonicalizing it and verifying that the resulting path remains within an allowed directory, traversal sequences can escape the intended filesystem boundary. This behavior maps to CWE-73: External Control of File Name or Path, and can turn a logical deletion operation into arbitrary file deletion within the process's permissions.

Potential impact

  • An attacker may delete .deck files outside the intended workspace.
  • An attacker may remove .cards files used by other application workflows.
  • The application may experience data loss or degraded availability.
  • Stored content, configuration, or operational data may be damaged if it is accessible through the affected deletion logic.
  • Recovery efforts may require restoring affected files from trusted backups.

General mitigation guidance

Mitigation generally focuses on treating deck identifiers as opaque application identifiers rather than filesystem paths.

Common defensive patterns include:

  • Canonicalizing candidate paths before any filesystem operation.
  • Verifying that resolved paths remain beneath an explicitly allowed workspace directory.
  • Allowing deletion only of files discovered through trusted server-side metadata.
  • Enforcing strict identifier schemas and rejecting traversal characters or path separators.
  • Applying least-privilege permissions to the application process and its workspace.
  • Using narrowly scoped deletion APIs and maintaining reliable backups and recovery controls.
  • Returning generic errors that do not disclose filesystem layout details.

How teams detect issues like this

Organizations can look for path traversal risks through:

  • Static analysis rules that flag filesystem calls receiving request parameters.
  • Code review checks for path joining without canonicalization and containment validation.
  • Tests using traversal-like input variants to verify that operations remain inside approved directories.
  • Runtime monitoring for unusual deletion activity, repeated failed path validations, or access attempts outside the workspace.
  • API policy enforcement requiring administrator authorization and restricting destructive operations to approved resource identifiers.
  • Automated security review tools that identify external input flowing into file deletion functions.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-94vh-rpgr-rpwc
vulncheck.comvulncheck.com/advisories/siyuan-before-3.8.2-path-traversal-via-removeriffdeck

Frequently asked

questions

It may be exploitable through the SiYuan API when the endpoint is reachable and the attacker has the required authenticated administrator privileges.

Exploitation requires authenticated administrator-level access, along with network reachability to the affected endpoint and a deployment where the vulnerable path handling is active.

Treat the supplied value as an opaque identifier, resolve any server-side path, and verify that the canonical result remains within the intended workspace before performing a deletion.

Use strict input schemas, centralized safe path-resolution helpers, least-privilege filesystem permissions, destructive-operation monitoring, and automated tests for directory-boundary violations.

Find out what's already
exploitable in your codebase.