Summary
SiYuan has an authentication bypass involving requests routed through a reverse proxy that trusts loopback addresses. An unauthenticated attacker may gain Administrator-level access and read private note-history contents when the deployment has no lock-screen password.
Affected context
The issue occurs in SiYuan deployments behind a reverse proxy that trusts forwarded client-address information from loopback connections. The risk depends on proxy behavior and configuration; accessing private note-history contents also requires that no lock-screen password is set.
Exploit preconditions
- Attack surface: SiYuan routes reachable through a reverse proxy
- Required access: No prior authentication is required if the proxy accepts attacker-controlled forwarding information
- Trigger point: A request to a history route, with host and forwarded-address information interpreted as indicating a trusted local request
- Additional condition for private history access: No lock-screen password is configured
- Why exploitation is possible: The application or proxy treats spoofable request metadata as proof of a trusted origin, bypassing normal authentication checks
Why this happens
The underlying bug is an authentication decision based on client-supplied or insufficiently validated proxy headers. When request metadata is trusted without verifying that it came from a configured proxy, an attacker may be treated as a loopback client and granted privileges. This maps to CWE-287: Improper Authentication.
Potential impact
- An attacker could gain Administrator-level access
- Private note-history contents may be exposed when no lock-screen password is set
- An attacker may be able to access or alter information available to an administrator
General mitigation guidance
Defensive approaches focus on ensuring authentication decisions cannot be influenced by untrusted request metadata.
- Configure proxies to remove incoming forwarding headers and set their own trusted values
- Trust forwarded client-address information only from explicitly configured proxy peers
- Validate host information against an allowlist and avoid treating a
localhosthost value as proof of identity - Enforce authorization checks on sensitive routes regardless of apparent client address
- Configure a lock-screen password when private note history requires additional protection
- Limit administrative access and proxy connectivity to the minimum necessary
How teams detect issues like this
Review proxy and application configuration for trust in client-supplied forwarding headers or host values. Test authorization behavior for sensitive history routes through the actual proxy path, and check that authentication remains enforced when request metadata varies. Use static analysis and code review to identify authorization decisions based solely on request headers, and apply deployment policies that require trusted-proxy configuration and authentication on sensitive routes.

