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

CVE-2023-29404: Golang Go RCE Vulnerability

CVE-2023-29404 is a remote code execution flaw in Golang Go that allows arbitrary code execution at build time through malicious cgo linker flags. This article covers the technical details, affected versions, and mitigation.

Published: January 28, 2026

CVE-2023-29404 Overview

CVE-2023-29404 is a critical arbitrary code execution vulnerability in the Go programming language's build toolchain. The vulnerability exists in the go command when using cgo, which may execute arbitrary code at build time. This can be triggered when running go get on a malicious module, or when running any other command that builds untrusted code. The flaw stems from improper handling of linker flags specified via #cgo LDFLAGS directives, where arguments for certain flags that are non-optional are incorrectly considered optional, allowing disallowed flags to be smuggled through the LDFLAGS sanitization process.

Critical Impact

Attackers can achieve arbitrary code execution on developer machines and build systems by crafting malicious Go modules that exploit the LDFLAGS sanitization bypass, affecting both gc and gccgo compilers.

Affected Products

  • Golang Go (versions prior to patched releases)
  • Fedora Project Fedora 38
  • Systems using gc and gccgo compilers with cgo

Discovery Timeline

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

Technical Details for CVE-2023-29404

Vulnerability Analysis

This vulnerability represents a Code Injection flaw (CWE-94) in the Go toolchain's cgo subsystem. The issue arises during the build process when the Go command processes #cgo LDFLAGS directives embedded in Go source files. The Go toolchain implements a sanitization mechanism to prevent dangerous linker flags from being passed to the underlying linker. However, a logic flaw in this sanitization allows attackers to bypass these security controls.

The vulnerability affects the entire build pipeline, meaning any Go project that processes untrusted modules—whether through go get, go build, go install, or similar commands—could be exploited. The attack requires no privileges from the perspective of the build system and can be triggered remotely by convincing a developer to build a malicious module.

Root Cause

The root cause lies in the LDFLAGS sanitization logic within the Go toolchain. The sanitizer incorrectly treats certain mandatory flag arguments as optional. This misclassification creates a parsing discrepancy where an attacker can craft LDFLAGS that appear benign to the sanitizer but result in dangerous linker behavior when actually processed.

Specifically, when the Go command parses #cgo LDFLAGS directives, it validates flags against an allowlist to prevent injection of malicious linker options. However, the validator's understanding of flag argument requirements differs from the actual linker's parsing behavior, creating a bypass opportunity where disallowed flags can be "smuggled" through the sanitization layer.

Attack Vector

The attack is network-based and requires no user interaction beyond the normal development workflow. An attacker can exploit this vulnerability through several vectors:

  1. Malicious Module Publication: Publishing a Go module to a public repository containing crafted #cgo LDFLAGS directives
  2. Supply Chain Attack: Compromising an existing dependency to inject malicious LDFLAGS
  3. Social Engineering: Convincing developers to build untrusted code that contains the exploit

When a developer or CI/CD system runs commands like go get or go build against the malicious module, the crafted linker flags bypass sanitization and execute arbitrary code during the linking phase. The linker flags can be abused to load malicious shared libraries, execute arbitrary commands, or modify the build output in dangerous ways.

The attack mechanism involves crafting LDFLAGS that exploit the argument parsing discrepancy. For detailed technical information about the vulnerability, refer to the Go.dev Issue Report and the official vulnerability report.

Detection Methods for CVE-2023-29404

Indicators of Compromise

  • Presence of unusual or obfuscated #cgo LDFLAGS directives in Go source files within dependencies
  • Build logs showing unexpected linker flags being passed to the linker
  • Unusual network activity or file system changes during Go build operations
  • Unexpected shared library loads during the build process

Detection Strategies

  • Audit Go module dependencies for suspicious #cgo directives before building
  • Implement build isolation using containers or sandboxed environments to limit potential damage
  • Monitor build processes for unexpected child processes or network connections
  • Use go mod vendor and manually review vendored dependencies for suspicious cgo directives
  • Enable verbose build logging with go build -x to review actual linker commands

Monitoring Recommendations

  • Configure logging for all Go build operations in CI/CD pipelines
  • Implement dependency scanning tools that analyze #cgo directives in third-party modules
  • Monitor for new or modified Go files containing #cgo LDFLAGS patterns in your codebase
  • Set up alerts for builds that invoke unusual linker flags or load unexpected shared objects

How to Mitigate CVE-2023-29404

Immediate Actions Required

  • Update Go to the latest patched version immediately on all development machines and build systems
  • Audit existing projects for dependencies that may contain malicious #cgo directives
  • Avoid building untrusted Go modules until the update is applied
  • Review CI/CD pipeline configurations to ensure they use patched Go versions
  • Consider disabling cgo (CGO_ENABLED=0) for projects that don't require it

Patch Information

The Go team has released patches to address this vulnerability. The fix is available in the Go.dev Change Log (CL 501225). Users should update to the latest stable Go release. Additional security advisories have been issued by Fedora, Gentoo, and NetApp.

Workarounds

  • Disable cgo by setting CGO_ENABLED=0 for builds that don't require C interoperability
  • Use go mod vendor and manually audit all vendored dependencies for suspicious directives
  • Build Go code in isolated, sandboxed environments to limit the impact of potential exploitation
  • Implement strict allow-lists for external module dependencies in your projects
bash
# Configuration example
# Disable cgo to prevent exploitation (if C interoperability is not required)
export CGO_ENABLED=0
go build -v ./...

# Alternatively, vendor dependencies and audit before building
go mod vendor
# Review vendor/ directory for suspicious #cgo directives
grep -r "#cgo LDFLAGS" vendor/

# Build in a sandboxed environment
docker run --rm -v $(pwd):/app -w /app golang:latest go build -v ./...

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGolang

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.08%

  • 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 Report

  • Golang Announce Post

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA Advisory

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

  • Go.dev Vulnerability Report
  • Related CVEs
  • CVE-2023-39323: Golang Go RCE Vulnerability

  • CVE-2022-30580: Golang Go Code Injection RCE Vulnerability

  • CVE-2020-9283: Golang Package SSH RCE Vulnerability

  • CVE-2025-68121: Golang Go Auth Bypass 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