CVE-2026-26195: Gogs: Stored XSS in branch and wiki views through author and committer names
Summary Stored XSS is still possible through unsafe template rendering that mixes user input with safe() plus permissive sanitizer handling of data URLs. Details safe() still turns off escaping: - internal/template/template.go - func safe(raw string) template.HTML { return template.HTML(raw) } Branch pages still render committer names using safe(): - templates/repo/branches/overview.tmpl -…
Published Mar 5, 2026
Affected packages
gogs.io/gogs
- Ecosystem
- Go
- Affected
- <= 0.13.3
- Fixed in
- No patched version yet
- Check
go list -m gogs.io/gogs
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Stored XSS is still possible through unsafe template rendering that mixes user input with safe() plus permissive sanitizer handling of data URLs.
Details
safe() still turns off escaping:
- internal/template/template.go
func safe(raw string) template.HTML { return template.HTML(raw) }
Branch pages still render committer names using safe():
- templates/repo/branches/overview.tmpl
- templates/repo/branches/all.tmpl
- templates/repo/wiki/view.tmpl
The locale still injects a raw second argument: conf/locale/locale_en-US.ini (branches.updated_by = updated %[1]s by %[2]s)
Impact
An attacker who can inject commit metadata such as author/committer name can trigger script execution on affected pages, leading to session abuse, CSRF token theft, or unauthorized actions.
Recommended Fix
- Untrusted arguments should be escaped before being used in translations.
- Data URLs should be limited or blocked in the sanitizer.
Remediation
A fix is available at https://github.com/gogs/gogs/releases/tag/v0.14.2.
Credited to rezmoss.
References
- https://github.com/gogs/gogs/security/advisories/GHSA-vgvf-m4fw-938j
- https://github.com/gogs/gogs/pull/8176
- https://github.com/gogs/gogs/commit/ac21150a53bef3a3061f4da787ab193a8d68ecfc
- https://github.com/gogs/gogs/releases/tag/v0.14.2
- https://nvd.nist.gov/vuln/detail/CVE-2026-26195
- https://github.com/advisories/GHSA-vgvf-m4fw-938j
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-52800
Gogs Vulnerable to CSRF Leading to Organization Owner Takeover
high8.8Jun 23, 2026CVE-2026-52801
Gogs has the ability to import local repositories via Mirror Settings
high8.1Jun 23, 2026CVE-2026-52802
Gogs has an Open Redirect via redirect_to
medium5.4Jun 23, 2026CVE-2026-52804
Gogs Vulnerable to Privilege Escalation via Collaboration Access Mode Validation
medium5.5Jun 23, 2026CVE-2026-52805
Gogs has a Migration Redirect Bypass that Leads to Internal Repository Theft
high8.7Jun 23, 2026CVE-2026-52806
Gogs vulnerable to RCE via git rebase --exec argument injection in pull request merge
critical9.9Jun 23, 2026
