GHSA-4j89-2c4f-44c6
Gogs has DoS in rendering issue index pattern
상세
### Summary Special template of issue index pattern may cause panic.
### Details
in internal/markup/markup.go
```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.
```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.
이 버전이 영향받나요?
사용 중인 패키지 버전을 입력하면 즉시 평가합니다.