Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-32940

CVE-2026-32940: B3log Siyuan XSS Vulnerability

CVE-2026-32940 is a cross-site scripting flaw in B3log Siyuan that allows attackers to execute JavaScript through crafted SVG markup. This post explains its impact, affected versions, and mitigation steps.

Published: March 27, 2026

CVE-2026-32940 Overview

CVE-2026-32940 is a Cross-Site Scripting (XSS) vulnerability affecting SiYuan, a personal knowledge management system developed by B3log. The vulnerability exists in the SanitizeSVG function which implements an incomplete blocklist for data URI schemes in href attributes. While the blocklist properly blocks data:text/html and data:image/svg+xml, it fails to filter data:text/xml and data:application/xml MIME types, both of which can render SVG content with JavaScript execution capabilities.

The unauthenticated /api/icon/getDynamicIcon endpoint directly serves user-controlled input via the content parameter into SVG markup using fmt.Sprintf with no escaping, served with Content-Type: image/svg+xml. This creates a click-through XSS attack vector where victims navigating to a crafted URL see an SVG with an injected link, and clicking it triggers JavaScript execution via the bypassed MIME types.

Critical Impact

Attackers can achieve JavaScript execution in victims' browsers through crafted URLs targeting the unauthenticated getDynamicIcon endpoint, potentially leading to session hijacking, credential theft, or other client-side attacks.

Affected Products

  • B3log SiYuan versions 3.6.0 and below
  • SiYuan instances with exposed /api/icon/getDynamicIcon endpoint
  • Deployments allowing direct navigation or <object>/<embed> embedding of SVG content

Discovery Timeline

  • 2026-03-20 - CVE CVE-2026-32940 published to NVD
  • 2026-03-23 - Last updated in NVD database

Technical Details for CVE-2026-32940

Vulnerability Analysis

This vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation), commonly known as Cross-Site Scripting. The flaw stems from an incomplete allowlist/blocklist approach in the SVG sanitization logic. The SanitizeSVG function was designed to prevent malicious content injection by blocking specific data URI schemes in href attributes, but the implementation failed to account for alternative MIME types that can also execute scripts when rendered as SVG.

The attack vector requires user interaction—specifically, clicking on a maliciously crafted link within the rendered SVG. The vulnerability cannot be exploited through <img> tag rendering in the frontend since image tags don't allow interactive links. However, direct navigation to the endpoint or embedding via <object> or <embed> tags enables the attack.

Root Cause

The root cause is an incomplete blocklist implementation in the SVG sanitization function. The original code only checked for data:text/html, data:image/svg+xml, and data:application/xhtml+xml MIME types, missing data:text/xml and data:application/xml which can both render SVG content with embedded JavaScript. Additionally, the /api/icon/getDynamicIcon endpoint accepts unauthenticated requests and passes user input directly into SVG markup without proper escaping using fmt.Sprintf.

Attack Vector

The attack requires network access to the vulnerable SiYuan instance. An attacker constructs a malicious URL targeting the /api/icon/getDynamicIcon endpoint with a crafted content parameter containing an SVG link using a bypassed MIME type (such as data:text/xml or data:application/xml) that includes JavaScript. When a victim navigates to this URL and clicks the injected link, the JavaScript executes in their browser context.

go
// Security patch in kernel/util/misc.go - Transition from blocklist to allowlist approach
// Source: https://github.com/siyuan-note/siyuan/commit/d01d561875d4f744e9f6232f1d4831e3642b8696

 						if strings.HasPrefix(val, "javascript:") {
 							continue
 						}
-						// 对 data: 做保守处理,删除包含可执行内容的 data:text/html 或 data:image/svg+xml
+						// 对 data: 做保守处理,只允许常见安全的图片格式(png/jpeg/gif/webp)
 						if strings.HasPrefix(val, "data:") {
-							if strings.Contains(val, "text/html") || strings.Contains(val, "image/svg+xml") || strings.Contains(val, "application/xhtml+xml") {
+							safe := strings.HasPrefix(val, "data:image/png") ||
+								strings.HasPrefix(val, "data:image/jpeg") ||
+								strings.HasPrefix(val, "data:image/gif") ||
+								strings.HasPrefix(val, "data:image/webp")
+							if !safe {
 								continue
 							}
 						}

The patch transitions from an incomplete blocklist approach to a conservative allowlist, permitting only known-safe image formats (data:image/png, data:image/jpeg, data:image/gif, data:image/webp) in data URIs.

Detection Methods for CVE-2026-32940

Indicators of Compromise

  • HTTP requests to /api/icon/getDynamicIcon endpoint with suspicious content parameters containing data:text/xml or data:application/xml payloads
  • SVG content served from the application containing unexpected href attributes with data URI schemes
  • Browser console errors or security warnings related to inline script execution from SVG content
  • Unusual outbound connections or cookie exfiltration attempts following user access to SVG resources

Detection Strategies

  • Monitor web server logs for requests to /api/icon/getDynamicIcon containing encoded JavaScript or data URI payloads
  • Implement Web Application Firewall (WAF) rules to detect and block requests containing data:text/xml or data:application/xml in query parameters
  • Deploy Content Security Policy (CSP) headers to restrict inline script execution and mitigate XSS impact
  • Use browser-based XSS detection tools during security testing to identify reflected content in SVG responses

Monitoring Recommendations

  • Enable detailed access logging for the /api/icon/ endpoint family to capture full request parameters
  • Set up alerting for anomalous patterns in getDynamicIcon requests, particularly those with large or encoded content parameters
  • Monitor for CSP violation reports that may indicate attempted XSS exploitation
  • Review application logs for patterns consistent with automated vulnerability scanning targeting this endpoint

How to Mitigate CVE-2026-32940

Immediate Actions Required

  • Upgrade SiYuan to version 3.6.1 or later immediately to apply the security patch
  • If immediate upgrade is not possible, restrict access to the /api/icon/getDynamicIcon endpoint at the network or reverse proxy level
  • Implement Content Security Policy headers to provide defense-in-depth against XSS attacks
  • Review access logs for evidence of exploitation attempts against the vulnerable endpoint

Patch Information

The vulnerability has been fixed in SiYuan version 3.6.1. The patch modifies the SVG sanitization logic in kernel/util/misc.go to use a conservative allowlist approach instead of the vulnerable blocklist. Only known-safe image MIME types (image/png, image/jpeg, image/gif, image/webp) are now permitted in data URIs within href attributes. Users should upgrade to version 3.6.1 or later by following the official release instructions. The specific commit addressing this vulnerability is available in the GitHub repository.

Workarounds

  • Block or restrict access to the /api/icon/getDynamicIcon endpoint using reverse proxy rules or firewall configurations until patching is complete
  • Implement strict Content Security Policy headers with script-src 'self' to prevent inline JavaScript execution
  • Place SiYuan instances behind authentication layers to prevent unauthenticated access to API endpoints
  • Use network segmentation to limit exposure of SiYuan instances to trusted users only
bash
# Example nginx configuration to block vulnerable endpoint
location /api/icon/getDynamicIcon {
    # Block access to vulnerable endpoint until patch is applied
    deny all;
    return 403;
}

# Alternative: Implement CSP headers as defense-in-depth
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none';" always;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechB3log Siyuan

  • SeverityMEDIUM

  • CVSS Score6.1

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Security Advisory

  • GitHub Release v3.6.1
  • Vendor Resources
  • GitHub Commit Details

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-31807: B3log Siyuan XSS Vulnerability

  • CVE-2026-31809: B3log Siyuan XSS Vulnerability

  • CVE-2026-29183: B3log Siyuan XSS Vulnerability

  • CVE-2026-40922: B3log Siyuan RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English