siyuan-note/siyuan · Security
SiYuan Has a Stored Cross-Site Scripting (XSS) Vulnerability via Unrestricted SVG File Upload
- GHSA ID
- GHSA-pcjq-j3mq-jv5j
- CVE ID
- CVE-2026-23645
- Severity
- medium
- Published
- Updated
- CVSS v4
- 5.3 · CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Description
Summary
A Stored Cross-Site Scripting (XSS) vulnerability exists in SiYuan Note. The application does not sanitize uploaded SVG files. If a user uploads and views a malicious SVG file (e.g., imported from an untrusted source), arbitrary JavaScript code is executed in the context of their authenticated session.
Details
The application allows authenticated users to upload files, including .svg images, without sanitizing the input to remove embedded JavaScript code (such as tags or event handlers).
PoC
- Create a new "Daily note" in the workspace.
- Create a file named test.svg with malicious JavaScript inside:
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 124 124" fill="none">
<rect width="124" height="124" rx="24" fill="red"/>
<script type="text/javascript">
alert(window.origin);
</script>
</svg>
- Upload a file in current daily note:
- Open the file:
- Right-click the uploaded asset in the note.
- Select "Export"
- The JavaScript code executes immediately.
Impact
The vulnerability allows to upload an SVG file containing malicious scripts. When a user exports this file, the embedded arbitrary JavaScript code is executed within their browser context
Notes
Tested version:
Solution
CWEs
- CWE-79 · Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
References
- https://github.com/siyuan-note/siyuan/security/advisories/GHSA-pcjq-j3mq-jv5j ↗
- https://github.com/siyuan-note/siyuan/issues/16844 ↗
- https://github.com/siyuan-note/siyuan/commit/11115da3d0de950593ee4ce375cf7f9018484388 ↗
- https://nvd.nist.gov/vuln/detail/CVE-2026-23645 ↗
- https://github.com/advisories/GHSA-pcjq-j3mq-jv5j ↗