Launch Week Day 1: Announcing Security Design Review
MEDIUM 4.6 Go

SiYuan has a Reflected Cross-Site Scripting (XSS) via /api/icon/getDynamicIcon

GHSA-w836-5gpm-7r93 · CVE-2026-23847 · GO-2026-4343

Published · Modified

Description

Summary

Reflected XSS in /api/icon/getDynamicIcon due to unsanitized SVG input.

Details

The endpoint generates SVG images for text icons (type=8). The content query parameter is inserted directly into the SVG tag without XML escaping. Since the response Content-Type is image/svg+xml, injecting unescaped tags allows breaking the XML structure and executing JavaScript.

PoC

Payload: test</text><script>alert(window.origin)</script><text>

  1. Open any note and click Change Icon -> Dynamic (Text).
image
  1. Change color and paste the payload into the Custom field and click on this icon.
image
  1. Intercept and send the request or get path from devtools
image image
  1. The JavaScript payload executes afted open URL.
image image

Impact

Arbitrary JavaScript execution in the user's session context if the SVG is loaded directly. It also prevents using legitimate characters like < or > in icon text.

Note

Tested version:
image

Ready to move

Start Securing

Free, no credit card | First findings in minutes