CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-99RQ-75J6-5J9F

GHSA-99rq-75j6-5j9f: Stored and Reflected XSS in SiYuan via SVG Sanitizer Bypass

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 3, 2026·5 min read·2 visits

Executive Summary (TL;DR)

An HTML vs XML parser differential in the SiYuan SVG sanitizer allows attackers to inject and execute arbitrary JavaScript within the application's origin, bypassing default security controls.

A stored and reflected Cross-Site Scripting (XSS) vulnerability was identified in the SiYuan kernel before version v3.7.3. The flaw occurs due to a parser differential between the backend Go-based HTML sanitizer and the browser-side XML rendering engine. Attackers can bypass the SVG sanitizer to execute arbitrary JavaScript within the context of the application's origin, leading to complete workspace compromise, data exfiltration, and full local kernel API manipulation.

Vulnerability Overview

The SiYuan application kernel (github.com/siyuan-note/siyuan/kernel) provides core synchronization and data storage capabilities for the note-taking application. To handle customized assets safely, the application exposes endpoints that process and serve SVG content. Because SVGs can natively execute JavaScript inside browsers via inline tags and attributes, the application relies on an SVG sanitization function, util.SanitizeSVG, to clean incoming graphics. This function is tasked with removing unsafe elements prior to storage or display.

Historically, the application utilized an HTML-based sanitization parser. While this logic successfully stripped common malicious tags under standard HTML conditions, it introduced a significant parser differential when handling SVG document structures. The mismatch between the Go-based HTML parser and the browser's XML-based renderer created a structural blind spot that allowed attackers to inject executable script components.

The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation) and carries a CVSS 3.1 base score of 8.7. The impact of successful exploitation is severe, as it permits unauthorized script execution within the application's origin, which enables local file access, workspace cloning, and administrative API calls.

Root Cause Analysis

The root cause of this vulnerability lies in a parser differential between the server-side HTML parser (html.Parse in Go) and the browser-side XML/SVG parser. The original sanitization routine in kernel/util/misc.go processed incoming SVGs by treating them as HTML documents. It traversed the resulting node tree to locate and drop blacklisted tags. Because the parser operated on HTML syntax rules, it followed distinct element-nesting behaviors defined by the HTML5 specification.

In the HTML specification, tags such as <desc> and <title> represent HTML integration points. When an HTML parser encounters these tags, it temporarily transitions back to standard HTML parsing. Inside this HTML context, tags like <style>, <noscript>, and <xmp> are defined as raw text elements. The parser processes their inner content as a literal, unparsed string rather than as child nodes. As a result, if an attacker nested a <script> tag inside a <style> tag, which was further nested inside a <desc> tag, the backend HTML parser did not recognize the nested script as an element node. The sanitizer saw only a harmless text block inside a <style> element and allowed the structure to pass through unchanged.

Conversely, when a modern web browser receives the sanitized SVG payload, it renders the content as image/svg+xml using a strict XML parser. Under XML rules, raw text elements like <style> inside <desc> do not trigger literal parsing exceptions. The browser evaluates the structure of the entire document node-by-node. It parses the nested <script> tag as a valid executable element and runs the payload within the target origin.

Code Analysis and Patch Review

The vulnerability was resolved in commit f08dee71ba8e087a395d74f121de11e6a997ef14 by restructuring the parsing architecture of util.SanitizeSVG to eliminate the differential.

The developers abandoned the HTML-based parsing logic and implemented a strict, token-based XML decoder using Go's standard library encoding/xml. This ensures that the server evaluates SVG elements using the same hierarchical structure that the browser's XML parser utilizes.

// Patched logic in kernel/util/misc.go
func SanitizeSVG(svgInput string) (string, error) {
    decoder := xml.NewDecoder(strings.NewReader(svgInput))
    decoder.Strict = true
 
    var buf bytes.Buffer
    encoder := xml.NewEncoder(&buf)
    
    // The parser now tracks nested tokens sequentially and rejects blacklisted tags.
    for {
        token, err := decoder.Token()
        if err == io.EOF {
            break
        }
        if err != nil {
            return "", err
        }
        
        switch se := token.(type) {
        case xml.StartElement:
            // Unsafe tags are rejected explicitly
            if _, unsafe := unsafeSVGElements[strings.ToLower(se.Name.Local)]; unsafe {
                continue
            }
            se.Attr = sanitizeSVGAttributes(se.Attr)
            token = se
        }
        encoder.EncodeToken(token)
    }
    encoder.Flush()
    return buf.String(), nil
}

Additionally, defense-in-depth measures were introduced in kernel/api/icon.go to explicitly escape dynamic inputs and inject a strict Content Security Policy (CSP). The header Content-Security-Policy: script-src 'none'; object-src 'none'; base-uri 'none' is now returned when serving inline SVGs, preventing script execution even if a bypass occurs within the parsing engine.

Exploitation Methodology

An attacker can exploit this parser differential using two primary delivery mechanisms.

Vector 1: Reflected Attack via Dynamic Icons The /api/icon/getDynamicIcon endpoint allows clients to retrieve dynamically generated SVGs. When the parameter type is set to 8, the endpoint injects the user-provided string inside the content parameter into the SVG template. Because the original input sanitization parsed this with the vulnerable HTML sanitizer, an attacker could supply a crafted string that triggers the parser differential. When a victim loads the engineered link, the payload executes instantly in their browser context.

curl -sk -G 'http://127.0.0.1:6806/api/icon/getDynamicIcon' \
  --data-urlencode 'type=8' \
  --data-urlencode 'content=</text><desc><style><script>alert(document.domain)</script></style></desc><text>'

Vector 2: Stored Attack via Assets Directory Alternatively, an attacker can upload or synchronize a malicious SVG file (such as evil.svg) directly into the data/assets/ folder. This is achieved via authorized workspace synchronization, template importing, or zip-based restore functions. When any user attempts to view the resource through /assets/evil.svg, the browser interprets the XML structure, bypassing the sanitizer and running the script. The script can perform silent backend requests, capture application data, and send it to an external controller.

Impact Assessment

The impact of arbitrary script execution within the SiYuan application is significant due to its system architecture. SiYuan often runs locally as an Electron application or a self-hosted server with extensive REST API endpoints. The web origin has access to local kernel APIs that manage file systems, cloud synchronization, and system configurations.

A successful exploit can allow an attacker to make authorized POST requests to /api/system/getConf to obtain API keys, database credentials, and sync passwords. The execution scope allows the attacker to read, modify, or delete any markdown document within the workspace. Because the application processes requests with local user permissions, an attacker can also leverage the compromised web context to exfiltrate database records to external command-and-control servers, achieving complete workspace takeovers.

Official Patches

SiYuanFix SVG sanitization bypass vulnerabilities

Fix Analysis (1)

Technical Appendix

CVSS Score
8.7/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
EPSS Probability
0.27%
Top 82% most exploited

Affected Systems

SiYuan Kernel (before v3.7.3)SiYuan Desktop Application (before v3.7.3)SiYuan Self-Hosted Docker Instances (before v3.7.3)

Affected Versions Detail

Product
Affected Versions
Fixed Version
SiYuan
SiYuan
< v3.7.3v3.7.3
AttributeDetail
CWE IDCWE-79
Attack VectorNetwork
CVSS v3.18.7 (High)
CVSS v4.09.3 (Critical)
Exploit Statuspoc
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1189Drive-by Compromise
Initial Access
T1185Browser Session Hijacking
Collection
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The application does not neutralize or incorrectly neutralizes user-controlled input before it is placed in a web page served to other users.

Known Exploits & Detection

VulnCheckVulnerability assessment and analysis of stored/reflected XSS vectors inside SiYuan SVG sanitizers.

References & Sources

  • [1]GHSA-99rq-75j6-5j9f
  • [2]SiYuan v3.7.3 Release Notes

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•18 minutes ago•CVE-2026-71869
9.3

CVE-2026-71869: Remote Code Execution in Orval via OpenAPI Default Value Template Literal Injection

CVE-2026-71869 is a critical-severity code injection vulnerability in the Orval code generator (packages: orval, @orval/core, @orval/zod) prior to version 8.21.0. This flaw allows remote attackers to execute arbitrary JavaScript code at import-time by embedding malicious payloads into the default values of OpenAPI or Swagger specifications. This report details the root cause, exploitation mechanism, and patch remediation.

Amit Schendel
Amit Schendel
0 views•7 min read
•about 1 hour ago•CVE-2026-61625
6.8

CVE-2026-61625: Arbitrary File Write via Path Traversal in VictoriaMetrics vmrestore

CVE-2026-61625 is a path traversal vulnerability (CWE-22) within the `vmrestore` utility of VictoriaMetrics. When restoring database shards from a compromised or malicious backup source, the application fails to validate the paths of backup parts before creating and writing files. By injecting objects with directory traversal sequences (such as `../`) into the remote backup storage, an attacker can write arbitrary files to out-of-bounds locations on the system executing the restore operation. Depending on the process privileges, this can result in host compromise via remote code execution.

Amit Schendel
Amit Schendel
3 views•6 min read
•about 2 hours ago•CVE-2026-73846
6.5

CVE-2026-73846: Cache Key Canonicalization Collision in ondata ckan-mcp-server

A medium-severity cache key canonicalization collision vulnerability exists in the ckan-mcp-server prior to version 0.4.112. Unescaped delimiters in key-value parameters and server URLs allow structurally distinct requests to map to the same cryptographic hash, facilitating cache poisoning and unauthorized data exposure.

Alon Barad
Alon Barad
3 views•7 min read
•about 4 hours ago•GHSA-GW25-M53R-QH88
6.5

GHSA-gw25-m53r-qh88: Path Traversal Bypass in SiYuan Notebook via /export/temp/ Short-Circuit Branch

An incomplete mitigation in the export-handling logic of SiYuan Notebook allowed authenticated users to bypass directory traversal protections. By crafting a request with percent-encoded path navigation sequences targeting the /export/temp/ route prefix, attackers can trigger an unvalidated short-circuit block that serving arbitrary files from the host server. This bypass renders previous path-traversal mitigations ineffective for the affected endpoint.

Amit Schendel
Amit Schendel
5 views•5 min read
•about 5 hours ago•CVE-2026-62669
7.4

CVE-2026-62669: Critical Two-Factor Authentication Bypass in Grav CMS Login Plugin

CVE-2026-62669 is a critical Improper Authentication vulnerability (CWE-287) in the Grav Login Plugin for Grav CMS. Prior to version 3.8.11, the plugin's key rotation task failed to verify if a user session was fully authorized before regenerating and returning two-factor authentication (2FA) secrets. Consequently, an attacker possessing a victim's primary credentials could invoke this endpoint to replace the 2FA secret, retrieve the replacement, and bypass the MFA constraint entirely.

Amit Schendel
Amit Schendel
2 views•8 min read
•about 6 hours ago•CVE-2026-63435
5.3

CVE-2026-63435: Parser Interpretation Conflict in Ruby Mail Gem RFC 2047 Decoders

An interpretation conflict (CWE-436) exists in the Ruby 'mail' library's RFC 2047 decoding implementation. Vulnerable versions utilize regular expressions with overly greedy qualifiers and a singular matching strategy. When parsing malformed headers, these design flaws trigger unexpected exception-handling behaviors, outputting raw, unparsed strings. Consequently, intermediate security gateways and downstream Ruby processors interpret email addresses differently, enabling authentication bypasses, phishing, and header spoofing.

Alon Barad
Alon Barad
4 views•5 min read