CVE-2026-72812: SiYuan before v3.7.4 Missing Authorization via refreshBacklink

Published Aug 14, 2026
·
Updated

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

Summary

The /api/ref/refreshBacklink endpoint is gated by CheckAuth only. Unlike its mutating siblings, it carries no CheckAdminRole, no CheckReadonly, and no inline reader-role guard so it falls through all three authorization mechanisms the codebase uses to protect write operations. A publish RoleReader or the anonymous account when Publish.Auth.Enable is false can invoke it, forcing the server to flush its pending write-transaction queue, scan all references globally, load and parse referencing trees from disk, and enqueue database writes. This violates the read-only invariant (it writes even in a globally read-only workspace), provides an unauthenticated resource-amplification/DoS primitive, and applies no per-object access check to the caller-supplied ID.

Details

Route / auth tier. router.go: Handle("POST", "/api/ref/refreshBacklink", model.CheckAuth, refreshBacklink), CheckAuth only. CheckAuth admits RoleReader; the publish proxy forwards port-6808 traffic with a Reader JWT (anonymous account when publish auth is disabled). Anonymous/reader reachable.

Guard fall-through. SiYuan protects write handlers with one of three mechanisms: route-level CheckAdminRole (AV/riff/repo/sync/setting/snippet/notebook mutations), route-level CheckReadonly (filetree/block/attr/tag mutations), or an inline IsReadOnlyRoleContext check (e.g. updateEmbedBlock, updateRecentDocTime). refreshBacklink has none of the three.

Write path reached. refreshBacklink calls model.RefreshBacklink(id): - FlushTxQueue() — forces the pending write-transaction queue to disk. - refreshRefsByDefID(defID) → QueryRefsByDefID(defID) (global scan with encrypted-box fallback loop) → filesys.LoadTrees(rootIDs) (disk read and Lute parse of every referencing tree) → sql.UpdateRefsTreeQueue(tree) (enqueues DB writes) → ref-count task update.

The handler also does not consult util.ReadOnly, so it executes its writes even when the workspace is configured globally read-only.

No per-object authorization. defID is attacker-controlled and receives no publish-access or ownership check, so a reader can force a reference reindex of any document, including publish-forbidden/unpublished ones (cross-scope).

Proof of Concept

Reproduced on a local instance (SiYuan running locally, publish mode enabled on port 6808, publish Basic Auth disabled), as an anonymous reader (no token):

Target endpoint executes the full write path: POST http://127.0.0.1:6808/api/ref/refreshBacklink {"id":"<any block id>"} Returns {"code":0,"msg":"","data":null} HTTP 200 the handler ran to completion, flushing the transaction queue and enqueuing ref writes.

Controls: the guarded mutating siblings correctly reject the same anonymous session: POST http://127.0.0.1:6808/api/tag/renameTag → 403 (CheckAdminRole and CheckReadonly) POST http://127.0.0.1:6808/api/block/foldBlock → 403 POST http://127.0.0.1:6808/api/block/updateEmbedBlock → code 0 no-op (inline IsReadOnlyRoleContext blocks the write) The 200-vs-403 contrast confirms refreshBacklink is reachable and executes where its siblings are blocked.

Impact

An anonymous reader (publish mode with auth disabled) or any publish RoleReader can:

- Bypass the read-only invariant: trigger persistent server-side writes (transaction-queue flush and reference reindex), including in a workspace configured globally read-only. - Amplify resource use without authentication: each call forces a transaction flush, a global reference scan, and disk read and parse of every referencing tree, with an attacker-controlled id and no rate limiting, a DoS primitive. - Act cross-scope: defID receives no publish-access check, so a reader can force reindexing of documents outside their publish scope. This is an integrity-invariant violation and a resource-amplification vector, not data corruption or injection, the caller cannot control the content of the writes, only trigger them. Impact is integrity-low and availability-low; no confidentiality impact and no attacker-controlled data reaches storage.

Suggested fix

Apply the same guard its mutating siblings use, add CheckReadonly (and CheckAdminRole if reference refresh is intended to be an authenticated operation) to the route, or an inline IsReadOnlyRoleContext check consistent with updateEmbedBlock. The endpoint should also honor util.ReadOnly and apply a publish-access check to defID so a reader cannot force cross-scope reindexing. More broadly, the three-way guard strategy (route middleware vs. inline check vs. none) is what allowed this handler to receive no gate at all; a structural backstop, a role-scoped route group for the mutation surface would prevent recurrence.

Other sources

SiYuan versions before v3.7.4 contain a missing authorization vulnerability in the /api/ref/refreshBacklink endpoint that allows anonymous readers to trigger persistent server-side writes. Attackers can invoke the endpoint with an attacker-controlled block ID to flush transaction queues, scan all references globally, and enqueue database writes, bypassing read-only protections and enabling resource amplification attacks.

MITRE

Affected Software

2 affected componentsFixes available
SiYuan SiYuan<3.7.4
go/github.com/siyuan-note/siyuan/kernel<0.0.0-20260723002528-7d273c271ce1
0.0.0-20260723002528-7d273c271ce1

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-20260723002528-7d273c271ce1
  2. Upgrade

    Upgrade SiYuan to a version that resolves this vulnerability.

    Fixed in v3.7.4
  3. Configuration

    Modify /api/ref/refreshBacklink so it is guarded like other mutating siblings by adding a route-level CheckReadonly (and, if reference refresh is intended to be authenticated/admin-only, also CheckAdminRole). Additionally, enforce a publish-access/ownership check for the caller-supplied block/document id (defID) so a reader cannot force cross-scope reference refresh.

    SiYuan /api/ref/refreshBacklink route Authorization checks = Add CheckReadonly and per-object publish-access authorization for the caller-supplied id (defID)
  4. Configuration

    Update refreshBacklink to honor util.ReadOnly (the handler currently does not consult it), so it does not execute FlushTxQueue/refreshRefsByDefID when the workspace is configured globally read-only.

    SiYuan refreshBacklink handler Read-only invariant enforcement (util.ReadOnly) = Consult util.ReadOnly and refuse writes when workspace is globally read-only

Event History

Aug 14, 2026
CVE Published
via MITRE·11:35 AM
Data Sourced
via MITRE·11:35 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·12:16 PM
DescriptionSeverityWeakness
Sep 3, 2026
Advisory Published
via GitHub·10:23 PM
Data Sourced
via GitHub·10:23 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-72812?

CVE-2026-72812 has a medium severity rating of 6.5.

2

How do I fix CVE-2026-72812?

To fix CVE-2026-72812, upgrade SiYuan to version 3.7.4 or later to address the missing authorization vulnerability.

3

What vulnerability does CVE-2026-72812 expose?

CVE-2026-72812 exposes a missing authorization vulnerability that allows unauthorized access to the /api/ref/refreshBacklink endpoint.

4

Can CVE-2026-72812 lead to data loss?

Yes, CVE-2026-72812 can lead to persistent server-side writes that may result in data loss if exploited.

5

What versions of SiYuan are affected by CVE-2026-72812?

All versions of SiYuan prior to v3.7.4 are affected by CVE-2026-72812.

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