CVE-2026-87813 Overview
CVE-2026-87813 is a stored cross-site scripting (XSS) vulnerability affecting SiYuan personal knowledge management software prior to version 3.8.2. The flaw resides in the Search Assets result list, where asset filenames are interpolated into HTML output without proper escaping. An authenticated attacker can upload or create an asset with a filename containing malicious markup. When any user searches assets, the payload executes JavaScript in the victim's browser under the application's origin. This enables same-origin API requests, session-context abuse, and manipulation of application state. The issue is tracked under CWE-79: Improper Neutralization of Input During Web Page Generation.
Critical Impact
Authenticated attackers can execute arbitrary JavaScript in victim browsers, hijack SiYuan sessions, and issue same-origin API calls to modify notes, assets, and workspace configuration.
Affected Products
- SiYuan note-taking application versions prior to 3.8.2
- Self-hosted SiYuan workspaces with multi-user asset access
- SiYuan deployments exposing the Search Assets feature to authenticated users
Discovery Timeline
- 2026-09-09 - CVE-2026-87813 published to NVD
- 2026-09-09 - Last updated in NVD database
Technical Details for CVE-2026-87813
Vulnerability Analysis
The vulnerability exists in SiYuan's asset search rendering path. When a user invokes the Search Assets feature, the application builds an HTML result list containing each matching asset's filename. The rendering routine concatenates filename strings directly into the DOM without applying HTML entity encoding or context-aware escaping. Any markup embedded in a filename is parsed by the browser as active content rather than displayed as text. Because SiYuan runs as a trusted, authenticated web application, injected scripts inherit the victim's session and can invoke internal APIs on the same origin.
Root Cause
The root cause is missing output encoding in the Search Assets result renderer. Filename values sourced from the asset store are treated as safe HTML rather than untrusted user input. This violates the standard XSS defense of escaping data at the sink. The flaw is classified as CWE-79, Improper Neutralization of Input During Web Page Generation.
Attack Vector
Exploitation requires an authenticated actor with permission to add assets to a shared workspace. The attacker uploads or renames an asset so its filename contains an HTML payload such as an <img> tag with an onerror handler or an inline <script> block. The payload remains dormant in storage until a victim opens the Search Assets dialog and triggers a query that returns the poisoned filename. At that point the browser parses the injected markup and executes the attacker's JavaScript in the SiYuan origin. The script can then read workspace contents, call authenticated backend endpoints, exfiltrate notes, or alter configuration. Detailed technical write-ups are available in the GitHub Security Advisory GHSA-qcw6-qm34-28h8 and the VulnCheck Advisory for SiYuan XSS.
Detection Methods for CVE-2026-87813
Indicators of Compromise
- Asset filenames containing HTML tag characters such as <, >, ", or ', especially patterns resembling <script, <img, <svg, or onerror=
- Unexpected outbound requests from browser sessions immediately following use of the Search Assets feature
- New or modified documents, notebooks, or workspace settings that do not correspond to legitimate user activity
Detection Strategies
- Inspect the SiYuan asset directory for filenames that fail a strict allow-list of alphanumeric, dash, underscore, dot, and space characters
- Monitor SiYuan HTTP access logs for asset upload or rename requests whose file paths contain URL-encoded HTML metacharacters
- Enable browser Content Security Policy (CSP) reporting to capture inline script violations originating from the SiYuan origin
Monitoring Recommendations
- Alert on any SiYuan API calls issued from browser contexts that were not initiated by direct user interaction with the UI
- Track version telemetry across SiYuan deployments and flag any instance still running a build older than 3.8.2
- Review audit records for asset renames performed by low-privilege accounts against shared workspaces
How to Mitigate CVE-2026-87813
Immediate Actions Required
- Upgrade all SiYuan instances to version 3.8.2 or later without delay
- Audit existing assets for filenames containing HTML metacharacters and rename or remove any suspicious entries
- Rotate SiYuan session tokens and API keys for accounts that may have executed the poisoned Search Assets view
- Restrict asset upload and rename permissions to trusted users until the upgrade is verified in production
Patch Information
The SiYuan maintainers addressed the flaw in release 3.8.2 by escaping asset filenames before rendering them in the Search Assets result list. Patch details and remediation guidance are documented in the GitHub Security Advisory GHSA-qcw6-qm34-28h8. Administrators should validate the running build after upgrade and confirm the fix by attempting to render a benign HTML-bearing filename in a test workspace.
Workarounds
- Block network access to the SiYuan Search Assets endpoint until the upgrade is applied
- Enforce a strict filename validation policy at the reverse proxy or upload gateway that rejects HTML metacharacters
- Deploy a Content Security Policy that disallows inline script execution on the SiYuan origin to reduce payload impact
# Example nginx filter to reject asset uploads with HTML metacharacters in filenames
location /api/asset/upload {
if ($request_uri ~* "[<>\"']") {
return 400 "Invalid filename characters";
}
proxy_pass http://siyuan_backend;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

