Skip to content

SiYuan: Missing publish-access filter on getFileAnnotation discloses private PDF annotations of forbidden/protected documents (publish mode)

Moderate severity GitHub Reviewed Published Jul 23, 2026 in siyuan-note/siyuan • Updated Sep 3, 2026

Package

gomod github.com/siyuan-note/siyuan/kernel (Go)

Affected versions

< 0.0.0-20260723031702-509b35055940

Patched versions

0.0.0-20260723031702-509b35055940

Description

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

Summary

The /api/asset/getFileAnnotation endpoint returns the content of .sya PDF-annotation files with no publish-access check. It is gated by CheckAuth only, so it is reachable by the publish RoleReader token and by the anonymous account when Publish.Auth.Enable is false. Its sibling, the /assets/* asset route does enforce publish access, including the publish password. An anonymous reader who knows an asset path can therefore read the private PDF annotations (highlights, notes) attached to assets in publish-forbidden, password-protected, or unpublished documents.

Details

getFileAnnotation resolves the annotation file via GetAssetAbsPathInBox (no path traversal) and returns the .sya content. Unlike the /assets/* route, which applies the publish-access filter including password enforcement before serving asset bytes, getFileAnnotation applies no publish-access, publish-ignore, or password check. The guarded-sibling asymmetry indicates the boundary is meant to apply to this data and was omitted here.

.sya files for encrypted-box assets are fail-closed and not exposed. The gap is limited to non-encrypted assets.

Route / auth tier. getFileAnnotation is registered CheckAuth-only. CheckAuth admits RoleReader; the publish proxy forwards port-6808 traffic with a Reader JWT (anonymous when publish auth is disabled).

Proof of Concept

Reproduced on a local instance (publish mode on 6808, Basic Auth off).

Setup (admin, 6806):

  1. createNotebook{name:"AnnotPoc"} → box
  2. createDocWithMd{notebook, path:"/annot-victim", markdown:"doc with a pdf"} → doc
  3. POST /api/asset/upload (multipart id=<doc>, file[]=@secret.pdf) → assets/secret-...pdf
  4. setFileAnnotation{path:"<asset>.sya", data:"{annotSecret:ANNOT_SECRET_4471,note:private highlight}"}
  5. setPublishAccess{id:<doc>, visible:false, password:"", disable:true} → doc forbidden

Exploit (anonymous reader, 6808, no token):

POST http://127.0.0.1:6808/api/asset/getFileAnnotation
{"path":"assets/secret-...pdf.sya"}

Returns:

{"code":0,"data":{"data":"{\"annotSecret\":\"ANNOT_SECRET_4471\",\"note\":\"private highlight\"}"}}

The annotation content of a publish-forbidden document is returned to an anonymous reader with no publish-access check, while the /assets/* route serving the same asset class enforces publish access and password.

Impact

An anonymous reader (publish mode with auth disabled) or any publish RoleReader can read the private PDF annotations (highlights and notes) of assets belonging to publish-forbidden, password-protected, or unpublished documents, given the asset path. This defeats the publish-access/password boundary for annotation data. Scope is limited to annotated PDFs in non-encrypted notebooks; encrypted-box annotations are not exposed. Confidentiality-only.

Suggested fix

Apply the same publish-access check the /assets/* route uses to getFileAnnotation resolve the asset's owning document and enforce the publish-access/publish-ignore / password check before returning .sya content.

References

@88250 88250 published to siyuan-note/siyuan Jul 23, 2026
Published to the GitHub Advisory Database Sep 3, 2026
Reviewed Sep 3, 2026
Last updated Sep 3, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
Low
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(20th percentile)

Weaknesses

Missing Authorization

The product does not perform an authorization check when an actor attempts to access a resource or perform an action. Learn more on MITRE.

CVE ID

CVE-2026-72808

GHSA ID

GHSA-v7ph-r5r6-4jcj

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.