/

CVE-2026-33203

Severity:

HIGH RISK

(7.5)

Authentication Bypass and Unsafe Runtime Error Handling

CVE-2026-33203

Analyzed

Vulnerability type

Category:

Authentication Bypass and Unsafe Runtime Error Handling

CWE:

CWE-248, CWE-306

Impact:

Remote Denial of Service

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

The SiYuan kernel WebSocket server accepts unauthenticated connections when a specific "auth keepalive" query parameter is present, then parses attacker-controlled JSON using unchecked type assertions.

A remote attacker can send malformed messages that trigger a runtime panic, potentially crashing the kernel process and causing denial of service against the SiYuan kernel.

Affected context

This vulnerability affects SiYuan deployments exposing the kernel WebSocket server, particularly when reachable over a network interface (e.g., localhost proxies, LAN, or remote access setups).

The issue occurs when the server treats the presence of a specific "auth keepalive" query parameter as sufficient for accepting a WebSocket connection without enforcing full authentication.

Once connected, the kernel uses unchecked type assertions on incoming JSON messages, so malformed or unexpected message structures can cause runtime panics and terminate the kernel process.

Exploit preconditions

  • Attack surface: SiYuan kernel WebSocket endpoint, accessible over HTTP(S)/WebSocket from the attacker's network location.
  • Required access: Network-level access to the WebSocket server; no valid user credentials or prior session needed when the "auth keepalive" parameter is abused.
  • Trigger point: Establishing a WebSocket connection with the special query parameter and sending crafted JSON messages containing unexpected types or structures.
  • Why exploitation is possible:
  • The server treats a query parameter as a de facto authentication bypass condition (CWE-306: Missing Authentication for Critical Function).
  • The message handler performs unchecked type assertions on attacker-controlled JSON, allowing malformed data to trigger runtime panics (CWE-248: Uncaught Exception or Error Condition).

Why this happens

The vulnerability stems from two interacting design flaws:

  1. Weak authentication gate for a critical interface (CWE-306):

The WebSocket kernel interface is a sensitive control plane surface. Instead of enforcing robust authentication and session validation, it uses the presence of an "auth keepalive" query parameter as a proxy signal, allowing unauthenticated clients to establish a connection.

  1. Unchecked type assertions on untrusted JSON (CWE-248):

Once connected, the server assumes that incoming messages conform to expected JSON schemas and uses direct type assertions without validating the actual runtime types. When an attacker sends JSON shaped to violate these assumptions, the resulting failed type assertion triggers a runtime panic. Because the panic is not properly caught and handled, it propagates to the kernel process, terminating it and causing denial of service.

Potential impact

  • Remote denial of service against the SiYuan kernel by repeatedly triggering panics.
  • Loss of availability of the personal knowledge management interface and background services.
  • Potential loss of unsaved data if the kernel crashes during active editing or synchronization.
  • Degradation of user trust and reliability in environments where SiYuan is used as a critical knowledge store.

General mitigation guidance

Effective mitigation generally focuses on strengthening authentication and hardening error handling on critical endpoints:

  • Enforce strong authentication on WebSocket endpoints:
  • Tie WebSocket access to fully validated user sessions or API tokens instead of relying on special query parameters.
  • Treat any query parameters used for keepalive or session hints as advisory only, not as authentication substitutes.
  • Validate and sanitize all incoming message types:
  • Parse JSON into well-defined request structures and validate fields before performing type assertions or business logic.
  • Replace unchecked type assertions with safer patterns that perform type checks and return errors instead of panicking on mismatch.
  • Introduce robust error handling and process resilience:
  • Catch and handle runtime errors at boundaries between the network layer and core logic, returning protocol errors rather than allowing panics to crash the kernel.
  • Consider using centralized panic recovery middleware in WebSocket/message handlers to protect the process from single-request failures.
  • Apply least-privilege exposure and network controls:
  • Limit exposure of the kernel WebSocket server to trusted networks or localhost when possible.
  • Use host firewalls, reverse proxies, or VPNs to narrow who can initiate WebSocket connections.

How teams detect issues like this

Detection strategies can combine code-centric and operational approaches:

  • Static analysis and code review:
  • Search for WebSocket handlers or HTTP endpoints that:
  • Accept connections or perform critical actions based on query parameters alone.
  • Reference fields like "auth", "keepalive", or "token" without validating against a proper authentication system.
  • Identify unchecked type assertions on data originating from JSON unmarshal operations or other untrusted inputs.
  • Flag any panic-prone patterns in request handlers without recovery logic.
  • Runtime monitoring and logging:
  • Enable detailed logging for WebSocket connection attempts, including query parameters and authentication decisions.
  • Monitor application logs for panic stack traces or abnormal kernel restarts, especially correlated with WebSocket traffic.
  • Security testing and policy enforcement:
  • Incorporate fuzzing of WebSocket message schemas to reveal crash-prone assumptions in message handling.
  • Use CI/CD policies that require security review of new network endpoints and forbid unauthenticated access to control-plane APIs.
  • Optionally adopt automated security scanners that can recognize missing authentication checks and unsafe assertion patterns.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-3g9h-9hp4-654v

Frequently asked

questions

Yes. As long as an attacker can reach the SiYuan kernel WebSocket server and knows or can guess the required query parameter, they can establish an unauthenticated connection and send crafted messages to trigger a crash.

No valid credentials are required in the vulnerable configuration. The flaw is specifically that the presence of a particular "auth keepalive" query parameter allows unauthenticated access to the WebSocket interface.

The safest pattern is to require full, standardized authentication for all sensitive WebSocket endpoints and to treat query parameters only as hints, not as proofs of identity. At the same time, handle all incoming JSON via schema-based validation and replace unchecked type assertions with safe type checking and graceful error handling that cannot panic the process.

Use a consistent authentication mechanism across HTTP and WebSocket surfaces, avoid ad-hoc query-parameter–based access gates, and adopt defensive programming practices for request parsing. This includes validating all untrusted input, designing message schemas explicitly, using robust error handling or panic recovery at handler boundaries, and integrating static analysis and security review into the development process.

Find out what's already
exploitable in your codebase.