/

CVE-2026-74800

Severity:

CRITICAL RISK

(9.0)

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

CVE-2026-74800

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Arbitrary Script Execution and Kernel API Access

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 may serve uploaded file assets without headers that prevent browsers from interpreting HTML as executable content. An authenticated attacker who can upload an HTML asset may cause scripts to run when a workspace owner opens its link, potentially granting access to the application's kernel API.

Affected context

The issue occurs in SiYuan deployments where:

  • Authenticated users can upload arbitrary file assets
  • The asset-serving endpoint does not consistently set Content-Disposition
  • The response does not include X-Content-Type-Options: nosniff
  • A privileged workspace owner or other user opens the asset link

The risk is greater when uploaded assets are served from a security context that can access authenticated application functionality.

Exploit preconditions

  • Attack surface: HTTP file-asset upload and retrieval functionality
  • Required access: Authenticated permission to upload an asset
  • Trigger point: A workspace owner or another privileged user opens the uploaded HTML asset link
  • Why exploitation is possible: The server may return attacker-controlled HTML with browser-interpretable content handling, allowing stored script content to execute in the application's security context

Why this happens

The underlying issue is improper handling of user-controlled file content at an HTTP response boundary. When arbitrary uploaded content is served without an attachment-oriented Content-Disposition policy and MIME-sniffing protections, a browser may interpret an HTML file as active document content rather than a downloadable asset.

This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), because attacker-controlled content can be stored and later interpreted as executable script when another user retrieves it.

Potential impact

  • An attacker may execute JavaScript in a workspace owner's browser
  • Scripts could act with the victim's authenticated application privileges
  • Sensitive workspace information may be exposed
  • The application's kernel API could be accessed or invoked without the owner's intended action
  • Workflows or stored content may be modified

General mitigation guidance

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

Common defensive patterns include:

  • Serve user-uploaded assets with Content-Disposition: attachment
  • Set X-Content-Type-Options: nosniff
  • Use an allowlist of permitted file types and validate content independently of the filename
  • Store downloadable assets on an isolated origin without application authentication context where practical
  • Apply strict Content Security Policy controls to asset-serving responses
  • Minimize the privileges available to browser-accessible kernel APIs
  • Restrict asset upload permissions and enforce least privilege

These controls reduce the likelihood that uploaded content becomes executable in a privileged browser context.

How teams detect issues like this

Detection can include:

  • Static and dynamic checks verifying security headers on file-serving endpoints
  • Code review searches for user-controlled files returned with inline or inferred content handling
  • Tests that upload HTML-like content and verify it is downloaded rather than rendered
  • Monitoring for unusual asset uploads, repeated access by privileged users, or unexpected kernel API activity
  • Policy enforcement requiring isolated origins and approved MIME types for user-uploaded content

Automated application security testing and header-validation tools can help identify regressions.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-mjf3-jwmf-r6wf
vulncheck.comvulncheck.com/advisories/siyuan-before-stored-xss-via-assets-endpoint

Frequently asked

questions

Yes, an authenticated attacker may be able to upload a malicious asset through the application's web interface. Successful impact generally depends on another user opening the asset link.

Not necessarily. The key requirement is permission to upload an asset, while the resulting impact may depend on the privileges of the user who views it.

Treat uploaded files as downloads rather than web pages, set attachment and MIME-sniffing protection headers, and isolate untrusted assets from the application's authenticated origin.

Enforce upload allowlists, validate file content, test response headers in CI and security testing, and apply least privilege to both upload permissions and browser-accessible application APIs.

Find out what's already
exploitable in your codebase.