CVE-2026-72796
JSON

6.9medium

SiYuan before v3.7.4 Access Control Bypass via Static Routes

Severity
6.9medium CVSS:4.0 by VulnCheck
Exploit likelihood
0.26% (higher than 18% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck
Also known as
GHSA-fgmr-7w36-9qfqGO-2026-6423

Description

SiYuan before v3.7.4 contains an access control bypass vulnerability where static-file routes in the server mux bypass publish-access controls enforced on the REST API. Attackers with publish reader tokens or anonymous access in disabled-auth mode can read templates, snippets, and export artifacts by directly accessing static routes that lack the same restrictions as their REST API counterparts.

Affected

Product or packageVersionsReported by
siyuan-note siyuanbefore 3.7.4
Not affected: 3.7.4
CVE List
github.com/siyuan-note/siyuan/kernel (Go)before 0.0.0-20260725122641-34be6c0bb073GitHub Advisory Database, Go Vulnerability Database

All scores

VulnCheck6.9medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N
VulnCheck5.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N
GitHub5.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N

Classification

CWE-862

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

SiYuan before v3.7.4 contains an access control bypass vulnerability where static-file routes in the server mux bypass publish-access controls enforced on the REST API. Attackers with publish reader tokens or anonymous access in disabled-auth mode can read templates, snippets, and export artifacts by directly accessing static routes that lack the same restrictions as their REST API counterparts.

GitHub Advisory Database

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

Summary

Several static-file routes in the server mux (kernel/server/serve.go) are registered with CheckAuth only and serve directories directly, without the publish-access checks, sensitive-path blocklist, or refuseToAccess rules that the REST API applies to the same data. They are therefore reachable by the publish RoleReader token and by the anonymous account when Publish.Auth.Enable is false.

Most notably, /templates/ serves data/templates a directory the REST file API explicitly refuses to serve to non-administrators.

Details
RouteRegistrationGuardExposed to a reader
/templates/* (line 424)Group("/templates/", model.CheckAuth).Static("", data/templates)none beyond path cleaningthe templates directory
/snippets/* (line 434)CheckAuthblocks only conf.jsonany snippet's JS/CSS content by name
/widgets/, /plugins/, /emojis/ (409/414/419)Group(CheckAuth).Static(dir)nonewhole directory trees
/export/* (line 320)Group("/export/", CheckAuth)traversal, sensitive-path and DEK guards: no publish checkexport artifacts (PDF/HTML/DOCX/CSV)

/templates/ directly contradicts an existing control. The REST file path runs refuseToAccess (kernel/api/file.go:551-553), which explicitly returns 403 for data/templates/ to non-administrators the project has already decided readers must not read templates. The /templates/ static route serves that same directory to any RoleReader, with no IsSensitivePath check, no publish-access check, and no refuseToAccess. Templates are user-authored Markdown documents containing template/Sprig syntax and are not covered by publish-access controls. gin's .Static disables directory listing, so a filename is required but the contradiction with refuseToAccess is the defect.

/export/ versus /assets/. /assets/*path (line 692) correctly gates non-administrators via CheckAbsPathAccessableByPublishAccess, plus IsSensitivePath and encrypted-asset handling. /export/ carries traversal, sensitive-path and DEK guards but no publish-access check, so a reader can retrieve export artifacts of arbitrary documents, including private ones. Artifact naming is mixed, some use a random export ID, but code and CSV exports use the document name (export/code/<name>, export/csv/<name>/<name>.csv), which a reader can derive from listDocsByPath titles while the artifact exists. This path is therefore conditional.

Confirmed correctly gated, for contrast: /assets/* (publish-gated), /history/* and /repo/diff/* (CheckAdminRole), /debug/pprof/* (disabled in production builds), /public/ (intentionally public).

All four routes above were verified to carry CheckAuth only, no CheckReadonly, no CheckAdminRole.

Proof of Concept

Precondition: publish mode enabled (default port 6808), anonymous when Publish.Auth.Enable is false, otherwise any publish reader account.

Templates: served despite the REST API refusing them:

GET http://127.0.0.1:6808/templates/<template-file>.md
→ 200, template content

The equivalent REST request is refused:

POST http://127.0.0.1:6808/api/file/getFile
{"path":"data/templates/<template-file>.md"}
→ 403 (refuseToAccess)

The same reader session obtains the file through the static route.

Snippets:

GET http://127.0.0.1:6808/snippets/<snippet-name>.js
→ 200, snippet source

Export artifacts (conditional on a predictable name while the artifact exists):

GET http://127.0.0.1:6808/export/csv/<doc-name>/<doc-name>.csv
→ 200, exported content of a document the reader has no publish access to
Impact

An anonymous reader (publish mode with auth disabled) or any publish RoleReader can read user-authored template documents that the REST API explicitly withholds from non-administrators, snippet source (JS/CSS), and the contents of the widgets, plugins and emoji directories. Where an export artifact exists under a derivable name, they can additionally retrieve exported content of documents outside their publish scope. Confidentiality-only.

Suggested fix

Apply the same treatment these routes' REST counterparts already receive: for non-administrator roles, enforce publish-access scoping plus IsSensitivePath and the refuseToAccess blocklist on the static routes, mirroring /assets/*. Alternatively, block /templates/, non-public /snippets/, and /export/ for reader roles entirely.

Go Vulnerability Database

SiYuan: Static-file routes bypass the publish-access controls enforced on the REST API, exposing templates, snippets and export artifacts to anonymous readers in github.com/siyuan-note/siyuan/kernel

NVD (es)

SiYuan antes de la v3.7.4 contiene una vulnerabilidad de omisión de control de acceso donde las rutas de archivos estáticos en el multiplexor del servidor eluden los controles de acceso de publicación aplicados en la API REST. Atacantes con tokens de lector de publicación o acceso anónimo en modo de autenticación deshabilitada pueden leer plantillas, fragmentos y artefactos de exportación accediendo directamente a rutas estáticas que carecen de las mismas restricciones que sus contrapartes de la API REST.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-72796 changed 2026-08-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-fgmr-7w36-9qfq changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2026-6423 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-72796 changed 2026-10-24Public domain