---
title: "CVE-2024-23651: BuildKit possible race condition with accessing subpaths from cache mounts"
url: https://erroneo.us/security/cve/CVE-2024-23651/
description: "CVE-2024-23651 (moby buildkit): BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. Two…"
type: vulnerability-record
section: "Security Digest"
date_published: 2024-01-31
date_modified: 2026-10-21
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2024-23651"
kev: false
cvss: 8.7
epss: 0.00911
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2024-23651: BuildKit possible race condition with accessing subpaths from cache mounts

**Signal:** Normal patch cycle. No exploitation signal; fix it in your next routine update if you are affected. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.9% , percentile 60: FIRST’s model estimates a 0.9% chance of exploitation activity in the next 30 days, higher than 60% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Editorial verdict: Patch this week. Leaky Vessels: runc Container Escape (CVE-2024-21626) — A real container escape, but it needs you to run an attacker-controlled image or a crafted exec; patch runc everywhere promptly, urgently where untrusted images or multi-tenant builds run.

## What it is

BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. Two malicious build steps running in parallel sharing the same cache mounts with subpaths could cause a race condition that can lead to files from the host system being accessible to the build container. The issue has been fixed in v0.12.5. Workarounds include, avoiding using BuildKit frontend from an untrusted source or building an untrusted Dockerfile containing cache mounts with --mount=type=cache,source=... options.

## Affected products (CVE record)

- moby buildkit: < 0.12.5

## Severity

- GitHub_M CVSS 3.1: 8.7 `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable no , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.91% probability of exploitation activity in the next 30 days; percentile 60.

## Sources

- [CVE.org record CVE-2024-23651](https://www.cve.org/CVERecord?id=CVE-2024-23651)
- [NVD entry CVE-2024-23651](https://nvd.nist.gov/vuln/detail/CVE-2024-23651)
- [github.com](https://github.com/moby/buildkit/security/advisories/GHSA-m3r6-h7wv-7xxv)
- [github.com](https://github.com/moby/buildkit/pull/4604)
- [github.com](https://github.com/moby/buildkit/releases/tag/v0.12.5)

---
Source page: https://erroneo.us/security/cve/CVE-2024-23651/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
