GHSA-rx4h-526q-4458
CRITICALSiYuan: Stored XSS in Attribute View Gallery/Kanban Cover Rendering Allows Arbitrary Command Execution in Desktop Client
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Blast Radius
github.com/siyuan-note/siyuan/kernelReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
An attacker who can place a malicious URL in an Attribute View mAsse field can trigger stored XSS when a victim opens the Gallery or Kanban view with “Cover From -> Asset Field” enabled. The vulnerable code accepts arbitrary http(s) URLs without extensions as images, stores the attacker-controlled string in coverURL, and injects it directly into an <img src="..."> attribute without escaping. In the Electron desktop client, the injected JavaScript executes with nodeIntegration enabled and contextIsolation disabled, so the XSS reaches arbitrary OS command execution under the victim’s account.
Details
The vulnerable flow is:
IsPossiblyImage(assetPath)accepts arbitraryhttp(s)URLs without validating that they are safe image URLs.- When an Attribute View card uses
Cover From -> Asset Field, the application copiesasset.Contentdirectly intogalleryCard.CoverURL / kanbanCard.CoverURL. - The front-end renderer inserts
coverURLdirectly into<img src="${getCompressURL(item.coverURL)}">without escaping quotes or other attribute-breaking characters. - A payload such as
https://example.com/" onerror="require('child_process').exec('calc')breaks out of thesrcattribute and adds an attacker-controlledonerrorhandler. When the image fails to load, the injected JavaScript runs in the Electron renderer. Because the desktop app enablesnodeIntegration: trueand disablescontextIsolationandwebSecurity, that JavaScript can access Node.js APIs and execute system commands.
PoC
- Install Electron Desktop app.
- Create a database / Attribute View with an mAsset column and add at least one row.
- Add any legitimate image to that mAsset field so the entry is stored as type image.
- Switch the view to Gallery or Kanban. 5.Set Cover From to Asset Field and choose the mAsset column.
- Edit the existing image asset entry and replace its link with the following payload:
https://example.com/" onerror="require('child_process').exec('calc')
- Save the change and reopen or refresh the Gallery / Kanban view.
- Observe that the rendered HTML contains an injected onerror handler and the Calculator application starts on Windows.
Example rendered output:
<img loading="lazy" class="av__gallery-img" src="https://example.com/" onerror="require('child_process').exec('calc')">
Impact
An attacker can store malicious content in a database asset field and execute arbitrary JavaScript when another user opens the affected Gallery or Kanban view. In the desktop client, that JavaScript has access to Node.js APIs, so the impact is not limited to browser-context XSS. The payload executes OS commands with the victim’s local user privileges, which turns this into remote code execution on the desktop application once the malicious content is delivered and rendered.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/siyuan-note/siyuan/kernel | all versions | 3.6.2 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/siyuan-note/siyuan/kernel. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update github.com/siyuan-note/siyuan/kernel to 3.6.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-rx4h-526q-4458 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-rx4h-526q-4458 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-rx4h-526q-4458. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-rx4h-526q-4458 in your dependencies?
O3 detects GHSA-rx4h-526q-4458 across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.