CVE-2026-74904: SiYuan 17 Block Metadata/content Endpoints Vulnerability

HIGH
Advisory Identifier: GHSA-4vpg-gwqq-w44c
CVSS 7.5
CWE-204 CWE-862
Published
Advisory Summary

CVE-2026-74904 is a HIGH (CVSS 7.5) 17 block metadata/content endpoints vulnerability (CWE-204: Observable Response Discrepancy) affecting SiYuan libraries in the Go ecosystem. The issue involves 17 block metadata/content endpoints in kernel/api/block.go have zero publish-access filtering, reachable by anonymous publish-mode readers. Remediation is available by upgrading affected packages to version 0.0.0-20260804015139-bd067a4fe9b2.

CVE-2026-74904 at a Glance

CVE Identifier CVE-2026-74904
GHSA Identifier GHSA-4vpg-gwqq-w44c
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-204: Observable Response Discrepancy
Affected Product SiYuan
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-74904

To remediate this vulnerability, upgrade all affected SiYuan dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/siyuan-note/siyuan/kernel fixed: 0.0.0-20260804015139-bd067a4fe9b2
Upgrade github.com/siyuan-note/siyuan/kernel to 0.0.0-20260804015139-bd067a4fe9b2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/siyuan-note/siyuan/kernel

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-74904, inspect your project dependencies for SiYuan:

inspect dependencies for github.com/siyuan-note/siyuan/kernel

Analyze the terminal output to locate any version of SiYuan in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20260804015139-bd067a4fe9b2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-204: Observable Response Discrepancy, where the product provides different responses to incoming requests in a way that reveals internal state information to an unauthorized actor outside of the intended control sphere. In SiYuan, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Same CWE-862 family, found via an automated bulk sweep of every `/api/block/*` handler in `kernel/api/block.go` for the presence of any access-check reference (`IsReadOnlyRoleContext`, `checkBlockPublishAccess`, `GetPublishAccess`) anywhere in the function body. 17 of 28 candidate endpoints have none. Cross-checked against the file's own sibling functions (`getBlockInfo`, `getBlockDOM`, `getRefIDs`, etc.), which correctly implement the check, confirming this is a real, uneven gap rather than a deliberate design choice for the whole file. ### Summary 17 handlers in `kernel/api/block.go`, all gated only by `model.CheckAuth` with no admin-role requirement, return block content-derived text, structural metadata, or existence information for any block ID supplied, with no access check anywhere in the handler or, for the ones checked in detail, the model functions they call. This is CWE-862 (Missing Authorization), the same class as the companion advisories from this review round, found in a different file via a systematic bulk check rather than manual inspection of each function individually. ### Details Confirmed via automated extraction of every function body between `func NAME(c *gin.Context) {` and the next such declaration, then searching each for any of `IsReadOnlyRoleContext`, `checkBlockPublishAccess`, `GetPublishAccess`, or `PublishAccess`. The following contain none of these, at all: | Endpoint | What it discloses | |---|---| | `getRefText` | The block's actual reference-display text, derived from its content, for any ID (`kernel/api/block.go:564`) | | `getBlockBreadcrumb` | The block's breadcrumb/title path (`:?`) | | `getBlockDefIDsByRefText` | Which block IDs a given reference text resolves to | | `getRefIDsByFileAnnotationID` | Block IDs referencing a given PDF/file annotation | | `getBlockIndex` / `getBlocksIndexes` | A block's position/index within its document | | `getTreeStat` | Structural statistics for a document tree | | `getBlocksWordCount` / `getContentWordCount` | Word/character counts for arbitrary content | | `checkBlockExist` / `checkBlocksExist` | Existence oracle for any block ID | | `getUnfoldedParentID` | The nearest unfolded ancestor of a block | | `checkBlockFold` | Whether a block is currently folded | | `getBlockSiblingID` | A block's sibling in document order | | `getBlockRelevantIDs` | IDs of blocks related to a given block | | `getBlockTreeInfos` | Block tree metadata for a set of IDs | | `checkBlockRef` | Whether a block is referenced elsewhere | The clearest, most severe example, `getRefText` (`POST /api/block/getRefText`, `kernel/api/router.go:238`): ```go func getRefText(c *gin.Context) { ... id := arg["id"].(string) if util.InvalidIDPattern(id, ret) { return } var refText string if notebook, ok := arg["notebook"].(string); ok && notebook != "" && model.IsEncryptedBox(notebook) { refText = model.GetBlockRefTextInBox(id, notebook) } else { refText = model.GetBlockRefText(id) } ... ret.Data = refText } ``` `model.GetBlockRefText(id)` resolves the actual display text used wherever this block is referenced, ordinarily derived from the block's real content, for any `id` in the workspace, with no scoping. For contrast, sibling functions in the same file correctly implement the check, e.g. `getRefIDs` (`kernel/api/router.go:235`) and `getBlockInfo`/`getBlockDOM`/`getBlockKramdown` all contain `if model.IsReadOnlyRoleContext(c) { ... }` guards. This confirms the 17 above are an inconsistency within the file, not an intentional decision that the whole file is exempt from this control. ### Step-by-step reproduction ```bash # id: a block inside a document that was never published, or is # Disable=true in publish access curl -s -X POST http://<target>:6806/api/block/getRefText \ -H "Content-Type: application/json" -d '{"id":"<private-block-id>"}' # Returns the block's actual reference text with no session, no # AccessAuthCode, no publish password. curl -s -X POST http://<target>:6806/api/block/checkBlockExist \ -H "Content-Type: application/json" -d '{"id":"<guessed-block-id>"}' # Confirms or denies existence of any guessed ID workspace-wide. ``` Repeat against any of the other 15 endpoints in the table above, substituting their expected arguments, each returns data with no access check. ### Impact Any published SiYuan workspace discloses block-level content-derived text, structural metadata, and existence information for the *entire* workspace, not just published notebooks, to any anonymous internet visitor. `getRefText` in particular discloses real content text, not just metadata, for any block ID. The existence-oracle endpoints (`checkBlockExist`/`checkBlockRef`) combine with the companion advisory's `getIDsByHPath` title-guessing primitive to let an attacker efficiently probe for and confirm private content without ever needing legitimate access. ``` ## Affected products | Field | Value | |---|---| | Ecosystem | **Go** | | Package name | `github.com/siyuan-note/siyuan/kernel` | | Affected versions | Present at current HEAD (commit `eef1056`/`1673b75`, reviewed 2026-08-03) | | Patched versions | *(none yet, leave blank until a fix is released)* | ## Severity | Field | Value | |---|---| | Vector string | `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N` | | Score | **7.5 (High)**. Network vector, low complexity, no privileges or user interaction required, high confidentiality impact via `getRefText`'s real content-text disclosure plus the combined structural/existence oracle from the other 16, no integrity/availability impact since all 17 are read-only. | ## Weaknesses (CWE) - **CWE-862**: Missing Authorization (primary) - **CWE-204**: Observable Response Discrepancy (contributing, via the existence-oracle endpoints) ## Notes for filing - Same CWE-862 family as the two companion advisories from this review round (asset/attribute-view listing, and path/title resolution). Recommend the maintainers treat all three as one remediation pass: grep every `/api/*` handler for the literal presence of `IsReadOnlyRoleContext` and manually audit every one that lacks it, rather than fixing endpoint-by-endpoint, since the pattern has now recurred across three separate files. - Suggested fix: add `if model.IsReadOnlyRoleContext(c) { ... }` guards matching the pattern already correctly used by this file's own `getBlockInfo`/`getBlockDOM`/`getRefIDs` functions.

CVE-2026-74904 Affected SiYuan Versions

1 component(s)
Fixed Versions:
0.0.0-20260804015139-bd067a4fe9b2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/siyuan-note/siyuan/kernel
Go
< 0.0.0-20260804015139-bd067a4fe9b2
0.0.0-20260804015139-bd067a4fe9b2

References

Frequently Asked Questions

What is CVE-2026-74904?
CVE-2026-74904 is a security vulnerability in SiYuan involving 17 block metadata/content endpoints in kernel/api/block.go have zero publish-access filtering, reachable by anonymous publish-mode readers under CWE-204: Observable Response Discrepancy.
Which SiYuan versions are affected?
Affected versions include releases prior to 0.0.0-20260804015139-bd067a4fe9b2 across affected packages: github.com/siyuan-note/siyuan/kernel.
What version fixes CVE-2026-74904?
Upgrading to 0.0.0-20260804015139-bd067a4fe9b2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/siyuan-note/siyuan/kernel affected?
Yes, github.com/siyuan-note/siyuan/kernel is affected in releases prior to 0.0.0-20260804015139-bd067a4fe9b2. Upgrade your dependency to 0.0.0-20260804015139-bd067a4fe9b2 or later.
What is the CVSS score of CVE-2026-74904?
CVE-2026-74904 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-74904?
CVE-2026-74904 is classified under CWE-204: Observable Response Discrepancy (The product provides different responses to incoming requests in a way that reveals internal state information to an unauthorized actor outside of the intended control sphere.).
How can I check Go dependencies for CVE-2026-74904?
Run the dependency tree command: 'inspect dependencies for github.com/siyuan-note/siyuan/kernel'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4vpg-gwqq-w44c",
  "modified" : "2026-10-02T23:05:33Z",
  "published" : "2026-10-02T23:05:33Z",
  "aliases" : [ "CVE-2026-74904" ],
  "summary" : "SiYuan: 17 block metadata/content endpoints in kernel/api/block.go have zero publish-access filtering, reachable by anonymous publish-mode readers",
  "details" : "Same CWE-862 family, found via an automated bulk sweep of every\n`/api/block/*` handler in `kernel/api/block.go` for the presence of any\naccess-check reference (`IsReadOnlyRoleContext`, `checkBlockPublishAccess`,\n`GetPublishAccess`) anywhere in the function body. 17 of 28 candidate\nendpoints have none. Cross-checked against the file's own sibling\nfunctions (`getBlockInfo`, `getBlockDOM`, `getRefIDs`, etc.), which\ncorrectly implement the check, confirming this is a real, uneven gap\nrather than a deliberate design choice for the whole file.\n\n\n### Summary\n17 handlers in `kernel/api/block.go`, all gated only by `model.CheckAuth`\nwith no admin-role requirement, return block content-derived text,\nstructural metadata, or existence information for any block ID supplied,\nwith no access check anywhere in the handler or, for the ones checked in\ndetail, the model functions they call. This is CWE-862 (Missing\nAuthorization), the same class as the companion advisories from this\nreview round, found in a different file via a systematic bulk check\nrather than manual inspection of each function individually.\n\n### Details\nConfirmed via automated extraction of every function body between\n`func NAME(c *gin.Context) {` and the next such declaration, then\nsearching each for any of `IsReadOnlyRoleContext`,\n`checkBlockPublishAccess`, `GetPublishAccess`, or `PublishAccess`. The\nfollowing contain none of these, at all:\n\n| Endpoint | What it discloses |\n|---|---|\n| `getRefText` | The block's actual reference-display text, derived from its content, for any ID (`kernel/api/block.go:564`) |\n| `getBlockBreadcrumb` | The block's breadcrumb/title path (`:?`) |\n| `getBlockDefIDsByRefText` | Which block IDs a given reference text resolves to |\n| `getRefIDsByFileAnnotationID` | Block IDs referencing a given PDF/file annotation |\n| `getBlockIndex` / `getBlocksIndexes` | A block's position/index within its document |\n| `getTreeStat` | Structural statistics for a document tree |\n| `getBlocksWordCount` / `getContentWordCount` | Word/character counts for arbitrary content |\n| `checkBlockExist` / `checkBlocksExist` | Existence oracle for any block ID |\n| `getUnfoldedParentID` | The nearest unfolded ancestor of a block |\n| `checkBlockFold` | Whether a block is currently folded |\n| `getBlockSiblingID` | A block's sibling in document order |\n| `getBlockRelevantIDs` | IDs of blocks related to a given block |\n| `getBlockTreeInfos` | Block tree metadata for a set of IDs |\n| `checkBlockRef` | Whether a block is referenced elsewhere |\n\nThe clearest, most severe example, `getRefText`\n(`POST /api/block/getRefText`, `kernel/api/router.go:238`):\n```go\nfunc getRefText(c *gin.Context) {\n    ...\n    id := arg[\"id\"].(string)\n    if util.InvalidIDPattern(id, ret) {\n        return\n    }\n    var refText string\n    if notebook, ok := arg[\"notebook\"].(string); ok && notebook != \"\" && model.IsEncryptedBox(notebook) {\n        refText = model.GetBlockRefTextInBox(id, notebook)\n    } else {\n        refText = model.GetBlockRefText(id)\n    }\n    ...\n    ret.Data = refText\n}\n```\n`model.GetBlockRefText(id)` resolves the actual display text used\nwherever this block is referenced, ordinarily derived from the block's\nreal content, for any `id` in the workspace, with no scoping.\n\nFor contrast, sibling functions in the same file correctly implement\nthe check, e.g. `getRefIDs` (`kernel/api/router.go:235`) and\n`getBlockInfo`/`getBlockDOM`/`getBlockKramdown` all contain\n`if model.IsReadOnlyRoleContext(c) { ... }` guards. This confirms the\n17 above are an inconsistency within the file, not an intentional\ndecision that the whole file is exempt from this control.\n\n### Step-by-step reproduction\n```bash\n# id: a block inside a document that was never published, or is\n# Disable=true in publish access\ncurl -s -X POST http://<target>:6806/api/block/getRefText \\\n  -H \"Content-Type: application/json\" -d '{\"id\":\"<private-block-id>\"}'\n# Returns the block's actual reference text with no session, no\n# AccessAuthCode, no publish password.\n\ncurl -s -X POST http://<target>:6806/api/block/checkBlockExist \\\n  -H \"Content-Type: application/json\" -d '{\"id\":\"<guessed-block-id>\"}'\n# Confirms or denies existence of any guessed ID workspace-wide.\n```\nRepeat against any of the other 15 endpoints in the table above,\nsubstituting their expected arguments, each returns data with no\naccess check.\n\n### Impact\nAny published SiYuan workspace discloses block-level content-derived\ntext, structural metadata, and existence information for the *entire*\nworkspace, not just published notebooks, to any anonymous internet\nvisitor. `getRefText` in particular discloses real content text, not\njust metadata, for any block ID. The existence-oracle endpoints\n(`checkBlockExist`/`checkBlockRef`) combine with the companion\nadvisory's `getIDsByHPath` title-guessing primitive to let an attacker\nefficiently probe for and confirm private content without ever needing\nlegitimate access.\n```\n\n## Affected products\n\n| Field | Value |\n|---|---|\n| Ecosystem | **Go** |\n| Package name | `github.com/siyuan-note/siyuan/kernel` |\n| Affected versions | Present at current HEAD (commit `eef1056`/`1673b75`, reviewed 2026-08-03) |\n| Patched versions | *(none yet, leave blank until a fix is released)* |\n\n## Severity\n\n| Field | Value |\n|---|---|\n| Vector string | `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N` |\n| Score | **7.5 (High)**. Network vector, low complexity, no privileges or user interaction required, high confidentiality impact via `getRefText`'s real content-text disclosure plus the combined structural/existence oracle from the other 16, no integrity/availability impact since all 17 are read-only. |\n\n## Weaknesses (CWE)\n\n- **CWE-862**: Missing Authorization (primary)\n- **CWE-204**: Observable Response Discrepancy (contributing, via the existence-oracle endpoints)\n\n## Notes for filing\n- Same CWE-862 family as the two companion advisories from this review\n  round (asset/attribute-view listing, and path/title resolution).\n  Recommend the maintainers treat all three as one remediation pass:\n  grep every `/api/*` handler for the literal presence of\n  `IsReadOnlyRoleContext` and manually audit every one that lacks it,\n  rather than fixing endpoint-by-endpoint, since the pattern has now\n  recurred across three separate files.\n- Suggested fix: add `if model.IsReadOnlyRoleContext(c) { ... }` guards\n  matching the pattern already correctly used by this file's own\n  `getBlockInfo`/`getBlockDOM`/`getRefIDs` functions.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/siyuan-note/siyuan/kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20260804015139-bd067a4fe9b2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-4vpg-gwqq-w44c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-74904"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/siyuan-note/siyuan/commit/bd067a4fe9b208c0858d8d9dc6220dc8affc403e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/siyuan-note/siyuan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/siyuan-note/siyuan/releases/tag/v3.8.0"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/siyuan-before-missing-authorization-via-block-api"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-204", "CWE-862" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-02T23:05:33Z",
    "nvd_published_at" : null
  }
}