/

CVE-2026-32815

Severity:

HIGH RISK

(7.5)

Authentication Bypass in SiYuan Knowledge Management

CVE-2026-32815

Analyzed

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-287

Impact:

Unauthorized Data Exposure and Session Activity Monitoring

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SiYuan's WebSocket endpoint accepts unauthenticated connections when specific URL parameters are supplied, allowing external clients to subscribe to server push events without logging in.

When a victim has a local SiYuan instance running, a malicious website can open a cross-origin WebSocket to that endpoint and passively monitor sensitive document metadata and user activity in real time.

Affected context

This vulnerability affects SiYuan instances that:

  • Expose the WebSocket endpoint /ws on a network-accessible interface (including localhost in a typical desktop setup)
  • Accept connections without authentication when given the parameters ?app=siyuan&id=auth&type=auth
  • Push document-related events over this channel, such as titles, notebook names, file paths, and CRUD operations

The risk is particularly relevant when users browse untrusted websites while SiYuan is running, because those sites can attempt cross-origin WebSocket connections to the local service.

Exploit preconditions

  • Attack surface: WebSocket endpoint at /ws on the SiYuan HTTP service
  • Required access: Network reachability to the victim's SiYuan instance (often via localhost from the victim's browser)
  • Trigger point: Opening a WebSocket connection using the crafted URL /ws?app=siyuan&id=auth&type=auth
  • Why exploitation is possible:
  • The endpoint treats connections with these parameters as implicitly authenticated to keep the kernel alive for the login page.
  • No proper authentication or session verification is enforced for such connections.
  • The implementation does not validate the WebSocket Origin header, so cross-origin connections from arbitrary websites are accepted.

Why this happens

The core issue is an authentication bypass caused by trusting specific client-supplied URL parameters instead of enforcing proper authentication and authorization checks.

The server implicitly assumes that requests with app=siyuan&id=auth&type=auth originate from the internal login flow and skips normal authentication for them.

Combined with missing Origin validation, this design maps to CWE-287: Improper Authentication, where workaround or "special case" logic unintentionally creates a path that grants access without validating the user's identity or session.

Potential impact

  • Exposure of document titles, notebook names, and file paths to unauthorized parties
  • Real-time visibility into all CRUD operations (create, read, update, delete) performed by authenticated users
  • Behavioral profiling of a user's note-taking and knowledge-management patterns
  • Potential correlation of leaked metadata with other data sources to infer sensitive topics, projects, or personal information
  • Increased attack surface for social engineering or targeted phishing based on observed activity

General mitigation guidance

Effective mitigation focuses on removing implicit trust and enforcing consistent authentication on real-time channels:

  • Require full authentication (e.g., session or token verification) for all WebSocket connections, regardless of URL parameters or client context.
  • Eliminate or strictly constrain "special" parameter-based bypasses intended for internal flows; if needed, gate them behind verifiable, server-side session checks.
  • Tie WebSocket authorization to user identity and permissions, ensuring each connection only receives events allowed for that principal.
  • Enforce robust origin and host validation policies for browser-initiated WebSocket connections, especially when the service can be accessed from localhost.
  • Apply least-privilege to push channels by limiting event data to the minimum necessary and avoiding inclusion of sensitive metadata where possible.

How teams detect issues like this

Detection can leverage both code-centric and behavior-centric approaches:

  • Static analysis and code review
  • Flag WebSocket endpoints that bypass normal authentication or authorization flows based on URL parameters or query flags.
  • Identify code paths where Origin or similar headers are ignored for browser-facing WebSocket endpoints.
  • Look for any login-related "keep-alive" or "heartbeat" logic that grants broader access than intended.
  • Configuration and policy checks
  • Enforce security guidelines that require authentication middleware on all real-time endpoints.
  • Apply policies that mandate origin checks for local services exposed via the browser.
  • Runtime monitoring
  • Log WebSocket connection attempts, including remote address, query parameters, and origin.
  • Alert on anomalous patterns such as frequent connections from web-browser user agents with unusual query parameters.
  • Automated application security testing tools can be configured to probe WebSocket endpoints with modified parameters and missing authentication to surface similar weaknesses.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/commit/1e370e37359778c0932673e825182ff555b504a3
github.comgithub.com/siyuan-note/siyuan/releases/tag/v3.6.1
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-xp2m-98x8-rpj6

Frequently asked

questions

It depends on how SiYuan is exposed. In typical desktop setups, exploitation occurs via the victim's browser connecting to a local instance (e.g., localhost), which malicious websites can target using cross-origin WebSockets. If the instance is bound to a public interface, remote attackers may connect directly.

The attacker needs network reachability to the SiYuan WebSocket endpoint and the ability to initiate a WebSocket connection, such as by luring the victim into visiting a malicious web page while SiYuan is running. No valid credentials are required because the endpoint treats certain parameters as implicitly authenticated.

Enforce consistent authentication and authorization on all WebSocket endpoints, remove parameter-based authentication bypasses, and ensure that only connections with valid, server-verified sessions can subscribe to sensitive event streams. Complement this with strict origin validation for browser-initiated connections.

Design real-time channels to reuse the same authentication and authorization mechanisms as standard HTTP endpoints, avoid "special case" unauthenticated modes, validate origins for browser traffic, and regularly review any exceptions added for UX reasons to ensure they cannot be triggered by untrusted clients.

Find out what's already
exploitable in your codebase.