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-2025-4674

CVE-2025-4674: Go Command RCE Vulnerability in VCS

CVE-2025-4674 is a remote code execution vulnerability in the Go command that allows unexpected command execution in untrusted VCS repositories. This article covers technical details, affected systems, impact, and mitigation.

Updated: January 22, 2026

CVE-2025-4674 Overview

CVE-2025-4674 is a command injection vulnerability affecting the Go programming language toolchain. The go command may execute unexpected commands when operating in untrusted version control system (VCS) repositories. This occurs when potentially dangerous VCS configuration is present in repositories, specifically when a repository was fetched via one VCS (e.g., Git) but contains metadata for another VCS (e.g., Mercurial). Importantly, modules retrieved using the go command line via go get are not affected by this vulnerability.

Critical Impact

Attackers can craft malicious repositories that execute arbitrary commands when developers work with them locally, potentially leading to complete system compromise with high confidentiality, integrity, and availability impact.

Affected Products

  • Go programming language toolchain (versions prior to security patch)
  • Development environments using the go command with local VCS repositories
  • Build systems that operate on untrusted VCS repositories

Discovery Timeline

  • 2025-07-29 - CVE CVE-2025-4674 published to NVD
  • 2025-11-04 - Last updated in NVD database

Technical Details for CVE-2025-4674

Vulnerability Analysis

This vulnerability is classified under CWE-73 (External Control of File Name or Path), which relates to the improper handling of externally controlled input that affects file system operations. The vulnerability stems from the Go toolchain's handling of VCS metadata within repositories.

When a developer works with a local repository, the Go command processes VCS configuration files to determine how to interact with the repository. The vulnerability arises when a repository contains conflicting VCS metadata—for example, a Git repository that also contains Mercurial configuration files (.hg directory or .hgrc files). The Go toolchain may inadvertently process the secondary VCS configuration, which can contain malicious commands or hooks that execute during repository operations.

The local attack vector requires user interaction, meaning an attacker must convince a developer to clone or work with a malicious repository. However, once this occurs, the impact is severe with the ability to achieve code execution in the context of the developer's user session.

Root Cause

The root cause is improper validation and handling of VCS metadata when multiple VCS systems have configuration present in the same repository. The Go command does not properly isolate or validate VCS configuration files, allowing attacker-controlled configuration from an unexpected VCS system to influence command execution. This represents an external control vulnerability where file paths and configuration options can be manipulated to execute arbitrary commands.

Attack Vector

The attack requires local access and user interaction. An attacker crafts a repository that appears legitimate but contains hidden malicious VCS configuration for a secondary version control system. The attack sequence typically involves:

  1. An attacker creates a Git repository with a seemingly legitimate Go module
  2. The attacker embeds malicious Mercurial (or other VCS) configuration files within the repository
  3. A developer clones the repository and runs Go commands within it
  4. The Go toolchain processes the malicious VCS configuration, executing attacker-controlled commands

The vulnerability specifically affects operations on local repositories and does not impact modules retrieved via go get from remote sources, as those go through a different code path with proper sanitization.

Detection Methods for CVE-2025-4674

Indicators of Compromise

  • Presence of unexpected VCS configuration directories (e.g., .hg, .svn, .bzr) in Git repositories
  • Unusual process spawning from Go toolchain commands during build operations
  • Execution of VCS binaries (mercurial, svn, bzr) in contexts where only Git operations are expected
  • Suspicious entries in VCS configuration files containing shell commands or external script references

Detection Strategies

  • Implement file integrity monitoring to detect the addition of unexpected VCS metadata directories in repositories
  • Monitor process creation events for unusual child processes spawned by Go toolchain executables
  • Use static analysis tools to scan repositories for the presence of multiple VCS configuration systems
  • Implement repository scanning in CI/CD pipelines to detect conflicting VCS metadata before builds execute

Monitoring Recommendations

  • Enable verbose logging for Go toolchain operations in development and build environments
  • Configure endpoint detection to alert on VCS binary execution in unexpected contexts
  • Implement repository hygiene checks that flag multi-VCS metadata scenarios
  • Monitor developer workstations for unusual command execution patterns during Go build operations

How to Mitigate CVE-2025-4674

Immediate Actions Required

  • Update the Go toolchain to the latest patched version as indicated in the Go.dev Change Log Entry
  • Review any locally cloned repositories for unexpected VCS configuration directories
  • Audit build systems and development environments for untrusted repository sources
  • Implement repository scanning to detect repositories containing multiple VCS system metadata

Patch Information

The Go development team has released a security patch addressing this vulnerability. Details are available through the official Go.dev Vulnerability Report. The fix ensures proper isolation and validation of VCS configuration when the Go command operates on repositories, preventing the execution of commands from conflicting VCS metadata. Administrators should review the Golang Announcement on Google Groups and the Go.dev Issue Tracker Post for additional context and upgrade guidance.

Workarounds

  • Avoid working with repositories from untrusted sources until the patch is applied
  • Manually inspect cloned repositories for unexpected VCS configuration directories before running Go commands
  • Remove any unexpected VCS metadata directories (.hg, .svn, .bzr) from repositories before use
  • Use containerized or sandboxed build environments to limit the impact of potential exploitation
  • Implement pre-commit hooks that validate repository contents do not contain conflicting VCS metadata
bash
# Check for unexpected VCS metadata in a repository
find . -type d \( -name ".hg" -o -name ".svn" -o -name ".bzr" \) -print

# Remove unexpected Mercurial metadata if found in a Git repository
rm -rf .hg .hgrc

# Verify only expected VCS configuration exists
ls -la | grep -E "^\.(git|hg|svn|bzr)"

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGo

  • SeverityHIGH

  • CVSS Score8.6

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-73
  • Technical References
  • Go.dev Change Log Entry

  • Go.dev Issue Tracker Post

  • Golang Announcement on Google Groups

  • Go.dev Vulnerability Report

  • Openwall OSS Security Mailing List
  • Related CVEs
  • CVE-2023-24531: Go Environment Command RCE Vulnerability

  • CVE-2026-33252: Go MCP SDK CSRF Vulnerability

  • CVE-2026-27896: Go MCP SDK Auth Bypass Vulnerability

  • CVE-2025-61731: Go cmd/go Path Traversal 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