Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2025-22867

CVE-2025-22867: Go CGO Build RCE Vulnerability on Darwin

CVE-2025-22867 is a remote code execution flaw in Go 1.24rc2 affecting CGO builds on Darwin systems when using Apple's linker with special path directives. This article covers the technical details, affected versions, and mitigation.

Published: April 29, 2026

CVE-2025-22867 Overview

On Darwin (macOS), building a Go module which contains CGO can trigger arbitrary code execution when using the Apple version of ld, due to usage of the @executable_path, @loader_path, or @rpath special values in a #cgo LDFLAGS directive. This vulnerability allows attackers to inject malicious code during the Go build process by exploiting how Apple's linker handles special path directives.

Critical Impact

Arbitrary code execution during Go module builds on macOS systems using CGO with Apple's linker, potentially compromising developer environments and CI/CD pipelines.

Affected Products

  • Go version go1.24rc2 (release candidate)
  • Darwin/macOS systems using Apple's ld linker
  • Go modules utilizing CGO with #cgo LDFLAGS directives

Discovery Timeline

  • 2025-02-06 - CVE CVE-2025-22867 published to NVD
  • 2026-04-15 - Last updated in NVD database

Technical Details for CVE-2025-22867

Vulnerability Analysis

This vulnerability exists in the Go toolchain's handling of CGO linker flags on Darwin systems. When building Go modules that utilize CGO, developers can specify linker flags using the #cgo LDFLAGS directive. Apple's version of ld supports special path values including @executable_path, @loader_path, and @rpath which are used to specify dynamic library search paths relative to various reference points.

The vulnerability arises because the Go build system did not properly sanitize or restrict the use of these special path values in CGO directives. An attacker could craft a malicious Go module that abuses these special values to load arbitrary code during the build process, effectively achieving code execution in the context of the developer or build system processing the module.

This type of supply chain vulnerability is particularly concerning because developers often build third-party modules as part of their development workflow, potentially without full code review of all imported dependencies.

Root Cause

The root cause stems from insufficient input validation in the Go CGO build process when processing #cgo LDFLAGS directives on Darwin systems. The special Apple linker path values (@executable_path, @loader_path, @rpath) were not filtered or restricted, allowing malicious modules to manipulate the library loading behavior of the resulting binary or the build process itself.

Attack Vector

An attacker could exploit this vulnerability through a supply chain attack vector. The attack requires the victim to build a malicious Go module containing CGO code with crafted #cgo LDFLAGS directives. This could occur through:

The attack leverages Apple's ld linker's special path resolution mechanism. By specifying paths using @executable_path, @loader_path, or @rpath, an attacker can redirect library loading to attacker-controlled locations, achieving arbitrary code execution during the build process or when the built binary is executed.

Detection Methods for CVE-2025-22867

Indicators of Compromise

  • Presence of @executable_path, @loader_path, or @rpath strings in #cgo LDFLAGS directives within Go source files
  • Unexpected library loading behavior during Go module builds on macOS
  • Build logs showing unusual linker flag usage with Apple-specific path specifiers
  • Third-party Go dependencies containing suspicious CGO LDFLAGS configurations

Detection Strategies

  • Implement static analysis of Go modules to scan for dangerous #cgo LDFLAGS patterns before building
  • Monitor build process system calls for unexpected library loads or file accesses
  • Deploy dependency scanning tools to identify Go modules containing CGO with suspicious linker flags
  • Review build logs for linker invocations containing @executable_path, @loader_path, or @rpath

Monitoring Recommendations

  • Enable verbose build logging for Go projects that utilize CGO on Darwin systems
  • Implement file integrity monitoring on development and CI/CD systems
  • Monitor for unexpected network connections or file accesses during Go build processes
  • Establish baseline behavior for Go builds and alert on deviations

How to Mitigate CVE-2025-22867

Immediate Actions Required

  • Upgrade from go1.24rc2 to a patched version of Go immediately
  • Audit any Go modules built with go1.24rc2 on Darwin systems for potential compromise
  • Review third-party dependencies for suspicious #cgo LDFLAGS directives
  • Consider rebuilding affected binaries with a patched Go version

Patch Information

The Go team has addressed this vulnerability in subsequent releases. The fix is documented in Go.dev Code Change Log CL/646996. For complete vulnerability details, refer to the Go.dev Vulnerability Report GO-2025-3428. Additional discussion can be found in the Go.dev Issue Tracker Entry and the Golang Dev Discussion Post.

Workarounds

  • Avoid using go1.24rc2 for building Go modules with CGO on Darwin systems
  • Implement strict code review policies for all Go dependencies, especially those using CGO
  • Build Go modules in isolated environments with restricted file system access
  • Consider using non-Apple linkers or building on non-Darwin systems when possible
bash
# Check your Go version and upgrade if using go1.24rc2
go version

# Verify no suspicious LDFLAGS in your project
grep -r "@executable_path\|@loader_path\|@rpath" --include="*.go" .

# Use go mod vendor to audit third-party CGO dependencies
go mod vendor
grep -r "@executable_path\|@loader_path\|@rpath" vendor/

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGo

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.41%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • Technical References
  • Go.dev Code Change Log

  • Go.dev Issue Tracker Entry

  • Golang Dev Discussion Post

  • Go.dev Vulnerability Report GO-2025-3428
  • Related CVEs
  • CVE-2025-4674: Go Command RCE Vulnerability in VCS

  • CVE-2023-24531: Go Environment Command RCE Vulnerability

  • CVE-2026-33252: Go MCP SDK CSRF Vulnerability

  • CVE-2026-27896: Go MCP SDK Auth Bypass Vulnerability
Default Legacy - Prefooter | 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