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

CVE-2023-29405: Golang Go RCE Vulnerability

CVE-2023-29405 is a remote code execution vulnerability in Golang Go affecting the gccgo compiler. Attackers can execute arbitrary code at build time through malicious linker flags. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: February 11, 2026

CVE-2023-29405 Overview

CVE-2023-29405 is a critical arbitrary code execution vulnerability in the Go programming language's build system when using cgo. The vulnerability allows attackers to execute arbitrary code at build time through maliciously crafted linker flags. This can occur when running go get on a malicious module or when building any untrusted code that leverages cgo's LDFLAGS directive.

The flaw specifically affects how the Go toolchain sanitizes linker flags specified via #cgo LDFLAGS directives. Flags containing embedded spaces are mishandled, enabling attackers to smuggle disallowed flags through the sanitization process by embedding them within the arguments of permitted flags. This vulnerability only affects users of the gccgo compiler.

Critical Impact

Attackers can achieve arbitrary code execution on developer machines and build systems by distributing malicious Go modules, potentially leading to supply chain compromises and complete system takeover.

Affected Products

  • Golang Go (versions prior to patched releases)
  • Fedora Project Fedora 38
  • Systems using the gccgo compiler with cgo enabled

Discovery Timeline

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

Technical Details for CVE-2023-29405

Vulnerability Analysis

This vulnerability represents an injection flaw (CWE-74) in the Go toolchain's handling of cgo linker flags. When developers use cgo to interface Go code with C libraries, they can specify linker flags using the #cgo LDFLAGS directive within Go source files. The Go toolchain implements a sanitization mechanism to prevent dangerous linker flags from being passed to the underlying compiler.

However, the sanitization logic fails to properly handle flags that contain embedded spaces. This parsing weakness allows attackers to construct specially crafted LDFLAGS values where malicious flags are hidden within what appears to be a valid argument to a permitted flag. When the Go toolchain processes these flags, the embedded malicious options bypass the sanitization checks and are passed directly to gccgo.

The impact is significant because the attack can be triggered simply by building untrusted code. This includes scenarios where a developer runs go get to fetch a dependency from an untrusted source, making this vulnerability particularly dangerous in supply chain attack scenarios.

Root Cause

The root cause lies in the insufficient parsing of whitespace-separated arguments within the LDFLAGS directive sanitization code. The sanitization logic evaluates flags as discrete tokens but fails to account for cases where a single token contains embedded spaces that, when passed to the shell or linker, would be interpreted as multiple separate arguments.

This parsing inconsistency between the Go toolchain's sanitization layer and the actual command-line processing by gccgo creates a security gap that attackers can exploit to inject arbitrary linker options that would normally be blocked.

Attack Vector

The attack vector is network-based, requiring no authentication or user interaction beyond the normal development workflow. An attacker can exploit this vulnerability by:

  1. Creating a malicious Go module containing cgo code with specially crafted LDFLAGS
  2. Publishing the module to a public repository or tricking a developer into using it as a dependency
  3. When the victim builds the module using gccgo, the embedded malicious linker flags execute arbitrary code

The vulnerability mechanism involves constructing LDFLAGS values where disallowed flags are embedded within spaces inside what appears to be a permitted flag's argument. When the sanitizer parses the directive, it sees a single permitted flag with an argument. However, when passed to the shell for execution, the embedded spaces cause the argument to be split, resulting in the smuggled flags being executed.

For detailed technical information about the vulnerability mechanism, see the Go.dev Issue Tracker and the Golang Announce Message.

Detection Methods for CVE-2023-29405

Indicators of Compromise

  • Unusual or unexpected linker flags in cgo directives within Go source files, particularly those containing embedded spaces
  • Build logs showing linker flags that should have been blocked by the Go toolchain's sanitization
  • Unexpected processes spawned during Go build operations
  • Unexplained modifications to built binaries or system files following Go module compilation

Detection Strategies

  • Audit third-party Go dependencies for suspicious #cgo LDFLAGS directives before including them in projects
  • Implement static analysis scanning of Go source files to detect potentially malicious cgo directives with unusual spacing patterns
  • Monitor build system logs for anomalous linker invocations or unexpected command-line arguments
  • Use software composition analysis (SCA) tools to identify vulnerable Go toolchain versions in development environments

Monitoring Recommendations

  • Enable verbose logging for Go build operations to capture full linker command lines
  • Implement file integrity monitoring on build systems to detect unauthorized modifications during compilation
  • Deploy endpoint detection on developer workstations to identify unexpected code execution during build processes
  • Establish baseline behavior for build processes and alert on deviations

How to Mitigate CVE-2023-29405

Immediate Actions Required

  • Upgrade the Go toolchain to a patched version immediately on all development and build systems
  • Audit existing codebases for any untrusted dependencies that may contain malicious cgo directives
  • Consider temporarily disabling cgo (CGO_ENABLED=0) for builds that do not require C interoperability
  • Review and restrict the sources from which Go modules can be fetched in CI/CD pipelines

Patch Information

The Go team has released patches to address this vulnerability. The fix improves the sanitization logic to properly handle LDFLAGS containing embedded spaces, preventing the smuggling of disallowed flags.

For patch details, see the Go.dev Change Log and the Go Vulnerability Advisory.

Additional security advisories have been released by downstream distributors:

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

Workarounds

  • Disable cgo by setting CGO_ENABLED=0 if C interoperability is not required for your project
  • Avoid using the gccgo compiler; switch to the standard gc compiler which may not be affected by this specific issue
  • Implement strict vetting processes for all third-party Go modules before inclusion in projects
  • Use module proxies and private module repositories to control which external dependencies can be fetched
bash
# Disable cgo to prevent exploitation
export CGO_ENABLED=0

# Build without cgo support
go build -a ./...

# Verify cgo is disabled in builds
go env | grep CGO_ENABLED

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.33%

  • 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-74
  • Technical References
  • Go.dev Issue Tracker

  • Golang Announce Message

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA 202311-09

  • NetApp Security Advisory
  • Vendor Resources
  • Go.dev Change Log

  • Go Vulnerability Advisory
  • Related CVEs
  • CVE-2023-29402: 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