Skip to content
GHSA Xxqp 6jxw Qr84

GHSA Xxqp 6jxw Qr84

github.com • November 22, 2026

GET /assets/ can return a password-protected document's asset when a different visible document references the same relative name and resolution selects the protected file first. The shipped handler checks whether any visible document references the name, without binding that authorization to the document owning the resolved file. A route test sent an anonymous request through SiYuan's shipped PublishServiceTransport ; the shipped JWT middleware derived the Reader role, and the served route returned the protected canary with HTTP 200. A protected-only name returned HTTP 403 and a visible-only asset returned HTTP 200. This applies to public publishing with Basic Auth disabled; Basic Auth deployments require a valid Reader account.

The serveAssets route accepts GET /assets/*path after CheckAuth . With no box or dataPath selector, resolveAssetRequestPath delegates to GetAssetAbsPath , which selects a physical document-local asset file. For non-administrators, the handler then calls CheckAbsPathAccessableByPublishAccess before serving the file. That check scans documents allowed by publish access and returns true when any such document references the requested relative asset path. It does not verify that the document authorizing the relative name owns the physical file selected by the resolver. The route and handler , the asset resolver , and the publish-access check show the mismatch.

The violating fixture has a password-protected document containing assets/overlap.txt and a different public document referencing the same relative path. The resolver selects the protected file first. Because the public document also references assets/overlap.txt , the relative-path authorization check succeeds and the protected file is returned. A protected-only filename with no public reference remains denied, demonstrating that the flaw is the missing owner binding, not a general failure to enforce publish access.

The violated invariant is: publish authorization for an asset response must be based on the visibility of the document that owns the resolved physical file. The public publish transport supplies an anonymous Reader token when Basic Auth is disabled; when Basic Auth is enabled, it validates a session or Basic Auth credentials before forwarding the request. The production transport establishes those two modes.

The attacker requests GET /assets/overlap.txt on a public-publish service with Basic Auth disabled. A password-protected document and a separate visible document both reference assets/overlap.txt , and the protected document's file is the resolver's first match. The caller sends no X-Auth-Token or document-password cookie; PublishServiceTransport supplies the anonymous Reader token before the request reaches serveAssets .

The clean-checkout reproduction below creates the two-document fixture in an in-process HTTP test server and sends requests through the shipped PublishServiceTransport to the shipped serveAssets route, using the route's JWT middleware. It exercises the shipped transport and route; it does not start the full publish listener. The caller does not send an X-Auth-Token, and the fixture disables Basic Auth. The test prints the runtime details and these response lines:

The first response contains the protected file's bytes; the controls show that a protected-only name is denied and a visible-only file remains available.

A remote visitor to a public-publish instance with Basic Auth disabled can retrieve the contents of a password-protected document-local asset when a public document exposes the same relative asset name and resolver order selects the protected file. This crosses the publish-password confidentiality boundary and can disclose private asset contents; it does not provide integrity or availability impact. The metadata classifies the flaw as CWE-863, Incorrect Authorization, and records CVSS v3.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N (7.5 High). PR:N applies only to the supported public-publish mode with Basic Auth disabled. When Basic Auth is enabled, exploitation requires a valid low-privilege Reader account; this report does not claim an authentication bypass.

Resolve and authorize an asset as one operation that retains the owning document identity. Serve the file only if that owner is publish-visible and the request satisfies its password or disable-level rules; a same-named reference in another document must not authorize the resolved file. Add a regression test with colliding public and password-protected assets that forces each file to be the resolver's first match. The protected file must remain denied even when the public document references the same relative name, while public-only assets remain available and protected-only assets remain denied.

Affected Package/Versions

Package: Go module github.com/siyuan-note/siyuan/kernel .

Affected version established by the test: v3.8.8 , at revision bfe36100477b7bbd66db1a8b8cff5547b2ccdb59 .

Patched versions: None established. Only the exact tested release is claimed; other releases were not version-swept.

The module declaration is in kernel/go.mod , and the tested release tag is v3.8.8 .

GHSA-p4m3-mgmm-c664 describes double-encoded path traversal through /assets/*path , which could read workspace files in older versions. This report concerns a valid document-local asset name in a later tested revision: the resolver selects one document's file while the publish check authorizes the same name because another document references it. GHSA-fgmr-7w36-9qfq covers static-file routes that lack publish-access checks; serveAssets does perform a publish check, but that check is not bound to the resolved file's owner.

GHSA-48p5-pffc-5r9p concerns indexed asset-content endpoints that use the visible-document list instead of the publish-disabled list; its repair applies the disabled-access filter to those indexed-content results. GHSA-778g-gq49-fxxj concerns POST /api/export/preview , where Attribute View export serialized protected database rows without publish-access filtering; its repair applies publish-aware row filtering and redaction in the export path. Those sinks differ from this report's raw GET /assets/ response, where authorization must be bound to the owner of the resolved physical file.

GHSA-fq2j-j8hc-8vw8 and Issue #17236 describe an earlier raw-asset disclosure: pasting a file URL into global assets could expose it through an unguarded GET /assets route. PR #17242 added a publish-access guard to raw asset responses. This proof demonstrates a distinct post-fix owner-binding bypass: a different visible document references the same relative name, so authorization succeeds even though resolution selects the password-protected document's document-local file. The check must bind authorization to the owner of the resolved file.

Issue #20258 describes a performance problem in publish-reader emoji and widget resource access: each resource request can scan blocktrees and check document access, rather than disclosing protected raw asset bytes.

For this comparison, I checked the submitted, ready-for-review, and completed-but-unsubmitted local report groups.

Nine earlier local reports cover distinct causes and effects:

Missing Sensitive-Path Guard in Widget Package File Retrieval: a published widget package could return a credential-named file through POST /api/file/getFile because that package path skipped the sensitive-filename rule.

Loopback Proxy X-Forwarded-For Trust Enables Authentication Bypass on the History Route: a caller could spoof loopback forwarding headers and reach private history content through an authentication decision based on the proxy address.

Reader Attribute-View SQL Templates Expose Password-Gated Content: an Editor-controlled read-only SQL template could make Attribute View rendering return protected database text to a Reader.

Stale Signed Login Cookie Reuses CAPTCHA Challenge: an old signed session cookie retained a solved CAPTCHA challenge, allowing repeated access-code guesses after challenge rotation.

Reader Markdown Export Discloses Protected Block References: Markdown export could include protected text loaded through block-reference footnotes that bypassed the Reader publish filter.

Unfiltered Disabled Attribute-View Rows Expose Indexed Asset Text: an asset referenced only by a disabled Attribute View row could be listed and its indexed text returned by asset-content APIs.

Publish-Password Bypass via getDoc Regex Keywords: regex exposed protected document text in the keywords field while the document's main content remained password-gated.

LAN Sync Sends Device Metadata Before Authenticating Discovered Peers: a peer on the local network could receive the device's sync metadata before its server proof was validated.

Authenticated Reader WebSocket Receives Administrator Cloud UserToken: a Reader WebSocket received an administrator's cloud token in a broadcast event, while the corresponding Reader HTTP endpoint masked it.

These reports concern different routes, data, or authorization decisions. None describes a raw asset response where a same-named reference in another document authorizes the physical file selected from a password-protected document.

serveAssets and resolveAssetRequestPath at the tested revision

checkAssetPathAccessableByPublishAccess

PublishServiceTransport.RoundTrip

Go module declaration and tested tag v3.8.8

PR #17242: add publish-access guard for raw asset responses

GHSA-48p5-pffc-5r9p , GHSA-778g-gq49-fxxj , and Issue #20258

Appendix: Clean-checkout reproduction

From a shell with Git, Go, and network access for the module download:

Extracted Entities

Companies (1)