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-2022-30580

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

CVE-2022-30580 is a code injection vulnerability in Golang Go's os/exec package that enables remote code execution by exploiting unset Cmd.Path values. This article covers technical details, affected versions, and mitigation.

Published: February 17, 2026

CVE-2022-30580 Overview

CVE-2022-30580 is a code injection vulnerability affecting the Go programming language's os/exec package. The vulnerability exists in Cmd.Start and allows execution of arbitrary binaries located in the working directory when those binaries are named either ..com or ..exe. This occurs when Cmd.Path is unset and methods such as Cmd.Run, Cmd.Start, Cmd.Output, or Cmd.CombinedOutput are called.

Critical Impact

Attackers who can place maliciously named executables (..com or ..exe) in a Go application's working directory can achieve code execution when the application uses os/exec without properly setting Cmd.Path.

Affected Products

  • Golang Go versions prior to 1.17.11
  • Golang Go versions 1.18.x prior to 1.18.3

Discovery Timeline

  • 2022-08-10 - CVE-2022-30580 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-30580

Vulnerability Analysis

This code injection vulnerability (CWE-94) stems from improper handling of command execution when Cmd.Path is left unset in the os/exec package. The attack requires local access and low privileges to exploit but can result in complete compromise of confidentiality, integrity, and availability on the affected system.

When a Go application uses the os/exec package to execute commands without explicitly setting the Cmd.Path field, the runtime can inadvertently resolve to maliciously named files in the current working directory. Specifically, files named ..com or ..exe become valid execution targets, allowing an attacker to inject and run arbitrary code within the context of the vulnerable application.

Root Cause

The root cause lies in the command path resolution logic within Go's os/exec package. When Cmd.Path is not explicitly set by the developer, the package's internal resolution mechanism can incorrectly match specially crafted filenames (..com or ..exe) in the working directory. This behavior stems from insufficient validation of the resolved path before execution, allowing directory-relative filenames with unusual naming patterns to be executed as commands.

Attack Vector

The attack vector is local, requiring the attacker to have the ability to write files to the working directory of a vulnerable Go application. The exploitation scenario involves:

  1. An attacker places a malicious executable named ..com or ..exe in the target application's working directory
  2. The victim application calls Cmd.Run, Cmd.Start, Cmd.Output, or Cmd.CombinedOutput without properly setting Cmd.Path
  3. The Go runtime resolves the command to the attacker's malicious binary
  4. The malicious code executes with the privileges of the vulnerable application

For detailed technical information about the vulnerability mechanism, refer to the Go Issue Tracker Entry and the Golang Announcement Discussion.

Detection Methods for CVE-2022-30580

Indicators of Compromise

  • Presence of files named ..com or ..exe in application working directories
  • Unexpected process execution originating from Go applications using os/exec
  • Anomalous file creation events in directories where Go applications operate
  • Process trees showing unusual child processes spawned from Go binaries

Detection Strategies

  • Monitor file system events for creation of files with suspicious names (..com, ..exe) in directories containing Go applications
  • Implement application-level logging to track all os/exec invocations and their resolved paths
  • Use static code analysis tools to identify Go code using os/exec without explicitly setting Cmd.Path
  • Deploy endpoint detection solutions to monitor for abnormal process execution patterns

Monitoring Recommendations

  • Enable file integrity monitoring on directories where Go applications execute
  • Configure SIEM alerts for process execution events involving ..com or ..exe filenames
  • Implement runtime application self-protection (RASP) to detect unexpected command execution
  • Audit Go application dependencies and source code for vulnerable patterns

How to Mitigate CVE-2022-30580

Immediate Actions Required

  • Upgrade Go to version 1.17.11 or later (for 1.17.x branch)
  • Upgrade Go to version 1.18.3 or later (for 1.18.x branch)
  • Audit existing Go applications for usage of os/exec without explicit Cmd.Path assignment
  • Restrict write permissions to working directories of Go applications

Patch Information

The Go team has released patches addressing this vulnerability. The fix ensures proper validation of command paths before execution, preventing the resolution of maliciously named files in the working directory.

  • Go Dev Change Log - Contains the changeset addressing the vulnerability
  • Go Source Code Commit - The specific commit fixing the issue
  • Go Vulnerability Report - Official vulnerability documentation

Workarounds

  • Always explicitly set Cmd.Path when using the os/exec package
  • Restrict file system permissions to prevent unauthorized file creation in application working directories
  • Use absolute paths for command execution rather than relying on path resolution
  • Implement input validation and sanitization for any user-controlled paths used in command execution
bash
# Check installed Go version
go version

# Upgrade Go to patched version (example for 1.18.x)
# Download from https://go.dev/dl/ and install Go 1.18.3+

# Verify upgrade
go version
# Expected output: go version go1.18.3 (or higher)

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 Score7.8

  • EPSS Probability0.03%

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

  • Golang Announcement Discussion
  • Vendor Resources
  • Go Dev Change Log

  • Go Source Code Commit

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

  • CVE-2023-29404: Golang Go 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