Skip to content

Attribute-view select option colors are stored unvalidated and interpolated into style attributes without escaping at eight render sites, allowing stored cross-site scripting

Critical
88250 published GHSA-m7cc-jh9q-wxg8 Aug 1, 2026

Package

gomod github.com/siyuan-note/siyuan/kernel (Go)

Affected versions

dev 52e2bcac5

Patched versions

v3.7.4

Description

CVE: This vulnerability corresponds to CVE-2026-73050.

Summary

The attribute-view store accepts arbitrary strings for a select option's colour, a field the kernel documents as a palette index in the range 1 to 14. Eight frontend render sites interpolate that value directly into a style attribute with no escaping. A quotation mark in the stored value terminates the attribute, allowing an event-handler attribute to be injected.

The affected render sites cover ordinary display of select and multi-select values, so the payload executes on viewing a database rather than on any deliberate menu interaction.

Details

The field is documented as a small integer and never validated. kernel/av/value.go:785 declares:

Color string // 1-14

No validation is applied on write. Confirmed against a running instance:

{"action":"updateAttrViewColOptions","id":"<keyID>","avID":"<avID>",
 "data":[{"name":"PWN","color":"1);color:red\" onmouseover=\"alert(1)\" x=\"","desc":""}]}
→ {"code":0}

renderAttributeView → {"name":"PWN","color":"1);color:red\" onmouseover=\"alert(1)\" x=\""}
on disk             → "color":"1);color:red\"...

Eight unescaped sinks. All of the form:

style="background-color:var(--b3-font-background${item.color});color:var(--b3-font-color${item.color})"
  • app/src/protyle/render/av/attributeValue.ts:139
  • app/src/protyle/render/av/cell.ts:1119
  • app/src/protyle/render/av/col.ts:141
  • app/src/protyle/render/av/filter.ts:696, :707, :709
  • app/src/protyle/render/av/render.ts:277
  • app/src/protyle/render/av/select.ts:43

The first quotation mark in the stored value closes the style attribute. What follows, onmouseover="alert(1)", is then parsed as a genuine event-handler attribute on the same element.

The neighbouring interpolations are escaped. Within the same template literals, ${escapeHtml(item.content)} and ${escapeAttr(item.name)} appear alongside the raw ${item.color}. The escaping helpers are present and in use; the colour field is simply not passed through them.

Reach. These sites render select and multi-select chips in table, gallery, kanban and relation views, and in the field-edit and filter menus. Opening a database that contains a select field is sufficient.

Consequence in the desktop application. app/electron/main.js sets nodeIntegration: true, contextIsolation: false and webSecurity: false on every window (lines 913, 1019-1022, 1933-1936, 2157, 2197, 2248), so script executing in a renderer reaches Node built-ins including require('child_process').

Scope of observation. The storage behaviour, the API response and the eight interpolation sites are confirmed as described. I have not observed handler execution in a running client, so the step from attribute injection to handler invocation is stated from the code rather than from a captured result.

Relationship to existing advisories. b3-font-background, updateAttrViewColOptions, item.color and --b3-font each appear in no published advisory for this project. GHSA-5rxg-* is the same class, an unescaped value reaching a style attribute, but concerns the title-img IAL attribute on the gallery and kanban cover image. That is a different field in a different store: IAL values are HTML-escaped on write, whereas attribute-view values are not, so the fix for that advisory cannot reach this field.

Proof of Concept

Set a select option's colour to a value containing a quotation mark:

POST /api/transactions
{"reqId":<numeric>, ... "action":"updateAttrViewColOptions",
 "data":[{"name":"PWN","color":"1);color:red\" onmouseover=\"alert(1)\" x=\"","desc":""}]}

→ {"code":0}

Confirm it is stored and served unmodified:

POST /api/av/renderAttributeView
→ color returned verbatim, quotation marks intact

Then open any view displaying that option.

Impact

A stored value under attacker control breaks out of a style attribute and injects an event handler wherever a select or multi-select option is rendered. Because the affected sites include ordinary table, gallery, kanban and relation rendering, no deliberate interaction with menus is required.

In the desktop client the renderer has Node integration enabled, so execution at that point is not confined to the page.

The value is written through a normal option-configuration operation, so any path by which a database reaches a victim, including import, synchronisation, a shared workspace or a distributed package, carries the payload.

Suggested fix

Apply escapeAttr to item.color at all eight sites.

More durably, enforce the documented contract in the kernel: Color is specified as a value in the range 1 to 14, so constraining it to that palette on write removes the field as an injection source entirely and neutralises any value already stored.

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

CVE ID

No known CVE

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

Credits