/

CVE-2026-84803

Severity:

CRITICAL RISK

(9.0)

Stored XSS (CWE-79) in SiYuan Asset Serving Endpoint

CVE-2026-84803

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Account and Workspace Compromise

Severity:

CRITICAL RISK

(9.0)

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 its asset-serving functionality because some script-capable file extensions are not blocked.

If an attacker can upload a file using one of these extensions and a victim opens or loads the served asset, JavaScript may execute in the SiYuan workspace context, exposing API tokens or workspace data.

Affected context

The vulnerability occurs in SiYuan deployments that allow users or other reachable components to upload assets and subsequently serve them through the application.

Risk increases when the asset handler determines content types from extensions without comprehensively restricting script-capable formats, and when uploaded content is rendered under a trusted application origin.

Exploit preconditions

  • Attack surface: Asset upload and asset-serving functionality
  • Required access: Permission or another pathway to place files in an accessible asset location
  • Trigger point: A victim or automated client loads the stored asset through the SiYuan application
  • Why exploitation is possible: Incompletely blocked extensions may be served with executable media types, allowing browser script execution within the application's origin

Why this happens

The underlying issue is an incomplete file-extension blocklist combined with unsafe handling of uploaded assets.

When script-capable formats are accepted and served with browser-executable content types, the browser may interpret stored attacker-controlled content as active script. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, specifically stored cross-site scripting caused by insufficient output and content-type controls.

Potential impact

  • An attacker may steal API tokens available to the workspace
  • Malicious script may act with the victim's application privileges
  • Workspace content or configuration could be accessed or modified
  • Other users may be targeted when they view or load the stored asset
  • The application session or connected integrations could be compromised

General mitigation guidance

Mitigation generally focuses on treating uploaded files as untrusted data and preventing browsers from interpreting them as active content.

Common defensive patterns include:

  • Using an allowlist of permitted, non-executable asset types instead of relying only on an extension blocklist
  • Serving user-uploaded content from an isolated origin without application credentials
  • Applying authoritative, safe content types and preventing content-type sniffing
  • Rejecting script-capable and browser-interpretable formats at upload and serving boundaries
  • Encoding or safely rendering user-controlled metadata and filenames
  • Restricting token scope and applying least privilege to workspace and integration credentials
  • Using browser security policies, such as an appropriate Content Security Policy, as defense in depth

How teams detect issues like this

Detection approaches can include:

  • Static analysis and code review checks for extension-only validation and incomplete executable-file blocklists
  • Tests covering uncommon script-capable and XML-based file formats at upload and download boundaries
  • Monitoring asset uploads for unexpected extensions, MIME types, and content mismatches
  • Policy enforcement requiring untrusted files to be served from a separate origin with restrictive headers
  • Browser and application telemetry for unusual token use or requests originating from asset URLs
  • Automated security review tools that identify stored XSS sinks and unsafe file-serving behavior

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-7h8j-qw37-w46g
vulncheck.comvulncheck.com/advisories/siyuan-before-3.8.2-stored-xss-via-incomplete-asset-blocklist

Frequently asked

questions

It can be, when the application exposes asset upload functionality over a network and an attacker can obtain the necessary upload permission or exploit another upload path.

Usually, some ability to upload or place an asset is required. Whether authentication is needed depends on the deployment's access controls and any separate upload authorization weakness.

Treat uploaded files as untrusted data, permit only required non-executable formats, and serve them from an isolated origin with restrictive content-type and browser security headers.

Maintain allowlists rather than incomplete blocklists, test uncommon browser-interpretable formats, separate uploaded content from application origins, and monitor for suspicious uploads and token use.

Find out what's already
exploitable in your codebase.