A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2024-39932

CVE-2024-39932: Gogs Argument Injection RCE Vulnerability

CVE-2024-39932 is an argument injection vulnerability in Gogs that enables remote code execution during change previews. This article covers the technical details, affected versions through 0.13.0, security impact, and mitigation.

Published: May 26, 2026

CVE-2024-39932 Overview

CVE-2024-39932 is an argument injection vulnerability affecting Gogs self-hosted Git service through version 0.13.0. The flaw exists in the change preview functionality, where attacker-controlled input is passed as arguments to Git command-line operations. Authenticated users with write access to a repository can inject Git command flags during the diff preview process, leading to arbitrary code execution on the host server. The vulnerability is tracked under CWE-94: Improper Control of Generation of Code. SonarSource researchers documented the issue as part of a broader review of unpatched Gogs vulnerabilities.

Critical Impact

Authenticated attackers can execute arbitrary commands on the Gogs server, leading to full compromise of source code repositories, credentials, and the underlying host system.

Affected Products

  • Gogs through version 0.13.0
  • All self-hosted Gogs instances exposing the change preview feature
  • Deployments where authenticated users can submit diff previews

Discovery Timeline

  • 2024-07-04 - CVE-2024-39932 published to NVD
  • 2025-04-10 - Last updated in NVD database

Technical Details for CVE-2024-39932

Vulnerability Analysis

The vulnerability resides in the Gogs change-preview code path, which invokes the underlying git binary to render diffs. User-supplied parameters from the preview request are concatenated into the Git command line without sufficient separation between options and operands. Because Git supports a wide range of command-line flags that can alter execution behavior, an attacker who controls one of these arguments can transform a benign read operation into one that executes arbitrary code.

The issue maps to CWE-94: Improper Control of Generation of Code. The EPSS probability of 3.23% places this CVE in the 87th percentile of CVEs by exploitation likelihood, indicating elevated attacker interest relative to most published vulnerabilities. Refer to the SonarSource analysis of Gogs vulnerabilities for the full technical breakdown.

Root Cause

The root cause is the absence of an argument terminator (--) and inadequate validation of user-controlled values before they are passed to git subcommands. When a value begins with a - or --, Git interprets it as an option rather than a positional argument such as a file path or revision identifier.

Attack Vector

Exploitation requires an authenticated account with permission to trigger the preview function on a repository. The attacker crafts a request containing a filename or revision argument that Git parses as a flag enabling external command execution. The malicious flag causes git to spawn an attacker-controlled process under the Gogs service account. Because the attack uses the network-facing web interface, no local access to the server is required.

No verified public exploit code is available for inclusion. See the SonarSource advisory for technical reproduction details.

Detection Methods for CVE-2024-39932

Indicators of Compromise

  • Unexpected child processes spawned by the Gogs service account, particularly shells or interpreters such as sh, bash, python, or perl
  • HTTP requests to Gogs preview or diff endpoints containing parameters beginning with - or --
  • New or modified SSH keys, webhooks, or deploy keys appearing in repository configuration without administrator action
  • Outbound network connections originating from the Gogs host to unfamiliar destinations

Detection Strategies

  • Inspect Gogs application logs for preview requests with suspicious revision or path parameters containing flag-like syntax
  • Correlate web access logs with process creation events on the Gogs host to identify command execution following diff preview requests
  • Monitor the parent-child process relationship under the gogs user for any non-git child executions

Monitoring Recommendations

  • Forward Gogs HTTP access logs and host process telemetry to a centralized analytics platform for correlation
  • Alert on any execution of shells or scripting interpreters as descendants of the Gogs process
  • Review repository audit logs for unauthorized changes to hooks, settings, or access tokens

How to Mitigate CVE-2024-39932

Immediate Actions Required

  • Upgrade Gogs to a version later than 0.13.0 that addresses the argument injection flaw; consult the Gogs release notes for the current fixed release
  • Restrict Gogs to trusted authenticated users and disable open registration until patching is complete
  • Rotate credentials, deploy keys, and webhook secrets stored on the Gogs instance if exposure is suspected
  • Audit repository hooks and server-side configuration files for unauthorized modifications

Patch Information

Review the Gogs GitHub releases page for the latest version and apply the upgrade following the project's documented procedure. The SonarSource disclosure documents the patch status at the time of publication and should be consulted to confirm fixed versions.

Workarounds

  • Place the Gogs web interface behind a reverse proxy or web application firewall that blocks request parameters containing -- prefixes in revision or path fields
  • Run the Gogs process as an unprivileged user inside a hardened container with restricted egress to limit post-exploitation impact
  • Disable or restrict access to the change preview feature for untrusted users where operationally feasible
bash
# Example: restrict Gogs to authenticated internal users via reverse proxy
location /gogs/ {
    allow 10.0.0.0/8;
    deny  all;
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header X-Real-IP $remote_addr;
}

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGogs

  • SeverityCRITICAL

  • CVSS Score9.9

  • EPSS Probability3.23%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-94
  • Technical References
  • GitHub Gogs Release Notes
  • Vendor Resources
  • SonarSource Blog on Gogs Vulnerabilities
  • Related CVEs
  • CVE-2026-26194: Gogs Git Service RCE Vulnerability

  • CVE-2025-64111: Gogs Git Service RCE Vulnerability

  • CVE-2025-8110: Gogs RCE Vulnerability via Symlink Handling

  • CVE-2024-56731: Gogs Remote Code Execution Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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