GHSA-RX4H-526Q-4458

Vulnerability from github – Published: 2026-03-31 23:28 – Updated: 2026-03-31 23:28
VLAI?
Summary
SiYuan: Stored XSS in Attribute View Gallery/Kanban Cover Rendering Allows Arbitrary Command Execution in Desktop Client
Details

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:

  1. IsPossiblyImage(assetPath) accepts arbitrary http(s) URLs without validating that they are safe image URLs.
  2. When an Attribute View card uses Cover From -> Asset Field, the application copies asset.Content directly into galleryCard.CoverURL / kanbanCard.CoverURL.
  3. The front-end renderer inserts coverURL directly into <img src="${getCompressURL(item.coverURL)}"> without escaping quotes or other attribute-breaking characters.
  4. A payload such as https://example.com/" onerror="require('child_process').exec('calc') breaks out of the src attribute and adds an attacker-controlled onerror handler. When the image fails to load, the injected JavaScript runs in the Electron renderer. Because the desktop app enables nodeIntegration: true and disables contextIsolation and webSecurity, that JavaScript can access Node.js APIs and execute system commands.

PoC

  1. Install Electron Desktop app.
  2. Create a database / Attribute View with an mAsset column and add at least one row.
  3. Add any legitimate image to that mAsset field so the entry is stored as type image.
  4. Switch the view to Gallery or Kanban. 5.Set Cover From to Asset Field and choose the mAsset column.
  5. Edit the existing image asset entry and replace its link with the following payload:
https://example.com/" onerror="require('child_process').exec('calc')
  1. Save the change and reopen or refresh the Gallery / Kanban view.
  2. 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.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 3.6.1"
      },
      "package": {
        "ecosystem": "Go",
        "name": "github.com/siyuan-note/siyuan/kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.6.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-34448"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-31T23:28:23Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "### Summary\nAn 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 \u201cCover From -\u003e Asset Field\u201d 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 `\u003cimg src=\"...\"\u003e` 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\u2019s account.\n\n### Details\nThe vulnerable flow is:\n\n1. `IsPossiblyImage(assetPath)` accepts arbitrary `http(s)` URLs without validating that they are safe image URLs.\n2. When an Attribute View card uses `Cover From -\u003e Asset Field`, the application copies `asset.Content` directly into `galleryCard.CoverURL / kanbanCard.CoverURL`.\n3. The front-end renderer inserts `coverURL` directly into `\u003cimg src=\"${getCompressURL(item.coverURL)}\"\u003e` without escaping quotes or other attribute-breaking characters.\n4. A payload such as `https://example.com/\" onerror=\"require(\u0027child_process\u0027).exec(\u0027calc\u0027)` breaks out of the `src` attribute and adds an attacker-controlled `onerror` handler.\nWhen the image fails to load, the injected JavaScript runs in the Electron renderer. Because the desktop app enables `nodeIntegration: true` and disables `contextIsolation` and `webSecurity`, that JavaScript can access Node.js APIs and execute system commands.\n\n### PoC\n1. Install Electron Desktop app.\n2. Create a database / Attribute View with an mAsset column and add at least one row.\n3. Add any legitimate image to that mAsset field so the entry is stored as type image.\n4. Switch the view to Gallery or Kanban.\n5.Set Cover From to Asset Field and choose the mAsset column.\n6. Edit the existing image asset entry and replace its link with the following payload:\n```\nhttps://example.com/\" onerror=\"require(\u0027child_process\u0027).exec(\u0027calc\u0027)\n```\n7. Save the change and reopen or refresh the Gallery / Kanban view.\n8. Observe that the rendered HTML contains an injected onerror handler and the Calculator application starts on Windows.\n\nExample rendered output:\n```html\n\u003cimg loading=\"lazy\" class=\"av__gallery-img\" src=\"https://example.com/\" onerror=\"require(\u0027child_process\u0027).exec(\u0027calc\u0027)\"\u003e\n```\n### Impact\nAn 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\u2019s local user privileges, which turns this into remote code execution on the desktop application once the malicious content is delivered and rendered.",
  "id": "GHSA-rx4h-526q-4458",
  "modified": "2026-03-31T23:28:23Z",
  "published": "2026-03-31T23:28:23Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-rx4h-526q-4458"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/siyuan-note/siyuan"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "SiYuan: Stored XSS in Attribute View Gallery/Kanban Cover Rendering Allows Arbitrary Command Execution in Desktop Client"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…