/

CVE-2026-87811

Severity:

HIGH RISK

(7.3)

Stored XSS (CWE-79) in SiYuan Notebook Template Paths

CVE-2026-87811

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Same-origin JavaScript execution and application state 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 stores notebook template paths and later places them into HTML input value attributes without correctly encoding attribute content. A maliciously crafted path may escape the intended attribute context and execute JavaScript when a victim opens notebook configuration, potentially allowing same-origin API requests and application state manipulation.

Affected context

The vulnerability can occur in SiYuan deployments that persist notebook template paths and render those values in the notebook configuration interface. Risk is present when attacker-influenced path data reaches an HTML attribute without context-appropriate encoding and a victim views the affected configuration screen.

Exploit preconditions

  • Attack surface: The notebook configuration interface and its HTML rendering logic
  • Required access: Ability to create or modify a persisted notebook template path, directly or through an exposed integration or workflow
  • Trigger point: A victim opens the notebook configuration view containing the stored path
  • Why exploitation is possible: The path is inserted into an HTML input attribute without sufficient attribute-context encoding, allowing stored content to alter the interpreted markup and script context

Why this happens

The underlying bug is a failure to apply output encoding for the context in which persisted data is rendered. Notebook template paths are treated as ordinary attribute values, but insufficient attribute encoding can allow attacker-controlled characters to change the structure of the HTML document. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • Malicious JavaScript could execute in the victim's authenticated application context
  • The attacker could make same-origin API requests using the victim's permissions
  • Application settings or notebook state could be modified
  • Sensitive data accessible to the application could be exposed
  • Additional users could be affected if manipulated content is shared or rendered in other contexts

General mitigation guidance

Mitigation generally focuses on treating persisted paths as untrusted data throughout their lifecycle.

Common defensive patterns include:

  • Applying context-appropriate HTML attribute encoding at every output sink
  • Prefering safe DOM or templating APIs that separate data from markup
  • Validating paths against an explicit format and rejecting unexpected control or markup characters where appropriate
  • Reducing trust in stored values, including values created by administrators or integrations
  • Applying a restrictive Content Security Policy as defense in depth
  • Limiting the privileges and exposed capabilities of authenticated application sessions

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules for interpolating persisted data into HTML attributes
  • Code review checks for template rendering without context-specific escaping
  • Tests that render special characters in path and configuration fields and verify they remain data
  • Dynamic application testing of stored input flows and configuration screens
  • Policy enforcement requiring approved templating or DOM APIs for untrusted content
  • Automated security review tools that flag unencoded values at HTML output sinks

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-v6wf-r2gr-rrgf
vulncheck.comvulncheck.com/advisories/siyuan-before-3.8.2-stored-xss-via-notebook-template-paths

Frequently asked

questions

Exploitability depends on how an attacker can create or modify persisted notebook template paths. If those paths can be changed through a remotely reachable or authenticated interface, exploitation may be possible without local access.

Yes. The stored value generally becomes dangerous when the victim opens the notebook configuration view that renders the affected path.

Treat the path as untrusted data and apply correct HTML attribute-context encoding, preferably through a framework or API that safely separates data from markup.

Use context-aware output encoding, validate stored values, test untrusted data in every rendering context, and apply code review or automated analysis rules to detect unsafe HTML interpolation.

Find out what's already
exploitable in your codebase.