CVE-2026-26195
Undergoing Analysis Undergoing Analysis - In Progress
Stored XSS in Gogs Template Rendering Before v

Publication date: 2026-03-05

Last updated on: 2026-03-06

Assigner: GitHub, Inc.

Description
Gogs is an open source self-hosted Git service. Prior to version 0.14.2, stored xss is still possible through unsafe template rendering that mixes user input with safe plus permissive sanitizer handling of data urls. This issue has been patched in version 0.14.2.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-05
Last Modified
2026-03-06
Generated
2026-05-06
AI Q&A
2026-03-05
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
gogs gogs to 0.14.2 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 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.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-26195 is a stored Cross-Site Scripting (XSS) vulnerability in the Gogs self-hosted Git service affecting versions prior to 0.14.2. The issue arises because untrusted user input, specifically git commit author and committer names, are directly inserted into locale strings used in templates without proper HTML escaping. These names are passed through a safe template function that disables HTML escaping, allowing malicious input to be rendered as executable code in views such as branch overview, branch list, and wiki pages.

The root cause is unsafe template rendering that mixes user input with a permissive sanitizer that does not fully neutralize potentially harmful content, especially data URLs. The vulnerability allows attackers who can inject commit metadata to execute arbitrary scripts in the web interface.

The issue was fixed in version 0.14.2 by introducing proper sanitization and escaping of these user inputs before they are inserted into locale strings, using functions like HTMLEscapeString and Sanitize to ensure special characters are safely encoded.


How can this vulnerability impact me? :

[{'type': 'paragraph', 'content': 'This vulnerability can allow an attacker who can control commit author or committer names to inject malicious scripts into the Gogs web interface. When other users view affected pages such as branch overviews or wiki pages, these scripts can execute in their browsers.'}, {'type': 'list_item', 'content': "Execution of arbitrary JavaScript code in users' browsers."}, {'type': 'list_item', 'content': 'Potential session hijacking by stealing authentication cookies.'}, {'type': 'list_item', 'content': 'Cross-Site Request Forgery (CSRF) token theft leading to unauthorized actions.'}, {'type': 'list_item', 'content': 'General compromise of user accounts or data accessible through the web interface.'}] [3]


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

[{'type': 'paragraph', 'content': 'Detection of this vulnerability involves identifying if your Gogs instance is running a version prior to 0.14.2 where unsafe template rendering of commit author or committer names occurs.'}, {'type': 'paragraph', 'content': 'You can check the Gogs version by running the following command on the server hosting Gogs:'}, {'type': 'list_item', 'content': 'curl -s http://your-gogs-instance/api/v1/version'}, {'type': 'paragraph', 'content': 'Additionally, you can inspect commit metadata for suspicious or malicious content in author or committer names that might exploit the vulnerability.'}, {'type': 'paragraph', 'content': 'For example, to list recent commits with author and committer names, you can use git commands in your repositories:'}, {'type': 'list_item', 'content': 'git log --pretty=format:"%h %an %cn %s"'}, {'type': 'paragraph', 'content': 'Look for unusual or suspicious characters or scripts in the author or committer names that could indicate exploitation attempts.'}] [1, 2, 3]


What immediate steps should I take to mitigate this vulnerability?

The primary mitigation step is to upgrade your Gogs installation to version 0.14.2 or later, where the vulnerability has been patched by properly escaping untrusted user input in templates.

If upgrading immediately is not possible, you should:

  • Avoid injecting or accepting untrusted commit metadata such as author or committer names that could contain malicious scripts.
  • Review and sanitize commit metadata before it is rendered in the web interface.
  • Limit or block data URLs in the sanitizer configuration to reduce risk from permissive data URL handling.

These steps help prevent exploitation of the stored XSS vulnerability until you can apply the official patch.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart