Vulnerability advisory

GHSA-4j89-2c4f-44c6

Gogs has DoS in rendering issue index pattern

Published Updated OSV record ↗

Also known as CVE-2026-52796GO-2026-5124

Severity
  • CVSS 3.xCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L

Affected versions

AffectedFixed in
All versions before 0.14.30.14.3

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: image]

finally, all pages than contains issue index are unavailable.

PoC
  1. set issue index pattern as follow

[image: image]

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

[image: image]

using #1 above

Impact

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

References

  • Codex
  • Claude Code
  • VS Code
  • GitHub Copilot
  • Cursor
  • Cline
  • Windsurf
  • Google Anti-gravity
  • OpenCode
  • Pi
  • Gemini CLI
  • Hermes Agent
  • Zed
  • Junie
  • Qwen Code
  • Kiro
  • Kilo Code
  • Factory Droid

Set up GitHits for your agents

Run this command:

<> bash
npx githits@latest init

What happens next:

  1. Opens your browser to authorize GitHits
  2. Asks whether to set up GitHits at the user or project level
  3. Detects your supported AI coding tools
  4. Lets you choose which tools to configure
  5. Configures the selected tools