CVE-2026-50551: SiYuan: Stored XSS to RCE via Unsanitized Attribute View Asset Cell Content

Published Jun 24, 2026
·
Updated

SiYuan is an open-source personal knowledge management system. Prior to 3.7.0, SiYuan contains a stored cross-site scripting (XSS) vulnerability in the Attribute View (database) asset cell renderer that escalates to remote code execution (RCE) in the Electron desktop client. This vulnerability is fixed in 3.7.0.

Other sources

SiYuan v3.6.5 and earlier versions contain a stored cross-site scripting (XSS) vulnerability in the Attribute View (database) asset cell renderer that escalates to remote code execution (RCE) in the Electron desktop client. This is a neighbor-bug of CVE-2026-44588: the fix for -44588 used escapeAriaLabel() (double-escapes <), but the AV asset renderers were left using the weaker escapeAttr() (escapes only quotes) or no escaping at all.

## Vulnerability Details

The Electron renderer is configured with nodeIntegration: true and contextIsolation: false (app/electron/main.js:307), allowing any JavaScript executing in the renderer to directly access Node.js APIs including require('childprocess').

Two XSS sinks exist.

### Sink 1 (Direct Stored XSS - triggers on page load)

app/src/protyle/render/av/cell.ts:1008:

text += <span class="b3-chip avcelltext--url ariaLabel" aria-label="${escapeAttr(item.content)}" data-name="${escapeAttr(item.name)}" data-url="${escapeAttr(item.content)}">${item.name || item.content}</span>;

The >${item.name || item.content}</span> portion is raw user input with zero escaping.

app/src/protyle/render/av/blockAttr.ts:93 (even worse - completely unescaped):

html += <img loading="lazy" class="avcellassetimg ariaLabel" aria-label="${item.content}" src="${getCompressURL(item.content)}">;

Rendered via action.ts:860: cellElement.innerHTML = renderCell(...) results in immediate XSS on page load.

### Sink 2 (Hover-triggered XSS via aria-label round-trip)

- Same lines emit aria-label="${escapeAttr(item.content)}" on .ariaLabel elements. - escapeAttr() (util/escape.ts:14) escapes only " and ' — NOT < or >. - popover.ts:33 global mouseover handler reads aria-label via getAttribute (which attribute-decodes entities). - Line 144: showTooltip(decodeURIComponent(tip), ...) then tooltip.ts:41: messageElement.innerHTML = message results in XSS on hover.

### Source

- app/src/protyle/render/av/asset.ts:405: addAssetLink() reads user input from a free-form <textarea> with no sanitization. - Kernel stores MAsset.Content raw (kernel/av/value.go:53), no server-side sanitization.

## Attack Vector

1. Attacker creates a malicious note containing an Attribute View (database). 2. Attacker adds an asset cell with link content: <img src=x onerror=require('childprocess').exec('calc')> 3. Victim opens the note for immediate RCE (Sink 1), or hovers over the cell for RCE (Sink 2). 4. In a sync/collaboration scenario, the malicious note propagates to all users.

## Proof of Concept

Payload (Direct XSS) — in an AV asset cell link field, enter:

<img src=x onerror=alert(document.domain)>

For RCE in Electron desktop:

<img src=x onerror=require('childprocess').exec('calc')>

### Steps to Reproduce

1. Open SiYuan desktop app (v3.6.5). 2. Create a new document. 3. Insert an Attribute View (database): / then select "Table". 4. Add a column of type "Asset". 5. Click the asset cell, then "Add Link". 6. In the "Link" textarea, paste: <img src=x onerror=alert(1)> 7. Leave "Title" empty or fill with benign text. 8. Click outside the dialog to save. 9. Observe: Alert fires immediately (Sink 1). Hovering over the cell also triggers (Sink 2).

## Impact

- Remote Code Execution on victim's system via malicious note sync/import. - Data exfiltration: attacker can read all notes, access filesystem, steal credentials. - Persistence: malicious payload stored in .sy files, executes on every open.

## Suggested Fix

1. Replace escapeAttr() with escapeAriaLabel() for all aria-label attributes in AV cell renderers. 2. Escape item.name and item.content with escapeHtml() before concatenating into element text content.

Affected files: app/src/protyle/render/av/cell.ts, app/src/protyle/render/av/blockAttr.ts, app/src/protyle/render/av/asset.ts.

## Additional Context

This vulnerability is a neighbor-bug of CVE-2026-44588. The fix for -44588 correctly used escapeAriaLabel() (which double-escapes < to survive the attribute -> getAttribute -> innerHTML round-trip), but the AV asset cell renderers were left using the weaker escapeAttr() or no escaping. This is part of a pattern of incomplete fixes in SiYuan (see also CVE-2026-33066, CVE-2026-29183). The long-term fix should set ElectroncontextIsolation: true and nodeIntegration: false.

## Report Reporter (GitHub: Yunkaiwjs).

GitHub

Affected Software

2 affected componentsFixes available
SiYuan SiYuan<3.7.0
go/github.com/siyuan-note/siyuan/kernel<0.0.0-20260628153353-2d5d72223df4
0.0.0-20260628153353-2d5d72223df4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/siyuan-note/siyuan/kernel to a version that resolves this vulnerability.

    Fixed in 0.0.0-20260628153353-2d5d72223df4
  2. Upgrade

    Upgrade SiYuan to a version that resolves this vulnerability.

    Fixed in 3.7.0
  3. Configuration

    Replace the use of escapeAttr() (and any missing/no escaping) with escapeAriaLabel() for all aria-label attributes in AV cell renderers, so that rendered attribute values are safe against the aria-label getAttribute -> innerHTML round-trip described in the vulnerability.

    SiYuan Attribute View (AV) cell renderers aria-label escaping function = escapeAriaLabel()
  4. Configuration

    Configure Electron with nodeIntegration: false and contextIsolation: true (currently nodeIntegration: true and contextIsolation: false per app/electron/main.js:307) to prevent renderer-executed JavaScript from directly accessing Node.js APIs (e.g., require('child_process')).

    Electron (SiYuan desktop client) nodeIntegration and contextIsolation = nodeIntegration: false; contextIsolation: true
  5. Configuration

    Ensure item.name and item.content from the Attribute View asset cell renderer are escaped with escapeHtml() before concatenating into the DOM, rather than injecting `${item.name || item.content}` or other user-controlled values into HTML/innerHTML without proper escaping.

    SiYuan AV asset cell rendering innerHTML usage for cell content = use escaped text content (escapeHtml()) instead of raw HTML concatenation
  6. Configuration

    When building link elements from the free-form <textarea> (asset link input), escape the user input with escapeHtml() before inserting it into element text/HTML, preventing stored XSS in the .sy note files.

    SiYuan AV link handling (asset add-link dialog) link textarea input sanitization = escapeHtml() before DOM insertion

Event History

Jun 24, 2026
CVE Published
via MITRE·09:20 PM
Data Sourced
via MITRE·09:20 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:16 PM
DescriptionSeverityWeakness
Jul 10, 2026
Advisory Published
via GitHub·08:37 PM
Data Sourced
via GitHub·08:37 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-50551?

CVE-2026-50551 has a critical severity rating of 9.9.

2

How do I fix CVE-2026-50551?

To fix CVE-2026-50551, update SiYuan to version 3.7.0 or later.

3

What type of vulnerability is CVE-2026-50551?

CVE-2026-50551 is a stored cross-site scripting (XSS) vulnerability that escalates to remote code execution (RCE).

4

Who is affected by CVE-2026-50551?

CVE-2026-50551 affects users of SiYuan prior to version 3.7.0.

5

What are the potential impacts of CVE-2026-50551?

CVE-2026-50551 can lead to remote code execution if exploited, allowing attackers to execute malicious code on the affected system.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203