All reports
Low

Gogs has DoS in rendering issue index pattern

Affected versions

Version ranges need review.

Affected versions
<= 0.14.2
Fixed version
0.14.3
Affected versions
*
Fixed version
Not reported

Exploitation

CVE-2026-52796

Probability of exploitation in the next 30 days: 0.28%

FIRST EPSS · 2026-11-23

Description

Summary

Special template of issue index pattern may cause panic.

Details

in internal/markup/markup.go

link = fmt.Sprintf(`<a href="%s">%s</a>`, com.Expand(metas["format"], metas), m)

Issue index pattern is rendered to link with com.Expand.

However, com.Expand is not safe.

i = strings.Index(template, "}")
if s, ok := match[template[:i]]; ok {

when { is found but } not found, i comes to 1, template[:-1] will be called, and then panicked

image

finally, all pages than contains issue index are unavailable.

PoC
  1. set issue index pattern as follow

image

  1. add a commit which point to an issue in its msg

image

using #1 above

Impact

DoS that cause part of pages of the specify repo unavailable.

Links

Credits

  • BaiMeow