Skip to content
GHSA 7258 5hpf Xq6w

GHSA 7258 5hpf Xq6w

github.com • November 28, 2026

On SiYuan 3.8.9, an unauthenticated network attacker who can alter a response on the victim’s already-configured cleartext HTTP WebDAV connection can put event-handler markup in a malformed-response-header error. The victim must manually start sync: the first automatic failure updates sync status but emits no notification. The shipped manual sync route sends the error to the local main-session notification renderer, where Electron Node integration executes the handler with the logged-in user’s privileges. Matched trigger and control runs confirm the marker executes only for the trigger. This evidence covers cleartext HTTP and does not show a TLS failure or attacker-selected endpoint.

In the pinned 3.8.9 source, a WebDAV download can return an untyped Go HTTP response-parser error. formatRepoErrorMsg first escapes err.Error() , then checks the escaped string for is being used by another . When that text is present, the fallback formats the original error instead of the escaped value. A malformed response header can therefore carry raw HTML through the sync-error message.

The sync error is broadcast to the main browser session as a cmd=msg notification. The production processMessage.ts dispatcher calls showMessage in message.ts ; in local-kernel mode sanitizeKernelHTML in hostCapabilities.ts leaves the message unchanged, and the notification renderer parses it as HTML. The Electron test enables the same Node integration and context settings used by the desktop main renderer.

The integration test sends matched malformed responses from a cleartext HTTP WebDAV fixture. It invokes the normal POST /api/sync/performSync route and loads the pinned SiYuan dispatcher, notification renderer, and sanitizer modules in Electron. The trigger reaches the notification and writes a benign marker using Node. The control changes only the trigger phrase, follows the same route, and does not write the marker. Both cases confirm that the first automatic failure emits no notification.

The fixture returns a malformed header like this:

For the control, the response is identical except is being used by another is replaced with unrelated . The Go HTTP client rejects the malformed header. The trigger enters the formatter branch that returns the raw error; the control takes the ordinary escaped path.

The complete Go integration test and its malformed-response HTTP fixture are included in Appendix A. A self-contained runner for the tested reproduce mode is included in Appendix B. In the pinned checkout, save those exact contents as webdav-notification-repro_test.go and run-webdav-notification-repro.sh in the checkout root. The fixture is embedded in the Go test, so a separate fixture file is not needed.

Use the SiYuan source pinned to revision d3af9d5782082b379d45a69eedf4ebcfe8ba6889 . Requirements are Go 1.26.10, Node.js with npm, Corepack with pnpm 12.6.0, and the Linux runtime libraries required by Electron. The runner obtains TypeScript 6.0.2 from the configured npm registry, and Go obtains missing modules from the configured Go module proxy.

From the checkout root, save the two appendix files under the filenames above, then run:

The sha256sum command prints 4b5040c9a851b0d54ea6e1e268c08b5e7ccd68e0e245b757e4bb25a78fd1527f webdav-notification-repro_test.go ; each run emitted the same COMPILED_E2E_TEST_SOURCE_SHA256 , confirming the runner compiled the submitted source unchanged. The output below shows the exact assertion values emitted by that source and runner; test prefixes, the automatic failure detail, and unrelated diagnostics are omitted.

The test output and marker are from Linux ARM64 with Go 1.26.10, Electron 44.10.0, and Node.js 24.22.1.

CWE-79: Improper Neutralization of Input During Web Page Generation. A network attacker who can modify traffic to the victim’s configured cleartext HTTP WebDAV endpoint can cause JavaScript execution in SiYuan’s desktop main renderer when the victim manually starts sync. With Node integration enabled, that code can access local notes and files or run commands as the logged-in user. The demonstrated effect is in version 3.8.9; the first affected version and a fixed version are not established.

CVSS 3.1: High (8.3) — CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H . This is a conservative assessment: AC:H reflects the need to alter a response on an already-configured cleartext HTTP connection, and UI:R reflects the victim’s required manual sync action. No SiYuan credentials are needed ( PR:N ). The response crosses into the local desktop renderer ( S:C ), where Node integration supports high confidentiality, integrity, and availability impact.

Keep untrusted error text escaped through every formatting branch. In particular, format the fallback from the escaped value rather than the original error. Also treat sync-error messages as text at the final notification boundary, or apply a strict allowlist sanitizer there. Add regression coverage for a malformed HTTP response header containing the trigger phrase and event-handler markup, and verify the rendered notification cannot execute it.

Affected Package/Versions

SiYuan desktop and kernel, version 3.8.9 at the pinned source revision.

This evidence does not establish the first affected version or a patched version.

The public comparison is non-exhaustive. The closest related desktop code-execution precedents include GHSA-2cmm-9x9j-rvff , where attacker-controlled plain-text Kramdown IAL is pasted into the editor and reaches an unescaped data-subtype value in gutter-button markup after paste and gutter rendering; its fix surface is gutter-button attribute construction, using attribute escaping or DOM setters. GHSA-2mmf-4xwm-55rm starts from stored flashcard block content returned by /api/riff/getRiffCards and reaches listElement.innerHTML in the desktop card manager; its fix surface is text-context escaping or assigning card content with textContent . These advisories therefore involve distinct editor-paste/gutter and stored-card/card-manager paths and fix surfaces. GHSA-556j-q8c8-qqg3 concerns stored gallery/kanban database field descriptions rendered as HTML in those views, not generic table rendering. GHSA-grjj-6f6g-cq8q describes an administrator-authenticated notification API issue affecting versions through 3.6.4 and fixed in 3.6.5; it does not begin with WebDAV response bytes. GHSA-phhp-9rm9-6gr2 covers synced-caption rendering. None of these examples follows the malformed WebDAV response header through the sync-error formatter into the main-session notification renderer.

The related public sync issues #20761 , “Improve WebDAV sync failure messages by recognizing HTTP status codes,” and #20330 , “Windows sync ‘Access is denied’ failures bypass the localized permission message,” error details and permission-message localization. Neither describes attacker-controlled HTML or renderer execution.

I checked 12 earlier SiYuan reports that were ready for review. The closest, “Authenticated Reader WebSocket Receives Administrator Cloud UserToken,” concerns an authenticated Reader receiving a cloud token over the ordinary main WebSocket after an administrator refresh. It does not involve a malformed WebDAV response, sync-error formatting, or execution in the local notification renderer. The other 11 reports concerned widget sensitive-path retrieval, loopback-proxy authentication on a history route, private-asset OCR text, a workspace credential, publish-asset authorization, Reader attribute-view SQL access, login-cookie and CAPTCHA reuse, protected block references in Markdown export, disabled attribute-view asset text, publish-password validation, and pre-authentication LAN sync metadata. There were no earlier submitted reports or completed-but-unsubmitted reports to compare.

Those findings involve file access, authorization, stored-secret or content disclosure, login behavior, or peer discovery. This issue requires response alteration on cleartext WebDAV, reaches a specific escaping fallback during a victim-started sync, and executes in the desktop notification renderer.

Pinned formatRepoErrorMsg source

Pinned automatic sync entry point

Pinned WebDAV endpoint validator and cleartext HTTP compatibility test

Pinned WebDAV download error path and automatic notification gate

Pinned notification broadcast

Pinned local-kernel sanitizer , notification renderer , and message dispatcher

Pinned Electron window settings

Pinned package version

Go http.ReadResponse documentation

Reproduction Appendices

Appendix A: Go integration test and HTTP fixture

Save this complete file as webdav-notification-repro_test.go in the pinned checkout root.

Appendix B: Reproduction runner

Save this complete reproduce-mode runner as run-webdav-notification-repro.sh in the pinned checkout root.