Advisory · 16 November 2026

CVE-2026-109310: one request to SiYuan’s icon endpoint allocates whatever number the caller picks

SiYuan’s dynamic icon endpoint rendered a query parameter as a Go template with almost all of Sprig available to it. Sprig’s until function builds a list of whatever length it is given, so one GET from a reader of a published site took the process from 116MiB to 3.7GiB. On a 700MB container it killed the kernel, and the owner’s workspace with it. Fixed in 3.8.6.


Contents

SiYuan is a self-hosted note-taking application. Its publish service turns a workspace into a read-only website, and the people who read that site are the least trusted users the application has. On 22 September 2026 I reported that one of them could end the whole process with a single request. SiYuan published GHSA-cxwr-r7cq-xw52 two days later, rated 6.5, with the fix in 3.8.6.

An icon endpoint that renders templates

GET /api/icon/getDynamicIcon draws small SVG icons, such as a calendar date or a line of text. One of its types takes the text from a content parameter, and if that text contains the delimiter .action{ the handler renders it as a Go text/template first:

if strings.Contains(content, ".action{") {
    content = model.RenderDynamicIconContentTemplate(content, id)
}

The route is registered with one middleware, model.CheckAuth. On the publish service every request carries a token with the reader role, so CheckAuth on its own means any reader of the published site. When publish authentication is turned off, it means anyone.

A deny-list of three

The functions that template could call came from here, in 3.8.4:

func BuiltInTemplateFuncs() (ret template.FuncMap) {
	ret = sprig.TxtFuncMap()

	// 因为安全原因移除一些函数 https://github.com/siyuan-note/siyuan/issues/13426
	delete(ret, "env")
	delete(ret, "expandenv")
	delete(ret, "getHostByName")
	...

Sprig is a library of more than a hundred template functions. Three are removed here. The comment says they were removed for security reasons, and the issue it links is about SiYuan’s template feature, where the person writing the template owns the workspace. On this endpoint the person writing the template is a visitor.

What until does

One of the functions left in is until, which returns the integers from zero up to its argument. In Sprig 3.3.0:

func untilStep(start, stop, step int) []int {
	v := []int{}
	...
	for i := start; i < stop; i += step {
		v = append(v, i)
	}

There is no cap, and nothing checks whether the request is still alive. The template .action{len (until 400000000)} asks for a slice of four hundred million integers and prints its length.

Measured

This is the official 3.8.4 image with the publish service on its default configuration, using the credentials of its one reader account. One GET each, with no memory limit on the container:

baseline                      115.8MiB
until 10000000      173ms     306.8MiB
until 50000000     1170ms     1.422GiB
until 150000000    1751ms     3.722GiB

Memory grows in a straight line with a number the caller chooses. Then the same container limited to 700MB, which is an ordinary size for a self-hosted note server, and one request:

until 400000000  http=000   (the connection died)
container: exited OOMKilled=true exit=137
the published site:  http=000
the owner kernel:    http=000

The process that dies is the SiYuan kernel. On a server that takes down the published site and the owner’s workspace together. On a desktop install it is the editor the owner has open.

There is a quieter variant. Sprig also ships bcrypt, which is slow on purpose: about 53 milliseconds a call on my machine. Calling it inside range until 200 cost 10.7 seconds of CPU in one request, and the access log records that request as a request for an icon.

What it is not

A template engine that a visitor can reach raises the question of code execution, so I looked for that before filing. I did not find it, and the report says so.

  • env, expandenv and getHostByName really are removed. All three return empty on a live 3.8.4.
  • readFile, tpl, include and lookup belong to Helm. They are not in Sprig’s own function map.
  • The data passed to the template is a map[string]string, which has no methods to call.
  • The output is HTML-escaped and served with script-src 'none', so it is not cross-site scripting either.

What is left is resource use, and the advisory is rated as an availability issue only.

Why I looked here

This endpoint had three advisories before this one. The most recent, CVE-2026-54068, was template injection through the same parameter, reaching a function that ran SQL. Its fix took the SQL functions out of this template and left the rest of the function map in place. I read that fix, saw that the rest of Sprig was still there, and went through the list.

The fix

The report suggested replacing the deny-list with a list of the functions the icons need. SiYuan did that: the icon template now gets only the functions named in dynamicIconTemplateFuncNames, which covers strings, dates and arithmetic. until, repeat and bcrypt are not on it. The advisory gives 3.8.6 as the patched version.

The CVE nobody mentioned

SiYuan did not request a CVE id for this advisory, and the CVE field on its GitHub page is still empty. On 12 October 2026 VulnCheck assigned CVE-2026-109310 to it and credited the report. Nobody was notified. I found it on 30 October by searching the public CVE list for my own handle.

If you report to projects that publish advisories without requesting ids, search the CVE list for your name now and then. The advisory page will not tell you.

Every report we have filed with other projects, and what became of each one, is on one page. Disclosures

The record

← All publications