Oct 3, 2026·5 min read·12 visits
SiYuan is vulnerable to Cross-Site WebSocket Hijacking (CSWSH) because its internal WebSocket handlers disable browser origin validation. This allows attackers to establish persistent tunnels, execute SSRF, and pivot into the victim's local network.
CVE-2026-74802 is a critical Cross-Site WebSocket Hijacking (CSWSH) vulnerability in the SiYuan knowledge workspace application. Due to improper origin validation across multiple internal WebSocket endpoints, an attacker can hijack active authenticated sessions when a victim visits an untrusted external page. This allows the attacker to route malicious network traffic through the victim's localized SiYuan server, establishing an authenticated network pivot and facilitating Server-Side Request Forgery (SSRF).
SiYuan is an open-source, local-first knowledge management platform developed in Go. To support real-time data synchronization, RPC functions, and plugin communication, the application exposes several WebSocket endpoints. These endpoints run on port 6806 by default and handle highly privileged system activities.\n\nOne of the most sensitive operations exposed is the administrative network proxy endpoint, located at /ws/network/proxy. This route is designed to tunnel network traffic directly through the SiYuan kernel binary. Because this endpoint and several others lack validation controls, they represent a significant attack surface to malicious actors online.\n\nUnder standard Same-Origin Policy (SOP) rules, web browsers do not restrict cross-site WebSocket handshakes. It is the responsibility of the receiving server to validate the Origin header sent in the initial HTTP upgrade request. When this validation is omitted, any third-party script running in a user's browser can interact with the WebSocket server, bypassing conventional CORS restrictions.
The root cause of CVE-2026-74802 is an Origin Validation Error (CWE-346) in the initialization of the application's WebSocket upgrader instances. Specifically, within kernel/api/network.go, the CheckOrigin callback function of the gorilla/websocket library was explicitly overridden to bypass security checks.\n\nThe original implementation defined a CheckOrigin callback that unconditionally returned true. This explicit instruction forced the Go web server to accept incoming WebSocket connections regardless of the domain specified in the request's Origin header. An attacker-controlled site could thus successfully initiate a handshake.\n\nThis structural security defect extended beyond the proxy endpoint. The primary WebSocket server running inside kernel/server/serve.go used the melody library without configuring any origin checks. Likewise, the broadcast channels in kernel/api/broadcast.go and the plugin-based RPC endpoints in kernel/plugin/rpc.go used Go WebSocket Server (GWS) upgraders that lacked verification controls.
In vulnerable versions of SiYuan, the network proxy endpoint was upgraded using the following structure in kernel/api/network.go:\n\ngo\n// Vulnerable: CheckOrigin returns true unconditionally\nupgrader := websocket.Upgrader{\n\tCheckOrigin: func(r *http.Request) bool { return true },\n}\nclientConn, upgradeErr := upgrader.Upgrade(c.Writer, c.Request, upgradeHeaders)\n\n\nBecause the server does not perform checks, browsers transmitting the upgrade request automatically supply any existing session cookies. The server accepts the handshake and opens a persistent TCP socket. The fixed implementation replaces this anonymous function with an origin-checking utility function:\n\ngo\n// Patched: Origin header is verified against the Host header\nupgrader := websocket.Upgrader{\n\tCheckOrigin: func(r *http.Request) bool {\n\t\treturn util.IsSessionOriginAllowed(r.Header.Get(\"Origin\"), r.Host)\n\t},\n}\nclientConn, upgradeErr := upgrader.Upgrade(c.Writer, c.Request, upgradeHeaders)\n\n\nTo ensure complete system coverage, similar checks were added across all WebSocket routers. For example, in the broadcast handler in kernel/api/broadcast.go:\n\ngo\nwebsocket := melody.New()\n// Upgrader now validates origin headers\nwebsocket.Upgrader.CheckOrigin = func(r *http.Request) bool {\n\treturn util.IsSessionOriginAllowed(r.Header.Get(\"Origin\"), r.Host)\n}\n
To exploit this vulnerability, an attacker must lure an authenticated SiYuan user to visit a malicious website under the attacker's control. The malicious page runs client-side JavaScript that attempts to construct a WebSocket connection back to the victim's local loopback interface.\n\nmermaid\ngraph LR\n AttackerHost[\"Attacker Page (evil.com)\"] -- \"1. Serves exploit JS\" --> VictimBrowser[\"Victim's Browser\"]\n VictimBrowser -- \"2. WS Handshake (Origin: evil.com)\" --> SiYuan[\"SiYuan (localhost:6806)\"]\n SiYuan -- \"3. Returns Connection Accepted (101)\" --> VictimBrowser\n VictimBrowser -- \"4. Sends malicious proxy connect\" --> SiYuan\n SiYuan -- \"5. Exploit connects internal DB\" --> InternalService[\"Internal Network (192.168.1.50)\"]\n\n\nBecause the application is running locally on port 6806, the exploit script targets ws://127.0.0.1:6806/ws/network/proxy. Once the connection is open, the attacker sends control messages specifying target internal hosts. The local SiYuan Go binary acts as a forward proxy, connecting to localized targets and returning raw responses back to the attacker's script.
The CVSS base score of 8.2 reflects the significant threat this flaw poses to host environments. Because the target is typically a local installation on a user's workstation or a container inside a private network segment, successful exploitation facilitates pivoting.\n\nAttackers can leverage the compromised connection to perform port scanning against the local host and adjacent LAN environments. They can also target internal services, such as database administration interfaces or cloud instance metadata services (IMDS), which are normally protected behind perimeter firewalls.\n\nThis attack sequence requires zero authentication from the attacker's perspective, as it leverages the victim's ambient browser authentication. It results in high confidentiality loss and moderate integrity loss, with the compromised host performing unauthorized actions under the identity of the authenticated user.
The primary remediation strategy is upgrading the SiYuan installation to version 3.7.4 or later. In these updated versions, the developers implemented rigorous checking routines via IsSessionOriginAllowed to confirm the request origin matches the allowed deployment host.\n\nFor environments where patching cannot be immediately completed, administrators should apply local network mitigations. Restrict access to port 6806 by binding the application service specifically to 127.0.0.1 rather than 0.0.0.0. Implement local firewall policies (iptables or Windows Firewall) to drop incoming external connections on this port.\n\nTo monitor for potential exploitation attempts, security operations teams should analyze proxy logs for WebSocket upgrade requests where the Origin header contains an external, unknown, or null value. Additionally, inspect local process execution logs to detect unexpected outbound traffic originating from the SiYuan binary.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
SiYuan SiYuan | < 3.7.4 | 3.7.4 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-346 (Origin Validation Error) |
| Attack Vector | Network (AV:N) |
| CVSS v3.1 Score | 8.2 |
| EPSS Score | 0.00164 |
| Exploit Status | Proof-of-Concept |
| KEV Status | Not Listed |
The software does not properly validate or verify that the origin of a request is correct or expected.
A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.
Contao Open Source CMS versions 4.0.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 contain a Cross-Site Request Forgery (CSRF) vulnerability in backend parameter handling. The `RequestTokenListener` component validates anti-CSRF tokens solely for HTTP POST requests, while GET-based declarative guards run only when an `act` parameter is present in the query string. Consequently, custom backend actions dispatched via alternative parameters such as `key=` can execute without CSRF token verification when triggered by an authenticated user.
Contao CMS versions 4.1.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 fail to validate form submission tokens and enforce rate limiting when processing activation email resend requests via HTTP POST, enabling resource exhaustion and account state enumeration.
An information disclosure vulnerability in Contao CMS allows unauthenticated site visitors to view protected page titles, URLs, and text excerpts through search queries when protected page indexing is disabled after previously being enabled.
In Vikunja prior to version 2.6.0, relation creation via the CalDAV endpoint fails to invoke the TaskRelation.CanCreate authorization check. This missing access control allows an authenticated user to establish unauthorized relationships and perform write operations against any task, provided its unique identifier (UID) is known.
A cross-project information disclosure vulnerability in Vikunja allows authenticated users with read access to one project to view private task details from unauthorized projects via subtask expansion parameters.