CVE-2026-74800 in SiYuan
Summary
by MITRE • 08/17/2026
SiYuan before v3.7.4 fails to set Content-Disposition and X-Content-Type-Options headers when serving arbitrary file assets, allowing stored cross-site scripting attacks. Authenticated attackers can upload HTML files as assets and execute scripts with full kernel API access when the workspace owner opens the asset link.
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Analysis
by VulDB Data Team • 08/17/2026
The vulnerability in SiYuan versions prior to 3.7.4 represents a critical failure in web application security controls regarding how static assets are served by the server. Specifically, the application fails to include essential HTTP response headers such as Content-Disposition and X-Content-Type-Options when delivering arbitrary file assets to clients. These headers play a pivotal role in enforcing browser security policies that prevent malicious content from being executed or misinterpreted by user agents. The absence of these directives creates an environment where attackers can exploit the lack of strict type checking and forced download behaviors, leading directly to stored cross-site scripting attacks. This flaw is fundamentally rooted in improper input validation and insufficient output encoding practices during asset handling, which aligns with CWE-79 for Improper Neutralization of Input During Web Page Generation and CWE-16 for Configuration Errors involving security headers.
The operational impact of this vulnerability is severe due to its stored nature combined with the specific context of SiYuan as a knowledge base application that supports rich media and file attachments. An authenticated attacker can upload HTML files disguised as or intended to be treated as standard assets within the workspace. Because the server does not enforce the X-Content-Type-Options header, browsers may ignore their own MIME type sniffing protections and execute scripts embedded in these uploaded files if they are rendered directly rather than downloaded. Furthermore, the lack of a Content-Disposition header means that instead of forcing the browser to treat the file as an attachment for download, it allows inline rendering or execution depending on how the asset is linked within the workspace interface. This mechanism enables persistent malicious code storage on the server side, ensuring that any user who accesses the compromised link will trigger the payload without additional interaction beyond viewing the content.
The consequences of a successful exploitation extend far beyond simple session hijacking or defacement. The description notes that scripts can execute with full kernel API access when the workspace owner opens the asset link. This implies that if SiYuan is running in an environment where it has elevated privileges, such as through Electron-based desktop applications or specific server configurations exposing system-level APIs to web contexts, the injected JavaScript could interact directly with underlying operating system functions. This capability transforms a standard cross-site scripting flaw into a potential remote code execution vector, allowing attackers to exfiltrate sensitive data from the workspace, manipulate local files, or pivot further within the network infrastructure where SiYuan is deployed. Such an outcome highlights the critical importance of isolating web contexts and ensuring that client-side scripts do not have access to privileged APIs unless strictly necessary and properly sandboxed.
Mitigation strategies must focus on both immediate patching and long-term architectural improvements. The primary remediation step is upgrading SiYuan to version 3.7.4 or later, where the developers have addressed these header omissions. In addition to updating software, administrators should implement server-side security headers such as X-Content-Type-Options set to nosniff and Content-Disposition set to attachment for all non-executable asset types to enforce strict MIME type checking and prevent inline execution of uploaded files. It is also advisable to configure web servers like Nginx or Apache to automatically append these headers regardless of application-level settings, providing a defense-in-depth layer against similar oversights in other applications hosted on the same infrastructure. Furthermore, organizations should review their deployment models for SiYuan to ensure that any exposed APIs are restricted and that user inputs are rigorously sanitized before storage to prevent initial injection vectors from being established by malicious actors.