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
    • 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-2024-34158

CVE-2024-34158: Go Build Tag Parser DoS Vulnerability

CVE-2024-34158 is a denial of service flaw in Go's build tag parser that causes stack exhaustion when parsing deeply nested expressions. This article covers the technical details, affected versions, and mitigation.

Published: January 28, 2026

CVE-2024-34158 Overview

CVE-2024-34158 is a stack exhaustion vulnerability in the Go programming language's build tag parser. The vulnerability occurs when the Parse function processes a // +build build tag line containing deeply nested expressions, leading to uncontrolled recursion that exhausts the call stack and causes a panic. This denial of service vulnerability can be triggered remotely by providing malicious input to any application that parses untrusted build constraint expressions.

Critical Impact

Applications parsing untrusted Go source files or build constraints are vulnerable to denial of service attacks through crafted build tag expressions that cause stack exhaustion and application crashes.

Affected Products

  • Go programming language (go/build/constraint package)
  • Applications using go/build/constraint.Parse with untrusted input
  • Build systems and tools processing Go source files

Discovery Timeline

  • 2024-09-06 - CVE-2024-34158 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2024-34158

Vulnerability Analysis

This vulnerability is classified under CWE-674 (Uncontrolled Recursion), which represents a category of flaws where recursive function calls are not properly bounded, leading to resource exhaustion. The vulnerable code path exists in the go/build/constraint package, specifically in how the Parse function handles legacy // +build directive syntax.

When processing build tag lines, the parser recursively evaluates nested expressions. An attacker can craft input with deeply nested logical expressions (using combinations of AND, OR, and NOT operators) that cause the parser to recurse to an excessive depth. Since Go does not implement tail-call optimization and has a fixed stack size, this uncontrolled recursion eventually exhausts available stack space, triggering a runtime panic.

The vulnerability is network-exploitable because many Go-based tools and services parse source files or build constraints from untrusted sources, including package registries, code repositories, and continuous integration systems.

Root Cause

The root cause is insufficient depth limiting in the recursive descent parser for build constraint expressions. The legacy // +build syntax allows arbitrary nesting of boolean expressions, and the parser follows this nesting without tracking or limiting recursion depth. This design flaw allows malicious input to control stack consumption, violating the principle of bounded resource usage.

Attack Vector

The attack can be executed remotely over a network by providing a specially crafted Go source file or build constraint string to any service that uses go/build/constraint.Parse. The attacker constructs a build tag line with deeply nested expressions, such as repeated parenthetical groupings or chained operators. When the target application attempts to parse this input, the recursive parser descends through each nesting level, consuming stack frames until the stack is exhausted and the application crashes.

Potential attack scenarios include:

  • Submitting malicious Go packages to module proxies or registries
  • Providing crafted source files to code analysis tools
  • Targeting build systems that process untrusted repositories

Detection Methods for CVE-2024-34158

Indicators of Compromise

  • Unexpected application crashes with stack overflow panic messages
  • Go runtime errors indicating stack exhaustion during source file parsing
  • Log entries showing panics in go/build/constraint package functions
  • Service availability issues correlated with processing of specific Go source files

Detection Strategies

  • Monitor for Go panic stack traces containing go/build/constraint.Parse or related functions
  • Implement resource monitoring for applications that parse Go source files from untrusted sources
  • Deploy application-level logging to capture input that triggers parsing failures
  • Use static analysis to identify code paths where untrusted input reaches Parse functions

Monitoring Recommendations

  • Set up alerts for abnormal process termination patterns in Go applications
  • Monitor memory and CPU usage spikes that may precede stack exhaustion
  • Implement request logging with payload capture for debugging crash incidents
  • Track service restarts and correlate with recent input patterns

How to Mitigate CVE-2024-34158

Immediate Actions Required

  • Update to patched Go versions that include the fix from Go changeset CL 611240
  • Identify all applications and services that parse Go source files or build constraints
  • Implement input validation to reject excessively complex build tag expressions before parsing
  • Consider sandboxing or resource limits for processes handling untrusted Go source input

Patch Information

The Go team has addressed this vulnerability in the official fix referenced in Go changeset CL 611240. The patch introduces proper depth limiting in the build constraint parser to prevent unbounded recursion. Full details are available in the Go vulnerability report GO-2024-3107 and the issue tracker entry. NetApp users should also review the NetApp Security Advisory for product-specific guidance.

Workarounds

  • Implement pre-validation of build tag complexity before calling Parse functions
  • Set resource limits (stack size, execution time) on processes parsing untrusted input
  • Use process isolation or containers to limit the impact of crashes
  • Filter or sanitize Go source files before processing to remove or simplify build constraints
bash
# Example: Setting stack size limits for Go applications (Linux)
ulimit -s 8192
# Run application with reduced stack to fail faster on deep recursion
./your-go-application

# Alternative: Use a wrapper to limit resources
systemd-run --scope -p MemoryMax=512M -p CPUQuota=50% ./your-go-application

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechN/A

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.16%

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

  • Go.dev Issue Tracker

  • Google Groups Discussion

  • Go.dev Vulnerability Report

  • NetApp Security Advisory
  • Latest CVEs
  • CVE-2025-9185: Mozilla Firefox RCE Vulnerability

  • CVE-2025-9184: Mozilla Firefox RCE Vulnerability

  • CVE-2025-9180: Mozilla Firefox Auth Bypass Vulnerability

  • CVE-2025-8030: Mozilla Firefox RCE 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