CVE-2026-87813 in SiYuan
Summary
by MITRE • 09/09/2026
SiYuan before v3.8.2 contains a stored cross-site scripting vulnerability in the Search Assets result list where asset filenames are interpolated into HTML without escaping. Authenticated attackers can craft asset filenames containing malicious markup that executes JavaScript in the victim's browser when searching assets, enabling same-origin API requests and application state manipulation.
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Analysis
by VulDB Data Team • 09/09/2026
The security flaw identified in SiYuan versions prior to 3.8.2 represents a classic stored cross-site scripting vulnerability located within the Search Assets functionality of the application. This issue stems from an improper neutralization of special elements used in web pages, specifically categorized under CWE-79 in the Common Weakness Enumeration standard. The root cause lies in the backend processing logic where asset filenames are retrieved and directly interpolated into HTML structures without adequate sanitization or encoding. When a user performs a search operation within the application, the system constructs a result list that displays these filenames as part of the rendered page content. Because the input validation mechanism fails to escape characters such as angle brackets, quotes, and ampersands, any malicious script embedded within an asset filename is preserved in its executable form rather than being converted into harmless text entities.
The operational impact of this vulnerability is significant due to the stored nature of the attack vector. Unlike reflected XSS where the payload must be delivered via a crafted link each time, here the malicious code persists on the server side as part of an asset's metadata or filename. Consequently, any authenticated user who views the search results containing the compromised asset will trigger the execution of the attacker-controlled JavaScript in their browser context. This persistence ensures that the vulnerability can affect multiple users over an extended period without requiring further interaction from the initial attacker once the malicious file is uploaded. The severity is compounded by the fact that SiYuan operates as a productivity and note-taking application, often handling sensitive personal or professional data, making any breach of client-side security particularly concerning for user privacy and trust.
From a tactical perspective, this vulnerability aligns with several techniques in the MITRE ATT&CK framework, primarily T1059 Command and Scripting Interpreter under JavaScript execution within browser environments. The ability to execute arbitrary scripts allows an attacker to perform same-origin API requests on behalf of the victim user. This capability enables the extraction of sensitive data such as authentication tokens, session cookies, or private notes stored locally by the application. Furthermore, it permits manipulation of the application state, allowing attackers to alter settings, delete content, or inject further malicious scripts into other parts of the interface that may have higher privileges. The lack of proper output encoding effectively bypasses standard browser security models like the Same-Origin Policy when combined with session hijacking techniques facilitated by cookie theft.
Mitigation strategies for this vulnerability focus on implementing robust input validation and secure output encoding practices at both the application logic and infrastructure levels. Developers must ensure that all dynamic content, particularly user-supplied data like filenames displayed in HTML contexts, is properly encoded using context-aware escaping mechanisms appropriate for HTML body text or attribute values. Implementing a Content Security Policy (CSP) can also serve as an effective defense-in-depth measure by restricting the sources from which scripts can be loaded and executed, thereby mitigating the impact of any successful XSS injection even if input sanitization fails. For users currently running affected versions, upgrading to version 3.8.2 or later is the primary remediation step provided by the vendor. In environments where immediate patching is not feasible, deploying a Web Application Firewall with rules capable of detecting and blocking common script injection patterns in URL parameters and form submissions can provide temporary protection against exploitation attempts.