Executive brief
SiYuan is a self-hosted note-taking and knowledge management system. Versions up to 3.8.3 have a critical authentication flaw where missing HTTP Origin headers are treated as trusted, combined with improper content-type handling. An attacker can craft a single cross-site request from any web page to gain administrator access to a SiYuan instance, steal API tokens, and execute arbitrary code within the system.
Technical details
The vulnerability stems from two authentication guards (CheckAuth and IsSessionOriginAllowed) that incorrectly treat an absent Origin header as trustworthy, based on the false assumption that all browser cross-site requests include Origin. Combined with content-type sniffing on the /api/network/proxy endpoint that allows HTML to be served under SiYuan's own origin without X-Content-Type-Options headers, an unauthenticated attacker can issue a cross-site GET request lacking Origin to gain RoleAdministrator, then serve malicious HTML via the proxy endpoint to achieve same-origin JavaScript execution and exfiltrate the kernel API token. The attack works against both unprotected and password-protected instances with active sessions due to the SameSite=Lax cookie policy.
Affected products
- SiYuan SiYuan up to and including 3.8.3
Timeline
- 2026-09-26: disclosed
- 2026-09-26: patched: Version 3.8.4 released with fix