CVE-2026-26195: Gogs Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-vgvf-m4fw-938j
CWE-79
Published
Advisory Summary

CVE-2026-26195 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Gogs libraries in the Go ecosystem. The issue involves stored xss in branch and wiki views through author and committer names. Remediation is available in the latest vendor maintenance releases.

CVE-2026-26195 at a Glance

CVE Identifier CVE-2026-26195
GHSA Identifier GHSA-vgvf-m4fw-938j
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Gogs
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-26195

To remediate this vulnerability, upgrade all affected Gogs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gogs.io/gogs fixed: Latest secure release
Upgrade gogs.io/gogs to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for gogs.io/gogs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-26195, inspect your project dependencies for Gogs:

inspect dependencies for gogs.io/gogs

Analyze the terminal output to locate any version of Gogs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Gogs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2026-26195 Affected Gogs Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
gogs.io/gogs
Go
≤ 0.13.3

References

Frequently Asked Questions

What is CVE-2026-26195?
CVE-2026-26195 is a security vulnerability in Gogs involving Stored XSS in branch and wiki views through author and committer names under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Gogs versions are affected?
Affected versions include releases prior to current release patches across affected packages: gogs.io/gogs.
What version fixes CVE-2026-26195?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is gogs.io/gogs affected?
Yes, gogs.io/gogs is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2026-26195?
CVE-2026-26195 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Go dependencies for CVE-2026-26195?
Run the dependency tree command: 'inspect dependencies for gogs.io/gogs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vgvf-m4fw-938j",
  "modified" : "2026-03-05T22:28:44Z",
  "published" : "2026-03-05T19:48:33Z",
  "aliases" : [ "CVE-2026-26195" ],
  "summary" : "Gogs: Stored XSS in branch and wiki views through author and committer names",
  "details" : "### Summary\n\nStored XSS is still possible through unsafe template rendering that mixes user input with `safe()` plus permissive sanitizer handling of data URLs.\n\n### Details\n\n`safe()` still turns off escaping:\n- internal/template/template.go\n- `func safe(raw string) template.HTML { return template.HTML(raw) }`\n\nBranch pages still render committer names using `safe()`:\n- templates/repo/branches/overview.tmpl\n- templates/repo/branches/all.tmpl\n- templates/repo/wiki/view.tmpl\n\nThe locale still injects a raw second argument: conf/locale/locale_en-US.ini (`branches.updated_by = updated %[1]s by %[2]s`)\n\n### Impact\n\nAn 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.\n\n### Recommended Fix\n\n- Untrusted arguments should be escaped before being used in translations.\n- Data URLs should be limited or blocked in the sanitizer.\n\n### Remediation\nA fix is available at https://github.com/gogs/gogs/releases/tag/v0.14.2.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gogs.io/gogs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.13.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/security/advisories/GHSA-vgvf-m4fw-938j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-26195"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/pull/8176"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/commit/ac21150a53bef3a3061f4da787ab193a8d68ecfc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gogs/gogs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/releases/tag/v0.14.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-05T19:48:33Z",
    "nvd_published_at" : "2026-03-05T19:16:03Z"
  }
}