/

CVE-2026-82654

Severity:

HIGH RISK

(8.9)

Stored XSS (CWE-79) in SiYuan Block Reference Rendering

CVE-2026-82654

Deferred

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting and Unauthorized Actions

Severity:

HIGH RISK

(8.9)

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 because block names, aliases, and memo fields are not properly escaped when rendered in hints, backlinks, and breadcrumbs. An attacker who can set a block field containing script-capable markup may cause code to execute in another user's browser when that user views a document referencing or displaying the block.

Affected context

The issue affects SiYuan deployments where user-controlled block names, aliases, or memo fields are displayed through hint, backlink, or breadcrumb rendering paths without context-appropriate output encoding. It is most relevant when content created or modified by one user is later viewed by other users in the same application context, particularly where those users have higher privileges or access to sensitive documents.

Exploit preconditions

  • Attack surface: SiYuan document and block-rendering interfaces
  • Required access: Permission to create or modify a block name, alias, or memo
  • Trigger point: Another user views a document, hint, backlink, or breadcrumb that renders the affected field
  • Why exploitation is possible: User-controlled content reaches an HTML-rendering context without sufficient output encoding or sanitization

Why this happens

The vulnerability results from treating block metadata as trusted display content rather than as untrusted input. Rendering functions for hints, backlinks, and breadcrumbs fail to apply context-appropriate escaping to block names, aliases, and memo fields, allowing markup intended as data to be interpreted by the browser. This behavior maps to CWE-79, Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • An attacker may execute script in another user's browser session.
  • Session-associated information or page data could be exposed.
  • Malicious script could perform actions available to the viewing user.
  • Content could be altered, misleading links could be presented, or users could be redirected.
  • Higher-privileged users may be targeted for broader unauthorized changes.

General mitigation guidance

Mitigation generally focuses on treating all block metadata as untrusted and

applying output encoding at every rendering sink.

Common defensive patterns include:

  • Applying context-appropriate HTML escaping to names, aliases, and memo fields.
  • Using safe rendering APIs that distinguish text from markup by default.
  • Allowing rich text only through a narrowly defined, sanitized allowlist.
  • Validating and normalizing metadata at input boundaries without relying on validation alone.
  • Enforcing Content Security Policy and related browser protections as defense in depth.
  • Limiting user privileges and isolating administrative interfaces from untrusted content.

How teams detect issues like this

Organizations commonly detect this class of issue through:

  • Static analysis for unsafe interpolation into HTML, template, or DOM sinks.
  • Code review checks tracing block metadata from storage and user input to rendering functions.
  • Tests that verify special characters and script-capable markup remain inert in every display context.
  • Policy enforcement requiring framework-native auto-escaping and approved sanitization libraries.
  • Dynamic application testing that examines stored content across hints, backlinks, breadcrumbs, and related views.
  • Automated code review tools that flag unescaped user-controlled values in web templates or client-side rendering code.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-hf87-qh3j-3p88
vulncheck.comvulncheck.com/advisories/siyuan-before-3.8.1-stored-xss-via-block-name

Frequently asked

questions

It can be exploitable through the application if an attacker has permission to

create or modify the affected block metadata and another user subsequently views

a rendering path that displays it. The exact reach depends on deployment access

controls and collaboration settings.

Typically, some level of access to create or edit blocks is required. If the

application permits untrusted users to contribute content, the vulnerability may

affect other authenticated users who view that content.

Treat block names, aliases, and memo fields as untrusted text, use context-aware

output encoding at every rendering sink, and permit sanitized rich content only

where it is explicitly required.

Adopt secure-by-default templating and DOM APIs, add regression tests for every

rendering path, review data flows from storage to browser sinks, and enforce

content security policies as defense in depth.

Find out what's already
exploitable in your codebase.