{"id":"CVE-2026-52796","title":"Gogs has DoS in rendering issue index pattern","summary":"Gogs has DoS in rendering issue index pattern","severity":"low","cvss":3.5,"cwe":["CWE-1336"],"vendor":"gogs","product":"gogs.io/gogs","ecosystem":"go","affected":["gogs.io/gogs <= 0.14.2"],"patched":["gogs.io/gogs 0.14.3"],"published":"2026-06-22","updated":"2026-06-22","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-4j89-2c4f-44c6","references":[{"url":"https://github.com/gogs/gogs/security/advisories/GHSA-4j89-2c4f-44c6"},{"url":"https://github.com/gogs/gogs/pull/8312"},{"url":"https://github.com/gogs/gogs/commit/0529d95fc39f2b6d2997b19a2a12e24522684722"},{"url":"https://github.com/gogs/gogs/releases/tag/v0.14.3"},{"url":"https://github.com/advisories/GHSA-4j89-2c4f-44c6"}],"tags":["ghsa","go"],"epss":0.00284,"epssPercentile":0.21216,"ingestedAt":"2026-06-29T13:24:35.483Z","slug":"CVE-2026-52796","body":"## Overview\n\n### Summary\nSpecial template of issue index pattern may cause panic.\n\n### Details\n\nin internal/markup/markup.go\n\n```go\nlink = fmt.Sprintf(`<a href=\"%s\">%s</a>`, com.Expand(metas[\"format\"], metas), m)\n```\n\nIssue index pattern is rendered to link with `com.Expand`.\n\nHowever, `com.Expand` is not safe.\n\n```go\ni = strings.Index(template, \"}\")\nif s, ok := match[template[:i]]; ok {\n```\n\nwhen `{` is found but `}` not found, i comes to 1, template[:-1] will be called, and then panicked\n\n![image](https://user-images.githubusercontent.com/38121125/285883766-64873c44-d325-44ce-96a8-badbaadab178.png)\n\nfinally, all pages than contains issue index are unavailable.\n\n### PoC\n\n1. set issue index pattern as follow\n\n![image](https://user-images.githubusercontent.com/38121125/285878157-c5fe848e-0fbd-4fdb-92d4-5eb01df2b8ca.png)\n\n2. add a commit which point to an issue in its msg\n\n![image](https://user-images.githubusercontent.com/38121125/285879545-bc360503-49b9-453f-aa24-9a5c5a45cf10.png)\n\nusing `#1` above\n\n### Impact\n\nDoS that cause part of pages of the specify repo unavailable.\n\n## Affected packages\n\n- `gogs.io/gogs <= 0.14.2`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `gogs.io/gogs 0.14.3`","depth":"sunlit","depthScore":19,"depthScoreParts":{"impact":19.3,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}