Skip to content

security: sanitize milestone names in new issue form - #8325

Merged
unknwon merged 2 commits into
mainfrom
ghsa-vcm5-gvmp-78mp
Jun 6, 2026
Merged

unknwon merged 2 commits into
mainfrom
ghsa-vcm5-gvmp-78mp

Conversation

@unknwon

@unknwon unknwon commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

Apply the existing | Sanitize filter to milestone name renderings in templates/repo/issue/new_form.tmpl, matching the patches already in place in view_content.tmpl. Without it, the new issue page's milestone dropdown is vulnerable to stored XSS because the Semantic UI dropdown re-parses decoded text as HTML on selection.

Refs: GHSA-vcm5-gvmp-78mp

Test plan

  • moon run gogs:lint
  • moon run gogs:build
  • Manual: create a milestone named <img src=x onerror=alert(1)>, open the new issue page, and confirm the dropdown no longer executes the payload on selection.

unknwon added 2 commits June 5, 2026 23:03
The new issue page's milestone dropdown rendered milestone names
through Go's default auto-escaping only. Semantic UI's dropdown
re-parses the decoded text as HTML when an item is selected, which
allowed a stored XSS via crafted milestone names. Apply the same
Sanitize filter that view_content.tmpl already uses.

Refs: GHSA-vcm5-gvmp-78mp
@unknwon unknwon added this to the 0.14.3 milestone Jun 6, 2026
@unknwon
unknwon merged commit 573eacd into main Jun 6, 2026
2 checks passed
@unknwon
unknwon deleted the ghsa-vcm5-gvmp-78mp branch June 6, 2026 03:08
unknwon added a commit that referenced this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant