/

CVE-2026-30926

Severity:

HIGH RISK

(7.1)

Improper Access Control in SiYuan Publish Service

CVE-2026-30926

Analyzed

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-284, CWE-862

Impact:

Privilege Escalation and Data Integrity Compromise

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A privilege escalation issue in the SiYuan publish service allows read-only publish users (RoleReader) to modify notebook content through the /api/block/appendHeadingChildren endpoint.

Because this endpoint only checks a generic authorization role and not stricter admin or read-only constraints, authenticated low-privilege users can append new blocks to existing documents and compromise note integrity.

Affected context

The vulnerability appears in SiYuan's publish service API, specifically in deployments where:

  • Publish accounts are granted RoleReader (read-only) access,
  • The /api/block/appendHeadingChildren endpoint is exposed to authenticated publish users, and
  • Authorization middleware relies on model.CheckAuth without additional role checks like CheckAdminRole or CheckReadonly.

In these conditions, users assumed to have read-only permissions can still trigger content-modifying operations on shared notebooks.

Exploit preconditions

  • Attack surface: Remote HTTP(S) access to the SiYuan publish service API.
  • Required access: Valid authenticated publish account with RoleReader (read-only) permissions.
  • Trigger point: Sending a crafted request to the /api/block/appendHeadingChildren endpoint targeting an existing document or block ID.
  • Why exploitation is possible: The endpoint only verifies that the user passes a generic authorization check (model.CheckAuth) and does not verify that the caller has write or admin-level privileges, allowing state-changing operations from read-only accounts.

Why this happens

The underlying issue is an authorization design flaw where a state-changing endpoint is protected only by a coarse-grained "is authenticated" style check.

This maps to CWE-284: Improper Access Control and is closely related to CWE-862: Missing Authorization, as the API fails to enforce that only users with appropriate write or admin roles can modify notebook content.

Conceptually, the bug is that the publish service conflates any authenticated session with sufficient permission, omitting role- or operation-specific checks for content-modifying actions.

Potential impact

  • Read-only publish users may append new content blocks to existing notes.
  • Integrity of published notebooks and documents could be compromised or vandalized.
  • Stored information can be subtly altered, potentially leading to misinformation or loss of trust in shared notes.
  • Auditability and change attribution may be impacted if content changes appear to come from supposedly read-only accounts.

General mitigation guidance

Effective mitigation focuses on enforcing least privilege and operation-specific authorization on all state-changing endpoints:

  • Require explicit write or admin roles (e.g., CheckAdminRole or equivalent) for any API that creates, updates, or deletes content.
  • Implement fine-grained, per-endpoint authorization rules, ensuring that read-only roles are rejected for modification operations.
  • Centralize authorization logic in reusable middleware so that role checks cannot be accidentally omitted on new endpoints.
  • Adopt a "deny by default" strategy where endpoints require explicit permission grants instead of allowing generic authenticated access.
  • Periodically review role definitions and mappings to ensure that "read-only" roles cannot reach write-capable code paths.

How teams detect issues like this

Detection typically involves both code-centric and behavior-centric approaches:

  • Code review: Look for content-modifying handlers that only call generic auth checks (e.g., CheckAuth) without verifying role/permission scopes such as admin or write.
  • Static analysis: Configure rules to flag HTTP handlers that perform database writes or block mutations but lack explicit role/permission enforcement.
  • Access control tests: Implement automated security tests that exercise APIs with low-privilege accounts to confirm that write operations are rejected.
  • Logging and monitoring: Monitor for unexpected content changes originating from accounts designated as read-only, and alert on such anomalies.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-f9cq-v43p-v523

Frequently asked

questions

Yes. Any remote client that can reach the SiYuan publish service and authenticate with a RoleReader account can potentially exploit the issue by calling the vulnerable endpoint.

Yes. The attack requires a valid publish account session; however, only low-privilege read-only credentials are needed, which may be more widely distributed or assumed safe.

Apply strict, explicit authorization checks to all modification endpoints, ensuring only roles with write or admin permissions can perform state changes, and adopt a deny-by-default posture for new APIs.

Design a centralized authorization framework with clearly defined roles and permissions, enforce role-based checks at the API boundary, add automated tests for role behavior, and include access control reviews as a standard part of code review and security testing.

Find out what's already
exploitable in your codebase.