/

CVE-2026-87814

Severity:

HIGH RISK

(7.3)

Stored XSS (CWE-79) in SiYuan Search Asset Preview Feature

CVE-2026-87814

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Authenticated JavaScript execution, session abuse, and workspace manipulation

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 before version 3.8.2 contains a stored cross-site scripting vulnerability in its search asset preview feature. Indexed asset content is inserted into the page without adequate escaping, allowing attackers who can place crafted text assets in a workspace to run JavaScript when another user previews them.

Affected context

The vulnerability occurs in SiYuan workspaces where asset content is indexed and later rendered by the search preview interface. Risk exists when an attacker can add or modify text assets and a victim with access to the workspace previews the affected content in the SiYuan origin.

Exploit preconditions

  • Attack surface: SiYuan's search asset preview interface
  • Required access: Ability to place or modify text assets in a workspace
  • Trigger point: A victim previews the affected asset through search results
  • Why exploitation is possible: Indexed content is inserted into the DOM through innerHTML without sufficient output encoding or sanitization

Why this happens

The underlying bug is a stored cross-site scripting condition caused by treating indexed asset content as trusted HTML when rendering search previews. Content that should remain data is inserted into the DOM through an HTML-interpreting sink without appropriate contextual escaping or sanitization. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • JavaScript execution in the SiYuan origin
  • Authenticated API requests performed in the victim's context
  • Unauthorized workspace changes
  • Exposure or modification of accessible workspace data
  • Manipulation of content or settings available to the victim

General mitigation guidance

Mitigation generally focuses on preserving the distinction between asset content and executable markup.

Common defensive patterns include:

  • Rendering untrusted preview content with text-safe DOM APIs rather than HTML-interpreting sinks
  • Applying context-appropriate output encoding before inserting content into the page
  • Using a narrowly scoped sanitizer when formatted markup is an intentional requirement
  • Treating indexed assets and search results as untrusted data by default
  • Applying a restrictive Content Security Policy as a defense-in-depth control
  • Limiting workspace permissions so untrusted users cannot add or modify assets consumed by other users

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules for unsafe DOM sinks such as innerHTML
  • Code review checks tracing asset, search, and index content into browser rendering paths
  • Tests containing benign markup markers to verify that preview output remains inert
  • Policies requiring contextual encoding or approved sanitization wrappers for untrusted content
  • Automated security review tools that flag unsanitized data flows into HTML-rendering APIs

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-64gp-333q-mq6j
vulncheck.comvulncheck.com/advisories/siyuan-before-3.8.2-stored-xss-via-asset-preview

Frequently asked

questions

An attacker generally needs the ability to place or modify text assets in a workspace whose content can later be viewed by another user.

Yes. The vulnerable content is triggered when a victim previews the affected asset through the search interface.

Render untrusted asset content as text, or apply context-appropriate encoding and a carefully constrained sanitizer before any intentional HTML rendering.

Treat indexed content as untrusted, prohibit unsafe DOM insertion for untrusted data, enforce output-encoding policies, and test preview features for stored and DOM-based cross-site scripting.

Find out what's already
exploitable in your codebase.