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

CVE-2023-24531: Go Environment Command RCE Vulnerability

CVE-2023-24531 is a remote code execution vulnerability in Go's env command caused by improper sanitization of environment values. Attackers can exploit this to execute arbitrary commands when output is used as a shell script.

Published: February 11, 2026

CVE-2023-24531 Overview

CVE-2023-24531 is a command injection vulnerability in the Go programming language's go env command. The command is documented as outputting a shell script containing the Go environment configuration. However, go env fails to properly sanitize values, which means executing its output as a shell script can result in various malicious behaviors, including arbitrary command execution or injection of new environment variables.

Critical Impact

Attackers who can influence environment variables on a target system can leverage this vulnerability to execute arbitrary commands when the output of go env is evaluated as a shell script.

Affected Products

  • Go programming language toolchain
  • Applications and scripts that evaluate go env output as shell commands
  • Systems where Go development tools are installed and environment output is processed

Discovery Timeline

  • 2024-07-02 - CVE CVE-2023-24531 published to NVD
  • 2025-03-28 - Last updated in NVD database

Technical Details for CVE-2023-24531

Vulnerability Analysis

The vulnerability stems from a failure to properly sanitize environment variable values before including them in the shell script output generated by the go env command. When developers or automation scripts execute this output directly in a shell context (such as eval $(go env) or similar patterns), unsanitized values containing shell metacharacters can break out of their intended context and execute arbitrary commands.

This type of vulnerability is particularly dangerous in continuous integration/continuous deployment (CI/CD) pipelines and build systems where Go environment configuration is commonly sourced from go env output. An attacker who can manipulate environment variables—through compromised upstream dependencies, malicious repository configurations, or other means—could inject shell commands that execute during the build process.

The vulnerability allows for network-based exploitation without requiring authentication or user interaction, making it potentially exploitable in automated environments where environment variables may be influenced by external sources.

Root Cause

The root cause is an input validation error in the go env command's output generation logic. The command generates shell-compatible output (environment variable assignments) but fails to escape or sanitize special shell characters within the variable values. This allows shell metacharacters such as backticks, $() command substitution, semicolons, and other shell operators to be interpreted when the output is executed.

Attack Vector

The attack vector involves manipulating environment variables that are subsequently output by go env. When a victim script or automation process evaluates this output as a shell script, the injected commands execute with the privileges of the running process. Attack scenarios include:

  1. CI/CD Pipeline Compromise: Malicious environment variables set through build configurations or compromised dependencies get executed during builds that source go env output
  2. Developer Workstation Attacks: If an attacker can influence environment variables on a developer's machine (through malicious Git configurations, compromised tools, etc.), running common Go development patterns could trigger code execution
  3. Supply Chain Attacks: Compromised development tools or scripts that set environment variables before invoking go env could inject commands

The Go team has addressed this through code changes documented in Go CL 488375 and Go CL 493535, which implement proper sanitization of values in the shell script output.

Detection Methods for CVE-2023-24531

Indicators of Compromise

  • Unusual environment variables containing shell metacharacters (backticks, $(), semicolons, pipes)
  • Unexpected command execution during Go build processes or environment setup
  • Anomalous process spawning from Go toolchain-related parent processes
  • Modified Go environment configuration files with suspicious content

Detection Strategies

  • Monitor for execution of go env output through shell evaluation patterns (eval, source, or backtick execution)
  • Implement file integrity monitoring on Go installation directories and configuration files
  • Analyze CI/CD pipeline logs for unexpected command execution during Go environment setup phases
  • Deploy endpoint detection rules to identify command injection patterns in environment variables

Monitoring Recommendations

  • Enable verbose logging for Go toolchain operations in build environments
  • Implement runtime application self-protection (RASP) monitoring for shell command execution
  • Configure SIEM rules to alert on unusual process trees originating from Go-related processes
  • Establish baseline behavior for Go build processes and alert on deviations

How to Mitigate CVE-2023-24531

Immediate Actions Required

  • Upgrade Go toolchain to a patched version that properly sanitizes go env output
  • Review and audit scripts and automation that evaluate go env output as shell commands
  • Implement environment variable validation before sourcing Go environment configuration
  • Consider alternative approaches such as parsing go env -json output instead of shell evaluation

Patch Information

The Go team has released fixes through multiple code changes. Refer to Go Issue 58508 for the official vulnerability tracking and Go Vulnerability Report GO-2024-2962 for detailed patch information. NetApp has also published a Security Advisory regarding affected products.

Workarounds

  • Avoid evaluating go env output directly as shell commands; instead use go env -json and parse the JSON output programmatically
  • Implement strict input validation on environment variables before any Go toolchain operations
  • Run Go build processes in isolated environments with minimal environment variable exposure
  • Use containerization or sandboxing to limit the impact of potential command execution
bash
# Safer alternative: Use JSON output instead of shell evaluation
# Instead of: eval $(go env)
# Use JSON parsing with jq or similar tools:
go env -json | jq -r 'to_entries | .[] | "export \(.key)=\(.value | @sh)"' | while read line; do
    # Validate each line before execution
    echo "$line"
done

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGo

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.48%

  • 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
  • Technical References
  • Go Dev Issue Report

  • Go Dev Issue Report

  • Go Vulnerability Advisory

  • Golang Dev Discussion

  • Go Vulnerability Report

  • NetApp Security Advisory
  • Related CVEs
  • CVE-2025-4674: Go Command RCE Vulnerability in VCS

  • 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