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-2023-29402

CVE-2023-29402: Golang Go RCE Vulnerability

CVE-2023-29402 is a remote code execution vulnerability in Golang Go that enables unexpected code generation during build time when using cgo. This article covers the technical details, affected versions, and mitigation strategies.

Published: February 4, 2026

CVE-2023-29402 Overview

CVE-2023-29402 is a code injection vulnerability in the Go programming language's build system. The go command may generate unexpected code at build time when using cgo if an untrusted module contains directories with newline characters in their names. This can result in arbitrary code execution when building or running a Go program that uses cgo components from malicious sources.

Critical Impact

This vulnerability allows attackers to inject malicious code during the build process by exploiting improper handling of newline characters in directory names, potentially leading to complete system compromise.

Affected Products

  • Golang Go (versions prior to patch)
  • Fedora 38 (via bundled Go packages)

Discovery Timeline

  • 2023-06-08 - CVE-2023-29402 published to NVD
  • 2025-01-06 - Last updated in NVD database

Technical Details for CVE-2023-29402

Vulnerability Analysis

This vulnerability exists in the Go toolchain's handling of cgo during the build process. When processing module directories, the go command fails to properly sanitize directory names containing newline characters. This allows an attacker to craft a malicious module with specially named directories that can inject arbitrary commands or code into the build process.

The vulnerability is classified as CWE-94 (Improper Control of Generation of Code - Code Injection), indicating that the core issue lies in the build system's failure to properly validate and sanitize input that becomes part of generated code or commands.

Notably, modules retrieved using the standard go get command are not affected by this vulnerability. However, modules retrieved using GOPATH-mode (when GO111MODULE=off is set) may be vulnerable. This distinction is important as it affects the attack surface and potential exploitation scenarios.

Root Cause

The root cause is improper input validation in the Go toolchain's cgo processing. When the build system encounters directory names during compilation, it fails to properly escape or reject directory names containing newline characters. These newlines can be interpreted as command separators or code delimiters, allowing injected content to be executed during the build process.

Attack Vector

The attack is network-based and requires no authentication or user interaction beyond building an untrusted module. An attacker can create a malicious Go module containing directories with carefully crafted names that include newline characters. When a victim builds this module with cgo enabled, the newline characters break out of the expected context and inject malicious code or commands into the build process.

The attack scenario typically involves:

  1. Attacker creates a malicious Go module with directory names containing embedded newline characters
  2. Victim clones or downloads the module (particularly via GOPATH-mode)
  3. Victim attempts to build the module with cgo enabled
  4. The build system processes the malicious directory names without proper sanitization
  5. Injected code executes with the privileges of the build process

Detection Methods for CVE-2023-29402

Indicators of Compromise

  • Unusual directory names in Go module dependencies containing non-printable or special characters
  • Unexpected processes spawned during Go build operations
  • Build logs showing unusual or injected commands
  • Anomalous network activity during module compilation

Detection Strategies

  • Implement file integrity monitoring on Go modules and build directories to detect suspicious directory naming patterns
  • Monitor build process execution for unexpected child processes or system calls
  • Use SentinelOne's behavioral AI to detect anomalous activity during development and build workflows
  • Audit Go module dependencies for untrusted or suspicious sources before building

Monitoring Recommendations

  • Enable verbose logging for Go build processes to capture detailed build output
  • Implement runtime protection on development and CI/CD systems to detect code injection attempts
  • Monitor for builds using GOPATH-mode (GO111MODULE=off) which are more susceptible to this vulnerability
  • Deploy endpoint protection on build servers to detect and prevent malicious code execution

How to Mitigate CVE-2023-29402

Immediate Actions Required

  • Update Go to the latest patched version immediately
  • Avoid building untrusted Go modules, especially those not retrieved via go get
  • Ensure GO111MODULE is not set to off to benefit from the protections in module mode
  • Audit existing Go projects for any dependencies with suspicious directory names

Patch Information

Golang has released patches to address this vulnerability. The fix is available in the Go.dev Code Review and documented in the Go.dev Vulnerability Advisory. Users should update to the latest stable version of Go that includes these security fixes.

Distribution-specific updates are available:

  • Fedora Package Announcements
  • Gentoo Security Advisory GLSA 202311-09
  • NetApp Security Advisory

Workarounds

  • Use go get for module retrieval instead of GOPATH-mode to reduce exposure
  • Implement build sandboxing to limit the impact of potential code injection
  • Review and validate all third-party module sources before building
  • Consider disabling cgo (CGO_ENABLED=0) for builds that don't require it
bash
# Ensure module mode is enabled (not vulnerable to GOPATH-mode attacks)
export GO111MODULE=on

# Disable cgo if not required for your build
export CGO_ENABLED=0

# Verify Go version includes security patches
go version

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGolang Go

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.12%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-94
  • Technical References
  • Go.dev Issue Tracker

  • Google Group Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA 202311-09

  • NetApp Security Advisory
  • Vendor Resources
  • Go.dev Code Review

  • Go.dev Vulnerability Advisory
  • Related CVEs
  • CVE-2023-29405: Golang Go RCE Vulnerability

  • CVE-2025-0913: Golang Go Symlink Handling Vulnerability

  • CVE-2023-45283: Golang Go Path Traversal Vulnerability

  • CVE-2022-32190: Golang 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