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

CVE-2023-39323: Golang Go RCE Vulnerability

CVE-2023-39323 is a remote code execution flaw in Golang Go that exploits line directives to bypass compiler restrictions. This post explains the technical details, affected versions, impact, and mitigation steps.

Published: February 11, 2026

CVE-2023-39323 Overview

CVE-2023-39323 is a code execution vulnerability in the Go programming language toolchain that allows attackers to bypass security restrictions on //go:cgo_ directives through the abuse of line directives (//line). This bypass enables blocked linker and compiler flags to be passed during compilation, potentially resulting in unexpected execution of arbitrary code when running go build.

The vulnerability is particularly concerning for software supply chain security, as malicious code could be introduced through seemingly innocuous Go source files. While exploitation requires knowledge of the absolute path of the file containing the directive, making attacks more complex, the potential impact of arbitrary code execution during the build process remains significant.

Critical Impact

Arbitrary code execution during Go compilation through bypassed cgo directive restrictions, enabling supply chain attacks via malicious source files.

Affected Products

  • Golang Go (versions prior to security patches)
  • Fedora 37
  • Fedora 38
  • Fedora 39

Discovery Timeline

  • 2023-10-05 - CVE-2023-39323 published to NVD
  • 2025-06-12 - Last updated in NVD database

Technical Details for CVE-2023-39323

Vulnerability Analysis

The Go compiler includes security mechanisms to restrict certain //go:cgo_ directives, which control how the Go toolchain interacts with C code and system linkers. These restrictions exist to prevent malicious source files from injecting dangerous compiler or linker flags that could lead to code execution during the build process.

This vulnerability exploits a logic flaw in how the Go compiler processes line directives. The //line directive is a standard Go feature that allows source files to report a different file name and line number for error messages and debugging information. By crafting specific //line directives, an attacker can manipulate the compiler's internal state to bypass the security checks that normally block dangerous //go:cgo_ directives.

Successful exploitation could allow an attacker to pass arbitrary flags to the compiler or linker during a go build operation. This could result in execution of attacker-controlled code on the machine performing the build, making this vulnerability particularly dangerous in CI/CD pipelines and automated build environments.

Root Cause

The root cause of CVE-2023-39323 lies in insufficient validation of the interaction between line directives and cgo directive restrictions. The Go compiler's security checks for //go:cgo_ directives do not properly account for the filename and location manipulation capabilities provided by //line directives. This allows attackers to effectively "spoof" the apparent source location of their code, circumventing the intended security boundaries.

The requirement that the //line directive must specify the absolute path of the file adds complexity to exploitation but does not eliminate the vulnerability. An attacker with knowledge of the target build environment's file structure can still craft effective exploits.

Attack Vector

The attack vector is network-based, as malicious Go source files could be distributed through various channels including:

  • Compromised or malicious Go module dependencies
  • Poisoned package repositories
  • Pull requests or commits to shared codebases
  • Downloaded source code archives

When a developer or build system executes go build on a project containing the malicious source file, the crafted directives trigger arbitrary code execution. The attack does not require user interaction beyond the normal build process, though the high complexity stems from the need to know the exact absolute file path on the target system.

The vulnerability mechanism involves inserting specially crafted //line directives that manipulate the compiler's perception of source file locations, followed by //go:cgo_ directives with malicious linker or compiler flags that would normally be blocked. See the Go Vulnerability Report GO-2023-2095 for complete technical details.

Detection Methods for CVE-2023-39323

Indicators of Compromise

  • Presence of //line directives with absolute file paths in Go source files, especially in third-party dependencies
  • Unusual //go:cgo_ directives appearing after //line directives in source code
  • Unexpected processes spawned during go build operations
  • Build logs showing compiler or linker flags that were not explicitly configured

Detection Strategies

  • Implement static analysis scanning of Go source files for suspicious combinations of //line and //go:cgo_ directives
  • Monitor build systems for unexpected process execution during compilation phases
  • Use software composition analysis (SCA) tools to audit dependencies for known vulnerable Go versions
  • Enable verbose build logging to capture compiler and linker invocations for anomaly detection

Monitoring Recommendations

  • Audit all Go source files in your codebase and dependencies for //line directives with absolute paths
  • Implement file integrity monitoring on build servers to detect unauthorized modifications
  • Configure build pipelines to use isolated, ephemeral environments with restricted network access
  • Monitor for updates to Go vulnerability databases and ensure timely patching of the Go toolchain

How to Mitigate CVE-2023-39323

Immediate Actions Required

  • Update the Go toolchain to the latest patched version immediately on all development machines and build servers
  • Review recent additions to your Go dependencies for any suspicious directive patterns
  • Audit CI/CD pipelines and build environments for vulnerable Go versions
  • Consider temporarily disabling cgo if not required for your projects

Patch Information

The Go team has released patches addressing this vulnerability. Organizations should update their Go installations to patched versions as documented in the official security advisories:

  • Go Dev Change 533215 - The official fix
  • Go Issue 63211 - Issue tracker entry
  • Go Vulnerability Report GO-2023-2095 - Official vulnerability report
  • Golang Announcement - Security announcement

Fedora users should apply the relevant security updates for their distribution version as documented in the Fedora Package Announcements.

Workarounds

  • Disable cgo compilation by setting the CGO_ENABLED=0 environment variable if your project does not require C interoperability
  • Implement source code review policies requiring inspection of //line directives before merging
  • Use sandboxed or containerized build environments to limit the impact of potential exploitation
  • Consider using go mod vendor to lock dependencies and manually audit vendored code
bash
# Disable cgo to prevent exploitation
export CGO_ENABLED=0

# Verify Go version includes security patches
go version

# Build with cgo disabled
CGO_ENABLED=0 go build ./...

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGolang

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • NVD-CWE-noinfo
  • Technical References
  • Golang Announcement Post

  • Fedora Package Announcement

  • Fedora Package Update Notice

  • Fedora Package Update Alert

  • Gentoo GLSA Announcement

  • NetApp Security Advisory ntap-20231020-0001
  • Vendor Resources
  • Go Dev Issue Report

  • Go Dev Issue Announcement

  • Go Vulnerability Report GO-2023-2095
  • Related CVEs
  • CVE-2023-29404: 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