GHSA-7j72-f6wg-cxw6: High severity go/github.com/siyuan-note/siyuan/kernel vulnerability

Published Sep 3, 2026
·
Updated

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

Summary

SiYuan's publish mode defines a "protected" access level: a document that is publicly listed but requires a password to read (per the product's own UI help text, protected = "Publicly visible, requires password to access"). The password is enforced on the primary content path (getDoc, via FilterContentByPublishAccess).

Several other content-returning endpoints getHeadingChildrenDOM, getHeadingDeleteTransaction/getHeadingLevelTransaction/ getHeadingInsertTransaction, and getBacklinkDoc/getBackmentionDoc return rendered block DOM with no password check at all. Combined with reader-reachable endpoints that leak a protected document's internal block IDs, an anonymous reader can retrieve the full body of a password-protected document without the password. This has been reproduced end-to-end on a live instance.

Details

The password control and where it is enforced. Publish access has five levels encoded in visible/password/disable: public, protected (password), hidden, private (password), forbidden. getDoc correctly enforces the password for protected/private documents via FilterContentByPublishAccess. The bug is that other content endpoints do not.

Content endpoints with no password check (all CheckAuth-only): - getHeadingChildrenDOM returns rendered DOM of a heading subtree. - getHeadingDeleteTransaction/getHeadingLevelTransaction/getHeadingInsertTransaction return rendered heading DOM in the computed transaction payload (no mutation occurs on this path). - getBacklinkDoc/getBackmentionDoc return rendered DOM of referencing blocks.

None of these invokes the publish-password check that getDoc applies. Each converts a block ID into full rendered content regardless of the containing document's protected/password status.

The ID-leak that removes the precondition. A protected document is, by design, publicly listed (listDocsByPath filters on visible, and protected documents are visible), so an anonymous reader obtains the document's root ID. The document's internal block/heading IDs are then obtainable from reader-reachable endpoints notably the searchEmbedBlock endpoint (reported separately), whose post-query filter FilterEmbedBlocksByPublishAccess replaces the content string but retains the block ID. So the "filtered" search still yields the protected document's internal heading IDs. (Other reader-reachable endpoints also leak block IDs, the vulnerability does not depend on any single ID source.)

The chain, reproduced on a live instance. Against a real protected document (password set), an anonymous reader on port 6808 with no token and no password:

1. getDoc(protectedDoc) → returns the password-required placeholder (correctly blocked). 2. searchEmbedBlock with a statement selecting heading blocks for the document's root ID → returns the heading IDs (content filtered, IDs retained). 3. getHeadingChildrenDOM(headingId) → returns the full rendered body of the protected document, including its protected content.

The password gate that step 1 enforces is entirely bypassed by step 3.

Proof of Concept

Reproduced on a local instance (SiYuan running locally, publish mode enabled on port 6808, publish Basic Auth disabled). Setup: a document marked "protected" with password, whose body contains the unique marker TOPSECRETCRITICAL123.

1. Confirm the password gate blocks the primary path (anonymous, port 6808): POST http://127.0.0.1:6808/api/filetree/getDoc {"id":"PROTECTEDDOC"} Returns the password-required placeholder correctly blocked.

2. Leak the protected document's heading ID (anonymous, port 6808): POST http://127.0.0.1:6808/api/search/searchEmbedBlock {"stmt":"SELECT FROM blocks WHERE rootid='PROTECTEDDOC' AND type='h'"} Returns heading blocks with their IDs; the content field is filtered but the block ID is retained.

3. Retrieve the protected content without the password (anonymous, port 6808): POST http://127.0.0.1:6808/api/block/getHeadingChildrenDOM {"id":"HEADINGID"} Returns HTTP 200 with the rendered body of the protected document, including TOPSECRETCRITICAL123 retrieved with no token and no password.

getHeadingDeleteTransaction/getHeadingLevelTransaction/getHeadingInsertTransaction and getBacklinkDoc/ getBackmentionDoc provide the same password-free content retrieval given a block ID from the protected document.

Impact

An anonymous reader (publish mode with auth disabled) or any publish RoleReader can read the full content of a password-protected published document without the password, defeating the "protected" access control the product documents as a password gate. The core defect is that these content-returning endpoints perform no publish-password check; the ID-leak endpoints (multiple sources) supply the block IDs that make the bypass reachable anonymously and untargeted. Impact is confidentiality-only (content disclosure); no modification occurs on these paths. Encrypted notebooks are out of scope.

Suggested fix

Apply the publish-password/publish-access check that getDoc uses (FilterContentByPublishAccess/IsReadOnlyRoleContext plus the password-cookie check) to every content-returning endpoint: getHeadingChildrenDOM, the three getHeadingTransaction handlers, and getBacklinkDoc/getBackmentionDoc. Separately, FilterEmbedBlocksByPublishAccess should omit filtered blocks entirely rather than blanking the content while retaining the ID, so that filtered results cannot be used to enumerate a protected document's internal block IDs. The durable fix is to enforce the publish boundary in the shared render/DOM path rather than per-handler, since any content endpoint that omits the check reintroduces this class.

Affected Software

1 affected componentFixes available
go/github.com/siyuan-note/siyuan/kernel<0.0.0-20260721020826-2d069dce84a2
0.0.0-20260721020826-2d069dce84a2

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-20260721020826-2d069dce84a2
  2. Configuration

    Enforce the same publish-access + password-cookie gate that getDoc uses (FilterContentByPublishAccess / IsReadOnlyRoleContext plus the password-cookie check) on every content-returning endpoint that currently uses only CheckAuth: getHeadingChildrenDOM, getHeadingDeleteTransaction, getHeadingLevelTransaction, getHeadingInsertTransaction, getBacklinkDoc, and getBackmentionDoc.

    SiYuan publish API content-returning handlers Publish-password/publish-access check (FilterContentByPublishAccess / IsReadOnlyRoleContext + password-cookie) = Apply to all listed content-returning endpoints instead of only getDoc
  3. Configuration

    Change FilterEmbedBlocksByPublishAccess so it omits filtered blocks instead of replacing the content while retaining the block ID. This prevents protected-document internal block/heading IDs from being enumerated via searchEmbedBlock.

    SiYuan publish API embed/search rendering FilterEmbedBlocksByPublishAccess behavior for filtered blocks = Omit filtered blocks entirely (do not retain block ID)

Event History

Sep 3, 2026
Advisory Published
via GitHub·09:22 PM
Data Sourced
via GitHub·09:22 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who can exploit this issue?

An anonymous reader can exploit it. No account or document password is required when the attacker can obtain internal block IDs for a protected document through reader-reachable endpoints.

2

Which documents are exposed?

Documents published with the protected access level are affected. These documents remain publicly listed but are intended to require a password before their contents can be read.

3

Which API paths bypass the password control?

The affected content-returning endpoints include getHeadingChildrenDOM, getHeadingDeleteTransaction, getHeadingLevelTransaction, getHeadingInsertTransaction, getBacklinkDoc, and getBackmentionDoc. Unlike getDoc, these paths return rendered block DOM without a password check.

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