CVE-2026-31809 SiYuan has a SVG Sanitizer Bypass via Whitespace in `javascript:` URI — Unauthenticated XSS

Medium 6.4 Published Updated

An attacker can execute arbitrary JavaScript via reflected XSS in SiYuan by bypassing SVG sanitization with whitespace characters in javascript URIs.

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-31809?

CVE-2026-31809 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) checks href attributes for the javascript: prefix using strings.HasPrefix(). However, inserting ASCII tab (	), newline (
), or carriage return (
) characters inside the javascript: string bypasses this prefix check. Browsers strip these characters per the WHATWG URL specification before parsing the URL scheme, so the JavaScript still executes. This allows an attacker to inject executable JavaScript into the unauthenticated /api/icon/getDynamicIcon endpoint, creating a reflected XSS. This is a second bypass of the fix for CVE-2026-29183 (fixed in v3.5.9). This vulnerability is fixed in 3.5.10.

Weakness: CWE-79

Which versions are affected by CVE-2026-31809?

3 open source packages ship an affected version, including github.com/siyuan-note/siyuan/kernel. It affects 1 product.

PackageAffectedFixed in
github.com/siyuan-note/siyuan/kernel GoAll versions0.0.0-20260310025236-297bd526708f
github.com/siyuan-note/siyuan/kernel GoAll versions0.0.0-20260310025236-297bd526708f
github.com/siyuan-note/siyuan/kernel GoAll versions0.0.0-20260310025236-297bd526708f

Products include B3log Siyuan.

How do I fix CVE-2026-31809?

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-31809 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-31809 exists.

Public exploit code: 1 Nuclei template.

All B3log Siyuan vulnerabilities

Sources

Also known as GHSA-pmc9-f5qr-2pcr, GO-2026-4669.

Is CVE-2026-31809 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free