CVE-2026-29183: SiYuan: Unauthenticated reflected SVG XSS in `/api/icon/getDynamicIcon` (`type=8`) enables arbitrary JavaScript execution

Published Mar 4, 2026
·
Updated

Summary An unauthenticated reflected XSS vulnerability exists in the dynamic icon API endpoint:

- GET /api/icon/getDynamicIcon

When type=8, attacker-controlled content is embedded into SVG output without escaping. Because the endpoint is unauthenticated and returns image/svg+xml, a crafted URL can inject executable SVG/HTML event handlers (for example onerror) and run JavaScript in the SiYuan web origin.

This can be chained to perform authenticated API actions and exfiltrate sensitive data when a logged-in user opens the malicious link.

Details The issue is caused by unsafe output construction and incomplete sanitization:

1. Endpoint is exposed without auth middleware - Source: https://github.com/siyuan-note/siyuan/blob/master/kernel/api/router.go#L27-L37 - GET /api/icon/getDynamicIcon is registered in the unauthenticated section.

2. User input is inserted into SVG via string formatting - Source: https://github.com/siyuan-note/siyuan/blob/master/kernel/api/icon.go#L115-L175 - Source: https://github.com/siyuan-note/siyuan/blob/master/kernel/api/icon.go#L537-L585 - In generateTypeEightSVG, %s directly injects content into <text>...</text> without XML/HTML escaping.

3. Sanitizer only removes <script> tags - Source: https://github.com/siyuan-note/siyuan/blob/master/kernel/util/misc.go#L235-L281 - RemoveScriptsInSVG removes <script> nodes, but does not remove dangerous attributes (onerror, onload, etc.) or unsafe elements.

As a result, payloads such as </text><image ... onerror=...><text> survive and execute.

PoC

Minimal browser execution PoC Open this URL in a browser:

http GET /api/icon/getDynamicIcon?type=8&content=%3C%2Ftext%3E%3Cimage%20href%3Dx%20onerror%3Dalert(document.domain)%3E%3C%2Fimage%3E%3Ctext%3E

Example full URL:

text http://127.0.0.1:6806/api/icon/getDynamicIcon?type=8&content=%3C%2Ftext%3E%3Cimage%20href%3Dx%20onerror%3Dalert(document.domain)%3E%3C%2Fimage%3E%3Ctext%3E

Expected result:

- JavaScript executes (alert(document.domain)), confirming reflected XSS.

Authenticated impact demonstration If a victim is authenticated in the same browser session, JavaScript running in origin can call privileged APIs and exfiltrate returned data.

Impact This is a reflected XSS in an unauthenticated endpoint, with realistic account/data compromise impact:

- Arbitrary JavaScript execution in SiYuan web origin. - Authenticated action abuse via same-origin API calls. - Sensitive data exposure (notes/config/API responses) from victim context. - Potential chained server-impact actions depending on victim privileges and deployment mode.

Other sources

SiYuan is a personal knowledge management system. Prior to version 3.5.9, an unauthenticated reflected XSS vulnerability exists in the dynamic icon API endpoint "GET /api/icon/getDynamicIcon" when type=8, attacker-controlled content is embedded into SVG output without escaping. Because the endpoint is unauthenticated and returns image/svg+xml, a crafted URL can inject executable SVG/HTML event handlers (for example onerror) and run JavaScript in the SiYuan web origin. This can be chained to perform authenticated API actions and exfiltrate sensitive data when a logged-in user opens the malicious link. This issue has been patched in version 3.5.9.

MITRE

Affected Software

2 affected componentsFixes available
go/github.com/siyuan-note/siyuan/kernel<0.0.0-20260304034809-d68bd5a79391
0.0.0-20260304034809-d68bd5a79391
b3log SiYuan<3.5.9

Event History

Mar 4, 2026
Advisory Published
via GitHub·09:45 PM
Data Sourced
via GitHub·09:45 PM
DescriptionSeverityWeaknessAffected Software
Mar 6, 2026
CVE Published
via MITRE·07:18 AM
Data Sourced
via MITRE·07:18 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:16 AM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-29183?

CVE-2026-29183 is classified as a medium severity vulnerability due to the potential for reflected XSS attacks.

2

How do I fix CVE-2026-29183?

To fix CVE-2026-29183, upgrade to version 0.0.0-20260304034809-d68bd5a79391 or later of the affected package.

3

What affected software is involved in CVE-2026-29183?

CVE-2026-29183 affects the GitHub repository 'github.com/siyuan-note/siyuan/kernel' within specific versions.

4

Can CVE-2026-29183 be exploited without authentication?

Yes, CVE-2026-29183 can be exploited without authentication through the `GET /api/icon/getDynamicIcon` endpoint.

5

What type of vulnerability is CVE-2026-29183?

CVE-2026-29183 is a reflected cross-site scripting (XSS) vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203