/

CVE-2026-87813

Severity:

HIGH RISK

(7.3)

Stored XSS (CWE-79) in SiYuan Asset Search Results

CVE-2026-87813

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Client-Side Code Execution and Same-Origin Account Actions

Severity:

HIGH RISK

(7.3)

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 contains a stored cross-site scripting vulnerability in the asset search results interface, where asset filenames are inserted into HTML without proper escaping. An authenticated attacker who can create or rename assets may cause JavaScript to execute in another user's browser when that user searches assets, potentially enabling same-origin requests and application state changes.

Affected context

The vulnerability occurs in SiYuan deployments that render asset filenames in the Search Assets result list without applying context-appropriate output encoding. Exploitation depends on an authenticated user being able to influence an asset filename and another user viewing the affected result through the asset search interface.

Exploit preconditions

  • Attack surface: The authenticated asset management and search interface
  • Required access: An authenticated account with permission to create or modify asset filenames
  • Trigger point: Rendering a matching asset in the Search Assets result list
  • Why exploitation is possible: User-controlled filename content is interpolated into HTML without sufficient escaping, allowing browser-interpreted markup to execute in the application's origin

Why this happens

The underlying flaw is improper neutralization of user-controlled data in web page generation. Asset filenames are treated as trusted HTML content rather than encoded as text for the output context, which maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). Because the malicious content is stored as part of an asset name, it can affect later users who view matching search results.

Potential impact

  • JavaScript execution in a victim's browser context
  • Same-origin requests performed with the victim's authenticated session
  • Unauthorized application state changes
  • Exposure of data accessible to the victim's session
  • Possible disruption of user workflows or administrative actions

General mitigation guidance

Mitigation generally focuses on ensuring that asset metadata is treated as untrusted data throughout its lifecycle.

Common defensive patterns include:

  • Applying context-appropriate output encoding when rendering filenames
  • Preferentially inserting filenames as text through safe DOM APIs rather than constructing HTML
  • Validating and constraining metadata while preserving safe, legitimate filenames
  • Using a restrictive Content Security Policy as a defense-in-depth control
  • Limiting authenticated users' ability to alter shared asset metadata
  • Applying least-privilege permissions to sensitive application actions
  • Reducing reliance on ambient browser credentials for state-changing requests

How teams detect issues like this

Organizations can detect similar issues through:

  • Static analysis rules for string interpolation into HTML or DOM sinks
  • Code review checks for unescaped filenames, labels, and other stored metadata
  • Dynamic testing with harmless markup markers in user-controlled fields
  • Browser security testing focused on stored data displayed in search and listing views
  • Policy enforcement requiring context-aware output encoding and safe DOM construction
  • Automated security review tools that identify common cross-site scripting sinks

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-qcw6-qm34-28h8
vulncheck.comvulncheck.com/advisories/siyuan-before-3.8.2-stored-xss-via-unescaped-asset-filenames

Frequently asked

questions

It can be triggered through the web application by an authenticated attacker who can influence asset filenames, but a victim generally must later view the affected asset in search results.

The attacker needs an authenticated account with sufficient permission to create or rename assets. The required permission scope depends on the deployment's access controls.

Treat filenames as untrusted text and apply context-aware output encoding, preferably rendering them through safe text APIs instead of interpolating them into HTML.

Combine secure rendering patterns with input validation, security-focused code review, automated scanning, Content Security Policy defense in depth, and least-privilege authorization.

Find out what's already
exploitable in your codebase.