CVE-2026-29183 Overview
CVE-2026-29183 is a reflected Cross-Site Scripting (XSS) vulnerability affecting SiYuan, a personal knowledge management system developed by B3log. The vulnerability exists in the dynamic icon API endpoint /api/icon/getDynamicIcon which, when the type=8 parameter is used, embeds attacker-controlled content into SVG output without proper escaping.
Because this endpoint is unauthenticated and returns content with the image/svg+xml MIME type, attackers can craft malicious URLs that inject executable SVG/HTML event handlers (such as onerror) to execute arbitrary JavaScript in the context of the SiYuan web origin. When a logged-in user opens a malicious link, this vulnerability can be chained to perform authenticated API actions and exfiltrate sensitive data from the victim's knowledge base.
Critical Impact
Unauthenticated attackers can execute arbitrary JavaScript in authenticated user sessions, potentially leading to data theft, session hijacking, and unauthorized access to personal knowledge management data.
Affected Products
- B3log SiYuan versions prior to 3.5.9
Discovery Timeline
- 2026-03-06 - CVE-2026-29183 published to NVD
- 2026-03-10 - Last updated in NVD database
Technical Details for CVE-2026-29183
Vulnerability Analysis
This vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation), commonly known as Cross-Site Scripting. The root of the issue lies in the dynamic icon generation API endpoint that processes user-supplied input without adequate sanitization before embedding it into SVG content.
The vulnerable endpoint /api/icon/getDynamicIcon accepts a type parameter, and when set to 8, the application generates SVG content dynamically. The critical flaw is that user-controlled data is directly interpolated into the SVG output without escaping special characters or validating the input against malicious patterns.
Since the endpoint returns content with the image/svg+xml content type, browsers render the response as SVG, which supports inline JavaScript execution through event handlers. This allows attackers to inject payloads that execute when the SVG is processed by the victim's browser.
Root Cause
The vulnerability stems from insufficient input validation and output encoding in the dynamic icon generation functionality. When constructing the SVG response, the application fails to sanitize or escape user-provided content before embedding it into the XML structure. This allows attackers to break out of the intended data context and inject executable code through SVG event handlers like onerror, onload, or onmouseover.
Attack Vector
The attack is conducted over the network and requires user interaction. An attacker crafts a malicious URL containing an XSS payload targeting the /api/icon/getDynamicIcon endpoint with type=8. When a victim (particularly an authenticated SiYuan user) clicks on or is redirected to this URL, the injected JavaScript executes in the context of the SiYuan web application.
The attack can be escalated by chaining the XSS with authenticated API calls. Since the malicious script runs in the same origin as SiYuan, it has access to session cookies and can make authenticated requests on behalf of the victim. This enables data exfiltration, configuration changes, or other malicious actions within the victim's knowledge management system.
For detailed technical information about the vulnerability mechanism, refer to the GitHub Security Advisory.
Detection Methods for CVE-2026-29183
Indicators of Compromise
- Unusual requests to /api/icon/getDynamicIcon with suspicious type=8 parameters containing JavaScript event handlers
- HTTP access logs showing encoded or obfuscated payloads in query parameters targeting the dynamic icon endpoint
- Unexpected outbound connections originating from user browsers after accessing SiYuan
Detection Strategies
- Monitor web server access logs for requests to /api/icon/getDynamicIcon containing patterns like onerror=, onload=, <script>, or other XSS indicators
- Deploy Web Application Firewall (WAF) rules to detect and block reflected XSS patterns in URL parameters
- Implement Content Security Policy (CSP) headers to restrict inline script execution and report violations
Monitoring Recommendations
- Enable verbose logging for the SiYuan application to capture all API requests and parameters
- Set up alerts for anomalous patterns in requests to icon-related endpoints
- Review user-reported suspicious links that may indicate social engineering attempts exploiting this vulnerability
How to Mitigate CVE-2026-29183
Immediate Actions Required
- Upgrade SiYuan to version 3.5.9 or later immediately
- Review access logs for evidence of exploitation attempts against the /api/icon/getDynamicIcon endpoint
- Advise users not to click on untrusted links that may target SiYuan instances
- Consider temporarily restricting access to SiYuan instances from untrusted networks until patching is complete
Patch Information
The vulnerability has been addressed in SiYuan version 3.5.9. The patch implements proper input sanitization and output encoding for the dynamic icon API endpoint to prevent injection of malicious content into SVG responses. Users should update to this version or later to remediate the vulnerability.
For complete patch details and changelog, see the GitHub Security Advisory GHSA-6865-qjcf-286f.
Workarounds
- Restrict network access to SiYuan instances using firewall rules to limit exposure to trusted users only
- Deploy a reverse proxy with WAF capabilities to filter malicious requests before they reach the application
- Implement strict Content Security Policy headers to mitigate the impact of successful XSS exploitation
- Educate users about the risks of clicking untrusted links while SiYuan sessions are active
# Example: Restrict access to SiYuan using iptables (Linux)
# Allow only trusted IP ranges to access the SiYuan port
iptables -A INPUT -p tcp --dport 6806 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 6806 -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

