There is a security issue in Gogs where deleting a release can fail if a user-controlled tag name is passed to Git without the right separator, allowing Git option injection and therefore interfering with the process.
process.ExecDir(..., "git", "tag", "-d", rel.TagName)rel.TagName is used as a CLI argument to git tag -d without -- or --end-of-options.
If the tag name begins with -, Git parses it as a flag.
The prior mitigation is incomplete. There is path sanitization in place during creation:
r.TagName = strings.TrimLeft(r.TagName, "-")But it only covers one creation path and does not reliably protect tag deletions, such as tags added through git push or ref updates.
Exploit Conditions
git tag -d -- <tagName>git tag -d{
"cwe_ids": [
"CWE-88"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-05T19:29:44Z",
"nvd_published_at": "2026-03-05T19:16:03Z",
"severity": "HIGH"
}