Details
python3 poc.py
Steps to reproduce:
git clone https://github.com/siyuan-note/siyuan /tmp/siyuan_testcd /tmp/siyuan_test && git checkout b382f50e1880ed996364509de5a10a72d7409428~1python3 poc.py(orgo run poc.goif Go PoC)
Expected output:
VULNERABILITY CONFIRMED
Iframe tags with srcdoc attributes bypass the Lute sanitizer, allowing embedded scripts to execute in the Electron context.
Impact
A malicious bazaar package author can include <iframe srcdoc='<script>...</script>'> in their README.md. When other users view the package in SiYuan's marketplace UI, the XSS executes in the Electron context with full application privileges, enabling data theft, local file access, and arbitrary code execution on the user's machine.
Suggested Remediation
- Add
iframeto thesetOfElementsToSkipContentset in the Lute sanitizer. - If iframes must be preserved, strip the
srcdocattribute entirely or sanitize its HTML content recursively. - Apply a Content Security Policy (CSP) to the README rendering context.
References
- Incomplete fix commit: https://github.com/siyuan-note/siyuan/commit/b382f50e1880ed996364509de5a10a72d7409428
- Original CVE: CVE-2026-33066