GitHub Advisoryadvisory · Go
GHSA-4j89-2c4f-44c6 Gogs has DoS in rendering issue index pattern
LOW
Official page ↗
- Aliases
- CVE-2026-52796
- Ecosystem
- Go
- Packages
- gogs.io/gogs
- Severity
- Low
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L
- Weaknesses
- CWE-1336
- Reviewed
- 2026-06-22
Affected packages
• Go gogs.io/gogs: < 0.14.3 → fixed in 0.14.3
Description
Summary
Special template of issue index pattern may cause panic.
Details
in internal/markup/markup.go
```go
link = fmt.Sprintf(`%s`, com.Expand(metas["format"], metas), m)
```
Issue index pattern is rendered to link with `com.Expand`.
However, `com.Expand` is not safe.
```go
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
finally, all pages than contains issue index are unavailable.
PoC
1. set issue index pattern as follow
2. add a commit which point to an issue in its msg
using `#1` above
Impact
DoS that cause part of pages of the specify repo unavailable.
Related
Alias · CVE (1)
- CVE-2026-52796 Gogs is an open source self-hosted Git service. vulnerability
Weakness · CWE (1)
- CWE-1336 Improper Neutralization of Special Elements Used in a Template Engine weakness
References
- https://github.com/gogs/gogs/security/advisories/GHSA-4j89-2c4f-44c6 web
- https://nvd.nist.gov/vuln/detail/CVE-2026-52796 advisory
- https://github.com/gogs/gogs/pull/8312 web
- https://github.com/gogs/gogs/commit/0529d95fc39f2b6d2997b19a2a12e24522684722 web
- https://github.com/gogs/gogs package
- https://github.com/gogs/gogs/releases/tag/v0.14.3 web