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

CVE-2024-23651: Moby BuildKit Race Condition Vulnerability

CVE-2024-23651 is a race condition vulnerability in Moby BuildKit that enables malicious build steps to access host system files through parallel cache mounts. This article covers technical details, affected versions, and mitigation.

Published: January 28, 2026

CVE-2024-23651 Overview

CVE-2024-23651 is a race condition vulnerability in BuildKit, a toolkit for converting source code to build artifacts. When two malicious build steps run in parallel and share the same cache mounts with subpaths, a race condition can occur that allows files from the host system to become accessible to the build container. This vulnerability represents a significant container escape risk that could lead to unauthorized access to sensitive host system data.

Critical Impact

A successful exploitation of this race condition vulnerability could allow attackers to break container isolation and access files on the host system, potentially exposing sensitive configuration files, credentials, or other confidential data stored outside the container boundary.

Affected Products

  • Mobyproject BuildKit versions prior to v0.12.5
  • Docker builds using vulnerable BuildKit versions with cache mounts
  • CI/CD systems utilizing BuildKit for container image builds

Discovery Timeline

  • 2024-01-31 - CVE-2024-23651 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2024-23651

Vulnerability Analysis

This vulnerability exploits a Time-of-Check Time-of-Use (TOCTOU) race condition in BuildKit's cache mount handling mechanism. BuildKit is designed to efficiently manage build caches through mount directives, allowing multiple build steps to share cached data for performance optimization. However, when multiple build steps execute concurrently and access the same cache mounts with subpaths using the --mount=type=cache,source=... option, improper synchronization creates a window where file access controls can be bypassed.

The vulnerability is particularly concerning because it undermines the fundamental security assumption that containers are isolated from the host file system. An attacker who can control or influence a Dockerfile being built could craft malicious build instructions that exploit this race condition to escape the container sandbox.

Root Cause

The root cause of CVE-2024-23651 lies in insufficient synchronization primitives protecting shared cache mount operations during parallel build step execution. When BuildKit processes concurrent build steps that reference the same cache mount paths, the lack of proper locking or atomic operations creates a race window. During this window, the file system state can become inconsistent, allowing one build step to access files that should be outside its permitted scope.

The CWE-362 (Race Condition) classification accurately describes this flaw, as the vulnerability arises from concurrent execution where the relative timing of events affects the correctness of the program's security boundaries.

Attack Vector

Exploitation requires an attacker to craft a malicious Dockerfile or BuildKit frontend that contains parallel build steps sharing cache mounts with carefully chosen subpaths. The attack vector is network-based since Dockerfiles can be distributed via container registries, Git repositories, or other network-accessible sources. However, the attack complexity is elevated because successful exploitation depends on winning the race condition, which requires precise timing.

The attack scenario involves executing parallel build steps that both utilize cache mounts pointing to overlapping paths. By manipulating the timing of file system operations within these parallel steps, an attacker can cause the build container to gain access to host files that should be protected by container isolation boundaries.

For detailed technical information about the exploitation mechanism, refer to the GitHub Security Advisory GHSA-m3r6-h7wv-7xxv.

Detection Methods for CVE-2024-23651

Indicators of Compromise

  • Unusual file access patterns within build containers accessing paths outside expected cache directories
  • Build logs showing parallel execution of steps with overlapping --mount=type=cache,source=... directives
  • Unexpected reads of sensitive host system files such as /etc/passwd, /etc/shadow, or credential files during container builds
  • Build containers exhibiting access to file system paths that should be outside their mount scope

Detection Strategies

  • Monitor BuildKit build logs for Dockerfiles containing multiple parallel cache mount operations with subpath specifications
  • Implement file integrity monitoring on the host system to detect unauthorized reads during container build operations
  • Deploy runtime container security solutions that can detect anomalous file access patterns indicating container escape attempts
  • Audit Dockerfiles in CI/CD pipelines for suspicious --mount=type=cache,source=... patterns with overlapping paths

Monitoring Recommendations

  • Enable verbose logging for BuildKit operations to capture cache mount activities during builds
  • Implement security scanning in CI/CD pipelines to identify Dockerfiles from untrusted sources containing cache mount directives
  • Monitor for BuildKit processes exhibiting unusual file system access patterns that cross container boundaries
  • Configure alerts for builds executing parallel steps with cache mounts to facilitate manual review

How to Mitigate CVE-2024-23651

Immediate Actions Required

  • Upgrade BuildKit to version v0.12.5 or later immediately to address the race condition vulnerability
  • Audit all Dockerfiles in use to identify those containing --mount=type=cache,source=... directives
  • Avoid building Dockerfiles from untrusted sources until the environment is patched
  • Review and restrict the use of BuildKit frontends from untrusted sources

Patch Information

The BuildKit maintainers have addressed this vulnerability in version v0.12.5. The fix implements proper synchronization for cache mount operations to prevent the race condition. Organizations should update their BuildKit installations as follows:

  • Review the GitHub Pull Request #4604 for details on the fix implementation
  • Download the patched version from the GitHub Release v0.12.5
  • Consult the GitHub Security Advisory GHSA-m3r6-h7wv-7xxv for complete remediation guidance

Workarounds

  • Avoid using BuildKit frontends from untrusted sources until patching is complete
  • Do not build Dockerfiles from untrusted origins that contain cache mount directives with --mount=type=cache,source=... options
  • Implement strict Dockerfile review processes to identify and reject builds containing suspicious cache mount configurations
  • Consider running builds in isolated environments with minimal host file system exposure
bash
# Verify BuildKit version and upgrade if necessary
buildctl --version

# If using Docker with BuildKit, ensure DOCKER_BUILDKIT is using patched version
docker buildx version

# Example: Update BuildKit via Docker Buildx
docker buildx create --use --driver docker-container --driver-opt image=moby/buildkit:v0.12.5

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

  • Vulnerability Details
  • TypeRace Condition

  • Vendor/TechMobyproject

  • SeverityHIGH

  • CVSS Score7.4

  • EPSS Probability0.46%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-362
  • Vendor Resources
  • GitHub Pull Request

  • GitHub Release v0.12.5

  • GitHub Security Advisory GHSA-m3r6-h7wv-7xxv
  • Related CVEs
  • CVE-2026-33747: Mobyproject Buildkit Path Traversal Flaw

  • CVE-2024-23652: Mobyproject BuildKit Path Traversal Flaw
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