llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/siyuan-note/siyuan/kernel

GHSA-2MRF-MX66-VV6G

Publish readers learn unpublished notebook box IDs via save-path resolver endpoints missing a publish-access check in SiYuan

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
5.3
Media
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición63 dDesde la divulgación, 17 sept 2026, 11:33 a. m.
Detección63 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
17 sept 26
20 nov 26
17 sept 26
3 oct 26
19 oct 26
4 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-2MRF-MX66-VV6G divulgada · CVSS 5.3 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

Three notebook save-path resolver endpoints in the SiYuan kernel are registered with the base authentication middleware only and perform no publish-access authorization check. When the instance is run in publish mode, a read-only publish visitor (anonymous when the publish site has no password) can call these endpoints and learn the internal box ID of the notebook that an administrator configured as the global save target for new documents, block references, or shorthand notes. That target may be a notebook the administrator has not published, whose identity is otherwise protected from readers. The endpoints also return the rendered save-path template string. This is a missing-authorization (CWE-862) metadata disclosure confined to an opaque identifier and a path string; no document content is returned.

Root Cause

Under SiYuan's publish model, the identity and metadata of notebooks that an administrator has not published are a protected boundary; the project enforces this elsewhere with per-object publish-access checks. The three save-path resolvers violate that invariant. Each resolver, when the per-notebook configuration is empty, falls back to the globally configured save box (`RefCreateSaveBox`, `ShorthandSaveBox`, `DocCreateSaveBox`) and returns that global box ID to the caller. None of the three calls any publish-access filter before emitting the identifier, so a read-only role receives the box ID of a notebook it is not authorized to see. A SiYuan box ID has the form `YYYYMMDDHHMMSS-<rand>`, so the disclosure additionally reveals the target notebook's creation timestamp and its existence.

Ungated handlers (no publish-access check):
- kernel/api/filetree.go:1034 getRefCreateSavePath   (global fallback at :1052-1054, emit at :1081-1084)
- kernel/api/filetree.go:1087 getShorthandSavePath    (global source at :1098-1108, emit at :1122-1125)
- kernel/api/filetree.go:993  getDocCreateSavePath     (folds in global box via
    kernel/model/file.go:1405-1407 ResolveDocCreateSaveLocation, emit at :1027-1031)
Route registration (base auth only): kernel/api/router.go:165-167
Contrast with the project's own gated pattern:
    kernel/api/av.go:1359-1369 (CheckAttributeViewBlockAccessableByPublishAccess)

Impact

An attacker needs only read-only publish access to the running instance, which is granted to anonymous visitors when the publish site is configured without a password. The disclosed data is the box ID (an opaque node identifier that encodes a creation timestamp) of the notebook designated as the global reference, shorthand, or document save target, plus the administrator-authored save-path template string. When that global save target is a notebook the administrator has not published, the reader learns the existence, identity, and creation time of a notebook that is otherwise hidden from readers, which is a cross-boundary metadata disclosure. The leak is conditional on non-default administrator configuration: by default all three global save-box fields are empty, in which case each handler resolves the target back to the caller's own notebook and no cross-boundary data is returned. No document content, notebook name, or filesystem path is disclosed, and the leaked identifier does not by itself unlock content endpoints, which enforce their own access checks.

Proof of Concept

`Preconditions: the instance is running in publish mode, and an administrator has set a global save box (for example the reference-create save notebook) to a notebook that is open but not published. A read-only publish session or, for a passwordless publish site, an anonymous request is sufficient.`

  1. Obtain a read-only publish session (or none, for a passwordless publish site).
  2. POST to the reference save-path resolver with any open notebook ID as the `notebook` argument.
  3. Read the returned `box` field: it is the box ID of the globally configured (unpublished) save notebook.
POST /api/filetree/getRefCreateSavePath
Content-Type: application/json

{"notebook": "<any-open-notebook-id>"}
{
  "code": 0,
  "msg": "",
  "data": {
    "box":  "20260101093000-abcd123",   // box ID of the global (unpublished) save notebook
    "path": "/2026/09/16"                 // rendered save-path template string
  }
}

Attack Chain

  1. Exposure: The routes `/api/filetree/getRefCreateSavePath`, `/api/filetree/getShorthandSavePath`, and `/api/filetree/getDocCreateSavePath` ship registered with the base authentication middleware only (`kernel/api/router.go:165-167`); sibling filetree mutators additionally attach admin and read-only guards, but these resolvers do not.
  2. Control: The attacker supplies the `notebook` argument. The handler does not require it to match any authorized scope; it is used only to look up per-notebook configuration before the global fallback runs.
  3. Path: The base auth middleware admits the read-only role (`kernel/model/session.go:210-219` accepts `RoleReader`), so a publish reader reaches the handler body. With empty per-notebook config the handler substitutes the global save box (`kernel/api/filetree.go:1052-1054` and `:1098-1108`; `kernel/model/file.go:1405-1407` for the document resolver).
  4. Guard: No publish-access filter is invoked anywhere in the three handler bodies (`kernel/api/filetree.go:993-1126`); only availability and open-state checks exist. This is the missing authorization.
  5. Primitive: The handler emits `{box, path}` (`kernel/api/filetree.go:1081-1084`, `:1122-1125`, `:1027-1031`), returning the global save-box ID and rendered path template to the reader.
  6. Result: The reader obtains the box ID, and therefore the existence and creation timestamp, of a notebook the administrator has not published, crossing the publish trust boundary for notebook metadata.

Bypass Evidence

The finding was tested against both a false-positive and a higher-severity hypothesis, and the vulnerable path was walked edge by edge in the released artifact.

The strongest false-positive argument is that a box ID is not secret because a reader can already enumerate notebook IDs. This does not hold: SiYuan treats unpublished-notebook identity and metadata as a protected boundary, enforced by dedicated publish-access checks elsewhere in the code, and no reader-reachable endpoint discloses the IDs of unpublished notebooks in default publish scope. Learning the ID of an unpublished but open save box is therefore a genuine boundary crossing. The three handler bodies at `kernel/api/filetree.go:993-1126` were read in full and contain no publish-access call, in contrast to the attribute-view siblings at `kernel/api/av.go:1359-1369` that do enforce one.

A higher-severity hypothesis (server-side template injection or database read through the rendered save-path template) was refuted: the template content originates from administrator configuration, not from the reader, who controls only the notebook argument, so no query injection is reachable through this path. A chaining hypothesis (feeding the leaked box ID to content endpoints) was also refuted, because those endpoints enforce their own access checks and are separate matters. No prior fix exists for these handlers, so this is not an incomplete-fix or regression case.

Affected Versions

  • `Ecosystem: Go`
  • `Package: github.com/siyuan-note/siyuan/kernel`
  • `Confirmed affected range: <= 3.8.3`
  • `Latest release checked: 3.8.3 (git tag v3.8.3, commit 8641553a1f07374001902d3ce773285db1292b2d, released 2026-09-07)`
  • `Fix status: not fixed`

The vulnerable handlers are present and reachable in the latest stable release, v3.8.3; v3.8.4 exists only as alpha and beta prereleases and is out of the stable channel. The introduction boundary was not established from the available shallow checkout, so the lower bound is left open and the upper bound reflects the latest verified stable artifact.

Suggested Fix

Enforce a publish-access authorization check inside each of the three resolvers before returning the global save-box ID, mirroring the per-object publish-access pattern the project already applies to attribute-view reads. When the caller holds a read-only publish role, the handler should not disclose the identity of a globally configured save notebook that the caller is not authorized to view; it should instead resolve the save target to a notebook within the caller's authorized scope, or omit the box ID and path from the response. The check must cover all three endpoints, including the document-create resolver whose global fallback runs through `ResolveDocCreateSaveLocation`. As an interim mitigation, administrators can leave the global reference, shorthand, and document save-box settings empty, or avoid pointing them at an unpublished notebook, which prevents the cross-boundary disclosure without a code change.

Reported by zx (GitHub: @manus-pi).

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:L
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida
github.com/siyuan-note/siyuan/kernel≤ 3.8.4
3.8.4
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Gogithub.com/siyuan-note/siyuan/kernel
Sin parche — — —
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/siyuan-note/siyuan/security/advisories/GHSA-2mrf-mx66-vv6g

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.