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-26022

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

CVE-2026-26022 is a stored XSS vulnerability in Gogs Git service that allows authenticated users to inject malicious JavaScript via data URIs. This article covers technical details, affected versions, and mitigation.

Published: March 6, 2026

CVE-2026-26022 Overview

CVE-2026-26022 is a stored cross-site scripting (XSS) vulnerability affecting Gogs, an open source self-hosted Git service. Prior to version 0.14.2, the application's HTML sanitizer explicitly allows data: URI schemes in comment and issue description functionality, enabling authenticated users to inject arbitrary JavaScript execution via malicious links. This vulnerability allows attackers to persist malicious scripts that execute in victims' browsers when viewing affected content.

Critical Impact

Authenticated attackers can inject persistent JavaScript payloads through comments and issue descriptions, potentially leading to session hijacking, credential theft, and unauthorized actions on behalf of other users within the Gogs application.

Affected Products

  • Gogs versions prior to 0.14.2
  • Self-hosted Git service installations using vulnerable Gogs releases
  • Any Gogs deployment with comment and issue functionality enabled

Discovery Timeline

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

Technical Details for CVE-2026-26022

Vulnerability Analysis

This stored XSS vulnerability stems from insufficient input sanitization in Gogs' markup processing component. The HTML sanitizer used by the application explicitly permits data: URI schemes without proper restrictions, creating an attack surface for JavaScript injection. When an authenticated user crafts a malicious link using a data: URI containing JavaScript code and embeds it in a comment or issue description, the payload becomes persistently stored in the database.

When other users view the affected content, their browsers interpret and execute the injected JavaScript within the context of the Gogs application. This can lead to session token theft, unauthorized actions performed on behalf of victims, defacement of repository content, or redirection to malicious external sites. The attack requires network access and user interaction (viewing the malicious content), but the scope change allows the vulnerability to impact resources beyond the vulnerable component.

Root Cause

The vulnerability exists in the internal/markup/sanitizer.go file where the HTML sanitization policy was configured to allow data: URI schemes broadly without restricting them to safe MIME types. The bluemonday HTML sanitizer library provides flexible configuration options, but the Gogs implementation failed to properly constrain data URIs to only permit safe content types like images.

Attack Vector

The attack vector is network-based and requires authentication to inject the payload, but only user interaction (viewing) to trigger execution. An attacker with a valid Gogs account can:

  1. Navigate to any issue or pull request comment section
  2. Insert a crafted link using a data: URI containing encoded JavaScript
  3. Submit the comment, persisting the payload
  4. Wait for victims to view the affected content, triggering script execution

The security patch addresses this by restricting data: URI schemes to only safe image MIME types:

go
 package markup
 
 import (
+	"net/url"
+	"strings"
 	"sync"
 
 	"github.com/microcosm-cc/bluemonday"

Source: GitHub Commit Update

Detection Methods for CVE-2026-26022

Indicators of Compromise

  • Presence of data: URIs containing JavaScript or non-image MIME types in issue descriptions or comments
  • Unusual data:text/html or data:application/javascript patterns in stored content
  • User reports of unexpected browser behavior when viewing specific issues or comments
  • Audit logs showing suspicious comment or issue edit activity from compromised accounts

Detection Strategies

  • Implement content security policy (CSP) headers to restrict inline script execution
  • Deploy web application firewalls (WAF) with rules to detect data: URI injection patterns
  • Monitor database content for data: URIs with non-image MIME types in comment and issue tables
  • Enable browser-side XSS auditing and report violations to security monitoring systems

Monitoring Recommendations

  • Audit stored content periodically for malicious data: URI patterns
  • Monitor user session activity for signs of session hijacking following XSS exploitation
  • Review Gogs access logs for unusual patterns indicating automated exploitation attempts
  • Configure SentinelOne endpoint protection to detect and block malicious script execution in browser contexts

How to Mitigate CVE-2026-26022

Immediate Actions Required

  • Upgrade Gogs to version 0.14.2 or later immediately
  • Audit existing issue descriptions and comments for potentially malicious data: URI content
  • Implement Content Security Policy headers to provide defense-in-depth against XSS attacks
  • Review user access and consider temporarily restricting comment functionality until patched

Patch Information

The vulnerability has been addressed in Gogs version 0.14.2. The fix restricts data: URI schemes to only safe image MIME types, preventing JavaScript execution through this attack vector. Detailed information about the security patch is available in the GitHub Security Advisory GHSA-xrcr-gmf5-2r8j and the GitHub Release v0.14.2. The specific code changes can be reviewed in GitHub Pull Request 8174.

Workarounds

  • Deploy a reverse proxy with custom rules to strip or sanitize data: URIs from user-submitted content
  • Implement strict Content Security Policy headers with script-src 'self' to block inline script execution
  • Disable comment and issue description functionality temporarily if immediate patching is not possible
  • Use browser extensions or enterprise policies to block data: URI execution in the Gogs domain
bash
# Configuration example - Add CSP headers via reverse proxy (nginx)
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self';" 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

  • SeverityHIGH

  • CVSS Score8.7

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Commit Update

  • GitHub Pull Request 8174

  • GitHub Release v0.14.2

  • GitHub Security Advisory GHSA-xrcr-gmf5-2r8j
  • Related CVEs
  • CVE-2026-26276: Gogs Self-Hosted Git Service XSS Flaw

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

  • 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