GHSA-3mp7-4rh5-jrv9: High severity go/github.com/siyuan-note/siyuan/kernel vulnerability

Published Sep 3, 2026
·
Updated

CVE: This vulnerability corresponds to CVE-2026-72809.

Summary

The kernel's CheckAuth grants RoleAdministrator to any request whose RemoteAddr is loopback (127.0.0.1), for a specific set of endpoints, and these localhost bypasses sit outside the accessAuthCode gate so they apply even when an access auth code is configured. This is demonstrated live (Part A below).

Separately, the fixed-port reverse proxy (fixedport.go) forwards requests to the kernel over loopback and injects no authentication token, and no SetTrustedProxies is configured, so gin does not derive the client address from forwarding headers. By code inspection, a request forwarded through this proxy would reach the kernel with RemoteAddr = 127.0.0.1. If the fixed-port proxy is bound to a network interface (via NetworkServe) and forwards remote requests to the kernel this way, the localhost bypass would grant a remote unauthenticated caller admin on those endpoints. This second step is established by reading the code but was not reproduced end-to-end, and I'm asking the maintainer to confirm the proxy's runtime forwarding behavior (Part B below).

Details

Localhost-trust admin bypass (proven). CheckAuth (session.go:298-321) contains localhost-only bypasses that key off RemoteAddr and grant RoleAdministrator. They sit outside the accessAuthCode gate i.e. they apply even when an access auth code is set and cover /api/system/exit, getNetwork, getWorkspaceInfo, /assets/, and /export/.

Fixed-port proxy behavior (code inspection). fixedport.go is a plain reverse proxy that dials the kernel at 127.0.0.1 and injects no token unlike the publish proxy, which injects a RoleReader JWT. There is no SetTrustedProxies call, so gin does not rewrite RemoteAddr from X-Forwarded-For. On this reading, a request forwarded through the fixed-port proxy reaches the kernel with RemoteAddr = 127.0.0.1.

The composition (conditional). If both hold at runtime, then: remote request → fixed-port proxy on a network interface → forwarded to kernel at 127.0.0.1 (no token) → kernel sees RemoteAddr = 127.0.0.1 → localhost bypass grants admin for the endpoints above. I have proven the final link (localhost → admin) and read the code for the forwarding link, but have not confirmed at runtime that the fixed-port proxy is instantiated and forwards remote requests as loopback in a shipped configuration.

Distinct from the previously-dismissed localhost→admin observation. That observation concerned the publish proxy path, where the injected RoleReader JWT causes CheckAuth to early-return before reaching the localhost bypasses. The fixed-port proxy injects no token, so a request through it would fall through to the RemoteAddr-keyed bypass instead. Different proxy, different code path.

Proof of Concept

Part A: the localhost bypass grants admin without auth, outside the auth-code gate (demonstrated live). On a local instance with an access auth code configured, the same no-token getWorkspaceInfo request returns different results depending on the source address the kernel sees: - From a non-loopback source (kernel sees a non-127.0.0.1 address): HTTP 401. - From 127.0.0.1 (kernel sees loopback): {"code":0,"data":{"workspaceDir":"/siyuan/workspace",…}} admin data, no auth, despite accessAuthCode being set.

This confirms the localhost-trust bypass grants admin for these endpoints and is not gated by the access auth code.

Part B: remote → proxy → loopback (code inspection only; NOT reproduced). By reading fixedport.go, the proxy dials 127.0.0.1, injects no token, and no SetTrustedProxies is set. I was not able to reproduce this end-to-end: the serve CLI in the container image tested exposes only --port and --accessAuthCode, not a flag that instantiates the fixed-port proxy in the NetworkServe-on-a-non-default-port shape, so the remote→proxy→loopback chain was not exercised at runtime. I did not invoke the destructive /api/system/exit endpoint. I'm asking the maintainer to confirm: under what conditions is the fixed-port proxy instantiated, does it bind a non-loopback interface under NetworkServe, and does it forward to the kernel preserving the client address or as loopback? That determines whether Part A's bypass is remotely reachable.

Impact

Confirmed (Part A): on any deployment where a caller can cause the kernel to see a loopback RemoteAddr, the endpoints /api/system/exit, getNetwork, getWorkspaceInfo, /assets/, and /export/ are reachable with admin rights without the access auth code i.e. the auth code does not protect these endpoints against a loopback-sourced caller. On its own this is a local/adjacent bypass of the access-code control for those endpoints. If the fixed-port proxy forwards remote requests to the kernel as loopback (to be confirmed by the maintainer), a remote unauthenticated attacker obtains those admin capabilities, remote kernel shutdown (DoS), network/workspace-path disclosure, and admin-level asset/export reads that bypass the publish-access filter. This would be a remote authentication bypass. It does not grant the full admin API only the localhost-trusted endpoints.

Suggested fix

Do not derive admin trust from RemoteAddr when a proxy forwards over loopback. Options: have the fixed-port proxy inject an explicit role/token (as the publish proxy does) so the kernel authorizes on the claim rather than the source address; or configure SetTrustedProxies and derive the real client address before applying any localhost bypass; or require the access auth code for these endpoints regardless of source address. The localhost bypass assumes loopback implies a local trusted caller, any loopback-dialing proxy breaks that assumption.

Affected Software

1 affected componentFixes available
go/github.com/siyuan-note/siyuan/kernel<0.0.0-20260723031701-9c16e9851f0b
0.0.0-20260723031701-9c16e9851f0b

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/siyuan-note/siyuan/kernel to a version that resolves this vulnerability.

    Fixed in 0.0.0-20260723031701-9c16e9851f0b
  2. Configuration

    Change CheckAuth so that localhost/127.0.0.1 (RemoteAddr) does NOT grant RoleAdministrator for the endpoints mentioned ("/api/system/exit", "getNetwork", "getWorkspaceInfo", "/assets/*", "/export/*") and instead apply the same authorization checks used when accessAuthCode is configured.

    Kernel authentication (CheckAuth in session.go) localhost-trust bypass (RemoteAddr-based RoleAdministrator grant for specific endpoints) = Disable/remove localhost-only RemoteAddr bypass for /api/system/exit, getNetwork, getWorkspaceInfo, /assets/*, and /export/* (so these endpoints are gated by accessAuthCode regardless of source address)
  3. Configuration

    Update fixedport.go so that requests forwarded to the kernel are authorized using an explicit authentication claim/role/token rather than relying on the kernel's RemoteAddr loopback bypass; alternatively ensure the kernel determines the real client address by configuring trusted proxy behavior (e.g., SetTrustedProxies) before any localhost-bypass logic.

    fixed-port reverse proxy (fixedport.go) Authentication and trusted client handling = Inject an explicit role/token (analogous to publish proxy RoleReader JWT) and/or ensure client address is not blindly treated as loopback-trusted
  4. Compensating control

    Mitigate exposure until the fix is confirmed by preventing remote access to any locally-loopback reachable kernel paths/proxy ports; restrict network access (firewall/ACL) so only trusted local clients can reach the fixed-port proxy endpoint, especially when NetworkServe instantiates it on a non-loopback interface.

Event History

Sep 3, 2026
Advisory Published
via GitHub·10:34 PM
Data Sourced
via GitHub·10:34 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Does configuring an access authentication code prevent this issue?

No. The loopback-based RoleAdministrator grants for the affected endpoints are outside the accessAuthCode gate, so they apply even when an access authentication code is configured.

2

When could a remote unauthenticated attacker be exposed to the localhost bypass?

Remote exposure is conditional on the fixed-port proxy being bound to a network interface through NetworkServe and forwarding remote requests to the kernel over loopback. Code inspection indicates that such forwarded requests would have RemoteAddr set to 127.0.0.1 and receive administrator access on the affected endpoints, but this runtime behavior was not reproduced end-to-end.

3

How can I assess whether my deployment may be remotely exposed?

Check whether the fixed-port proxy is enabled through NetworkServe, bound to a network-accessible interface, and forwarding requests to the kernel over loopback. Also verify whether the affected endpoints are reachable through that proxy; the advisory identifies the remote exploitation path as dependent on this configuration and forwarding behavior.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203