{"id":"CVE-2026-52796","aliases":["CVE-2026-52796","GHSA-4j89-2c4f-44c6","GO-2026-5124"],"related":[],"kind":"vulnerability","state":"published","title":"Gogs: DoS in rendering issue index pattern","summary":"Gogs is an open source self-hosted Git service. Prior to 0.14.3, specially crafted issue index pattern can cause a panic when rendering, resulting in denial of service. In internal/markup/markup.go, RenderIssueIndexPattern renders the issue index pattern to a link using com.Expand, which is not safe: when the configured pattern contains an opening brace { but no closing brace }, strings.Index(template, \"}\") returns -1 and the subsequent slice template[:-1] triggers a panic. Once such a pattern is set, any page in the affected repository that contains an issue index reference such as #1 becomes unavailable. This vulnerability is fixed in 0.14.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Gogs is an open source self-hosted Git service. Prior to 0.14.3, specially crafted issue index pattern can cause a panic when rendering, resulting in denial of service. In internal/markup/markup.go, RenderIssueIndexPattern renders the issue index pattern to a link using com.Expand, which is not safe: when the configured pattern contains an opening brace { but no closing brace }, strings.Index(template, \"}\") returns -1 and the subsequent slice template[:-1] triggers a panic. Once such a pattern is set, any page in the affected repository that contains an issue index reference such as #1 becomes unavailable. This vulnerability is fixed in 0.14.3.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gogs has DoS in rendering issue index pattern in gogs.io/gogs.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: gogs.io/gogs before v0.14.3.","format":"markdown","source":"go"}],"published":"2026-06-22T23:58:17.000Z","modified":"2026-07-21T13:30:31.792Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L","score":3.5,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L","score":3.5,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L","score":3.5,"rating":"LOW"}],"cwes":["CWE-1336"],"affected":[{"ranges":[{"version":"< 0.14.3","status":"affected"}],"vendor":"gogs","product":"gogs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.14.3"}],"ecosystem":"Go","package":"gogs.io/gogs","purl":"pkg:golang/gogs.io/gogs","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"gogs.io/gogs","purl":"pkg:golang/gogs.io/gogs","source":"go"}],"references":[{"url":"https://github.com/gogs/gogs/security/advisories/GHSA-4j89-2c4f-44c6","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-52796","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/gogs/gogs/pull/8312","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs/commit/0529d95fc39f2b6d2997b19a2a12e24522684722","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/gogs/gogs/releases/tag/v0.14.3","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-06-25T20:10:04.777Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-52796","url":"https://www.cve.org/CVERecord?id=CVE-2026-52796","licence":"CVE Terms of Use","modified":"2026-06-25T20:10:28.834Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4j89-2c4f-44c6","url":"https://github.com/advisories/GHSA-4j89-2c4f-44c6","licence":"CC-BY-4.0","modified":"2026-07-21T13:30:31.792Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5124","url":"https://pkg.go.dev/vuln/GO-2026-5124","licence":"CC-BY-4.0","modified":"2026-06-25T18:45:23.711Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-52796","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-52796","licence":"Public domain","modified":"2026-06-25T21:16:27.133Z"}],"updatedAt":"2026-11-25T22:59:25.741Z","epss":{"score":0.00226,"percentile":0.14193,"date":"2026-12-01T12:00:22.000Z"}}