CVE-2026-31807 SiYuan has a SVG Sanitizer Bypass via `<animate>` Element — Unauthenticated XSS
An attacker can execute arbitrary JavaScript via SVG animation elements in the dynamic icon endpoint, leading to reflected XSS.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-31807?
CVE-2026-31807 is a medium-severity cross-site scripting vulnerability in B3log Siyuan, published on 10 Mar 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
SiYuan is a personal knowledge management system. Prior to 3.5.10, SiYuan's SVG sanitizer (SanitizeSVG) blocks dangerous elements (<script>, <iframe>, <foreignobject>) and removes on* event handlers and javascript: in href attributes. However, it does NOT block SVG animation elements (<animate>, <set>) which can dynamically set attributes to dangerous values at runtime, bypassing the static sanitization. This allows an attacker to inject executable JavaScript into the unauthenticated /api/icon/getDynamicIcon endpoint (type=8), creating a reflected XSS. This is a bypass of the fix for CVE-2026-29183 (fixed in v3.5.9). This vulnerability is fixed in v3.5.10.
Weakness: CWE-79
Which versions are affected by CVE-2026-31807?
3 open source packages ship an affected version, including github.com/siyuan-note/siyuan/kernel. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/siyuan-note/siyuan/kernel Go | All versions | 0.0.0-20260310025236-297bd526708f |
github.com/siyuan-note/siyuan/kernel Go | All versions | 0.0.0-20260310025236-297bd526708f |
github.com/siyuan-note/siyuan/kernel Go | All versions | 0.0.0-20260310025236-297bd526708f |
Products include B3log Siyuan.
How do I fix CVE-2026-31807?
Upgrade github.com/siyuan-note/siyuan/kernel to 0.0.0-20260310025236-297bd526708f or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-31807 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-31807 exists.
Public exploit code: 1 Nuclei template.
Other vulnerabilities in B3log Siyuan
- CVE-2026-32938 SiYuan has an Arbitrary File Read in its Desktop Publish Service
- CVE-2026-33669 SiYuan has Arbitrary Document Reading within the Publishing Service
- CVE-2026-33670 SiYuan has directory traversal within its publishing service
- CVE-2026-32767 SiYuan: Authorization Bypass Allows Arbitrary SQL Execution via Search API
- CVE-2024-53504 SQL injection in n/a
Sources
Also known as GHSA-5hc8-qmg8-pw27, GO-2026-4667.