The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-26195

CVE-2026-26195: Gogs Self-Hosted Git Service XSS Flaw

CVE-2026-26195 is a stored XSS vulnerability in Gogs self-hosted Git service caused by unsafe template rendering. Attackers can exploit this to inject malicious scripts. This article covers technical details, affected versions, and patches.

Published: March 6, 2026

CVE-2026-26195 Overview

CVE-2026-26195 is a Stored Cross-Site Scripting (XSS) vulnerability affecting Gogs, an open source self-hosted Git service. The vulnerability exists in versions prior to 0.14.2 and stems from unsafe template rendering that improperly mixes user input with the Safe template function, combined with permissive sanitizer handling of data URLs. This allows attackers to inject and persist malicious scripts that execute in the browsers of other users viewing affected pages.

Critical Impact

Stored XSS vulnerabilities enable attackers to persistently inject malicious JavaScript into the application, potentially leading to session hijacking, credential theft, unauthorized actions on behalf of users, and further compromise of the Git service infrastructure.

Affected Products

  • Gogs versions prior to 0.14.2
  • Self-hosted Gogs Git service installations

Discovery Timeline

  • 2026-03-05 - CVE-2026-26195 published to NVD
  • 2026-03-05 - Last updated in NVD database

Technical Details for CVE-2026-26195

Vulnerability Analysis

This Stored XSS vulnerability arises from a dangerous combination of unsafe template rendering practices in Gogs. The application uses Go's template engine with the Safe function, which marks content as trusted HTML and bypasses escaping. When user-controlled input, such as committer names, is passed through locale translation strings and then piped through Safe, the content is rendered without proper sanitization.

The vulnerability is particularly concerning because it affects the branch view templates where commit information is displayed. Attackers can craft malicious committer names containing JavaScript payloads that are stored in Git commits. When other users browse the branches page, the malicious script executes in their browser context.

Root Cause

The root cause is the improper handling of user-controlled data in template rendering. Specifically, the templates repo/branches/all.tmpl and repo/branches/overview.tmpl passed the .Commit.Committer.Name field directly into locale strings that were subsequently piped through the Safe function. Since Safe marks content as trusted HTML, any malicious content in the committer name would be rendered without escaping, enabling XSS attacks.

Attack Vector

The attack vector is network-based and requires no authentication to exploit. An attacker can create a Git commit with a specially crafted committer name containing JavaScript payload. When this commit is pushed to a Gogs repository, the malicious script becomes permanently stored. Any user who subsequently views the branches page will have the malicious JavaScript execute in their browser session.

The attack leverages data URLs and the permissive sanitizer to bypass initial input filtering. The stored nature of this XSS means the attack persists across sessions and affects all users who view the compromised pages.

text
 			<div class="ui eleven wide column">
 				{{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{EscapePound .Name}}"><code>{{.Name}}</code></a>
 				{{$timeSince := TimeSince .Commit.Committer.When $.Lang}}
-				<span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}</span>
+				<span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince (Sanitize .Commit.Committer.Name) | Safe}}</span>
 			</div>
 			<div class="ui four wide column">
 				{{if and (and (eq $.BranchName .Name) $.IsRepositoryAdmin) (not $.Repository.IsMirror)}}

Source: GitHub Commit Details

Detection Methods for CVE-2026-26195

Indicators of Compromise

  • Unusual JavaScript code or HTML tags present in Git commit author/committer names
  • Browser console errors indicating blocked inline scripts (if CSP is enabled)
  • Reports from users of unexpected behavior or pop-ups when viewing repository branches
  • Log entries showing commits with suspicious committer metadata

Detection Strategies

  • Implement Content Security Policy (CSP) headers to detect and block inline script execution
  • Monitor for unusual patterns in Git commit metadata, particularly in committer and author name fields
  • Deploy web application firewalls (WAF) with XSS detection rules
  • Conduct regular security audits of repository commit history for suspicious entries

Monitoring Recommendations

  • Enable browser-level XSS auditing and logging where available
  • Monitor application logs for unusual template rendering errors
  • Set up alerting for CSP violation reports
  • Regularly review access logs for patterns indicating credential theft or session hijacking attempts

How to Mitigate CVE-2026-26195

Immediate Actions Required

  • Upgrade Gogs to version 0.14.2 or later immediately
  • Audit existing repositories for commits containing potentially malicious committer names
  • Implement Content Security Policy headers to mitigate impact of any unpatched instances
  • Review session logs for signs of potential compromise

Patch Information

The vulnerability has been patched in Gogs version 0.14.2. The fix introduces proper sanitization of user-controlled data before it is passed through the Safe template function. Specifically, the Sanitize function is now applied to committer names before they are included in locale strings.

Details of the fix can be found in:

  • GitHub Security Advisory GHSA-vgvf-m4fw-938j
  • GitHub Pull Request #8176
  • GitHub Release v0.14.2

Workarounds

  • Deploy a reverse proxy with XSS filtering capabilities in front of Gogs
  • Implement strict Content Security Policy headers to block inline script execution
  • Restrict repository write access to trusted users only until patching is complete
  • Consider temporarily disabling public access to branch viewing pages if immediate patching is not possible
bash
# Example Content Security Policy header configuration for nginx
# Add to your Gogs server block as a temporary mitigation
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; object-src 'none';" always;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechGogs

  • SeverityMEDIUM

  • CVSS Score6.9

  • Known ExploitedNo
  • CVSS Vector
  • 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Commit Details

  • GitHub Pull Request Overview

  • GitHub Release v0.14.2

  • GitHub Security Advisory GHSA-vgvf-m4fw-938j
  • Related CVEs
  • CVE-2026-26276: Gogs Self-Hosted Git Service XSS Flaw

  • CVE-2026-26022: Gogs Git Service Stored XSS Vulnerability

  • CVE-2026-26196: Gogs Information Disclosure Vulnerability

  • CVE-2026-25921: Gogs LFS Supply-Chain Attack Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English