CVE-2024-23651
High · 7.4CVSS
7.4
EPSS
0.9%
Published
Jan 31, 2024
CISA due date
—
Cloudanix analysis
A build tool flaw could let attackers read files from the computer doing the builds if someone uses specially crafted instructions.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- High
- Impact
- Full Compromise
- Component
- Container Runtime
- Class
- Race Condition
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Race condition in BuildKit allows two parallel malicious build steps sharing cache mounts with subpaths to expose host system files to the build container.
Why it matters to the business
Unpatched build systems risk unauthorized access to host files during container builds, potentially exposing source code or secrets in CI/CD pipelines; with the issue public for over two years and a modest EPSS rise, delayed upgrades increase ongoing exposure across dependent projects.
How an attack unfolds
An attacker supplies an untrusted Dockerfile or frontend containing parallel build steps that declare cache mounts with subpaths; the race condition during concurrent execution leaks host filesystem contents into the container context.
How to fix it
Upgrade moby/buildkit to the fixed commit bac3f2b673f3f9d33e79046008e7a38e856b3dc6 (v0.12.5 or later); avoid untrusted frontends and cache mounts in untrusted Dockerfiles until upgraded.
How to confirm the fix worked
Verify BuildKit version is at or above the fixed commit; scan Dockerfiles and build configurations for cache mount usage and confirm no untrusted sources are permitted.
Typical attack path
- Supply malicious Dockerfile or frontend using --mount=type=cache,source=... options in parallel steps
- Trigger concurrent builds that share the same cache mount paths
- Exploit timing window to read host files into the build container
- Exfiltrate leaked data or use it for further container compromise
How to detect it
Review build logs and Dockerfile histories for parallel cache mount declarations from untrusted sources; examine container runtime traces for unexpected host file accesses during builds.
What your security team should do
- Immediately upgrade all BuildKit instances to the fixed commit bac3f2b673f3f9d33e79046008e7a38e856b3dc6
- Audit build pipelines to restrict cache mounts and untrusted frontends
- Monitor EPSS trend and re-evaluate if new exploit code appears
The record
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 packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Go | github.com/moby/buildkit | 0 | 0.12.5 |
| Chainguard | buildctl | 0 | 0.12.5-r0 |
| Chainguard | buildkitd | 0 | 0.12.5-r0 |
| Chainguard | conftest | 0 | 0.49.0-r1 |
| Chainguard | conftest-fips | 0 | 0.48.0-r2 |
| Chainguard | datadog-agent | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-core-integrations | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-core-integrations-fips | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-fakeintake | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-fakeintake-fips | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-fips | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-jmx | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-jmx-fips | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-oci-compat | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-oci-compat-fips | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-s6-overlay | 0 | 7.50.3-r1 |
| Chainguard | datadog-agent-s6-overlay-fips | 0 | 7.50.3-r1 |
| Chainguard | datadog-cluster-agent | 0 | 7.50.3-r1 |
| Chainguard | datadog-cluster-agent-fips | 0 | 7.50.3-r1 |
| Chainguard | datadog-cluster-agent-oci-compat | 0 | 7.50.3-r1 |
| Chainguard | datadog-cluster-agent-oci-compat-fips | 0 | 7.50.3-r1 |
| Chainguard | docker | 0 | 25.0.2-r0 |
| Chainguard | docker-config-mirror-gcr | 0 | 25.0.2-r0 |
| Chainguard | docker-dind | 0 | 25.0.2-r0 |
| Chainguard | docker-dind-compat | 0 | 25.0.2-r0 |
| Chainguard | docker-init | 0 | 25.0.2-r0 |
| Chainguard | docker-modprobe-compat | 0 | 25.0.2-r0 |
| Chainguard | docker-oci-entrypoint | 0 | 25.0.2-r0 |
| Chainguard | docker-rootless | 0 | 25.0.2-r0 |
| Chainguard | dockerd | 0 | 25.0.2-r0 |
| Chainguard | dockerd-oci-entrypoint | 0 | 25.0.2-r0 |
| Chainguard | dockerd-service | 0 | 25.0.2-r0 |
| Chainguard | dogstatsd | 0 | 7.50.3-r1 |
| Chainguard | guac | 0 | 0.4.0-r1 |
| Chainguard | guaccsub | 0 | 0.4.0-r1 |
| Chainguard | guacgql | 0 | 0.4.0-r1 |
| Chainguard | guacingest | 0 | 0.4.0-r1 |
| Chainguard | guacone | 0 | 0.4.0-r1 |
| Chainguard | kaniko | 0 | 1.20.1-r0 |
| Chainguard | kaniko-compat | 0 | 1.20.1-r0 |
| Chainguard | kaniko-warmer | 0 | 1.20.1-r0 |
| Chainguard | kaniko-warmer-compat | 0 | 1.20.1-r0 |
| Chainguard | kubescape | 0 | 3.0.3-r7 |
| Chainguard | scorecard | 0 | 4.13.1-r4 |
| Chainguard | skaffold | 0 | 2.11.0-r0 |
| Chainguard | trivy | 0 | 0.49.0-r1 |
| Chainguard | zot | 0 | 2.0.1-r2 |
| SUSE:Enterprise Storage 7.1 | buildah | 0 | 1.35.4-150300.8.25.1 |
| SUSE:Enterprise Storage 7.1 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Enterprise Storage 7.1 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Enterprise Storage 7.1 | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | buildah | 0 | 1.35.4-150300.8.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise Micro 5.1 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Micro 5.1 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Micro 5.2 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Micro 5.2 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Micro 5.3 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Micro 5.3 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Micro 5.4 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Micro 5.4 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Micro 5.5 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Micro 5.5 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Module for Containers 12 | docker | 0 | 24.0.7_ce-98.106.1 |
| SUSE:Linux Enterprise Module for Containers 12 | docker | 0 | 25.0.5_ce-98.112.1 |
| SUSE:Linux Enterprise Module for Containers 15 SP4 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Module for Containers 15 SP5 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Module for Containers 15 SP5 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Module for Containers 15 SP6 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Module for Containers 15 SP6 | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise Module for Containers 15 SP7 | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise Server 12 SP5-LTSS | docker-stable | 0 | 24.0.9_ce-1.20.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | buildah | 0 | 1.35.4-150300.8.25.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise Server 15 SP5-LTSS | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | docker-stable | 0 | 24.0.9_ce-1.20.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | buildah | 0 | 1.35.4-150300.8.25.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | docker | 0 | 24.0.7_ce-150000.193.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | docker | 0 | 25.0.6_ce-150000.207.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| Ubuntu:20.04:LTS | docker.io | 0 | No fix |
| Ubuntu:20.04:LTS | docker.io-app | 0 | No fix |
| Ubuntu:22.04:LTS | docker.io | 0 | No fix |
| Ubuntu:22.04:LTS | docker.io-app | 0 | No fix |
| Ubuntu:22.04:LTS | docker.io-app | 0 | 27.5.1-0ubuntu3~22.04.2 |
| Ubuntu:24.04:LTS | docker.io | 0 | No fix |
| Ubuntu:24.04:LTS | docker.io-app | 0 | No fix |
| Ubuntu:24.04:LTS | docker.io-app | 0 | 27.5.1-0ubuntu3~24.04.2 |
| Ubuntu:24.10 | docker.io | 0 | No fix |
| Ubuntu:24.10 | docker.io-app | 0 | No fix |
| Ubuntu:25.04 | docker.io | 0 | No fix |
| Ubuntu:25.04 | docker.io-app | 0 | No fix |
| Ubuntu:25.10 | docker.io | 0 | No fix |
| Ubuntu:25.10 | docker.io-app | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | docker.io | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | docker.io | 0 | 20.10.21-0ubuntu1~18.04.3+esm3 |
| Ubuntu:Pro:20.04:LTS | docker.io | 0 | 20.10.21-0ubuntu1~20.04.6+esm2 |
| Ubuntu:Pro:20.04:LTS | docker.io-app | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | docker.io-app | 0 | 26.1.3-0ubuntu1~20.04.1+esm1 |
| Ubuntu:Pro:22.04:LTS | docker.io | 0 | 20.10.21-0ubuntu1~22.04.7+esm2 |
| Ubuntu:Pro:24.04:LTS | docker.io | 0 | 20.10.25+dfsg1-2ubuntu1+esm2 |
| Wolfi | buildctl | 0 | 0.12.5-r0 |
| Wolfi | buildkitd | 0 | 0.12.5-r0 |
| Wolfi | conftest | 0 | 0.49.0-r1 |
| Wolfi | datadog-agent | 0 | 7.50.3-r1 |
| Wolfi | datadog-agent-core-integrations | 0 | 7.50.3-r1 |
| Wolfi | datadog-agent-fakeintake | 0 | 7.50.3-r1 |
| Wolfi | datadog-agent-jmx | 0 | 7.50.3-r1 |
| Wolfi | datadog-agent-oci-compat | 0 | 7.50.3-r1 |
| Wolfi | datadog-agent-s6-overlay | 0 | 7.50.3-r1 |
| Wolfi | datadog-cluster-agent | 0 | 7.50.3-r1 |
| Wolfi | datadog-cluster-agent-oci-compat | 0 | 7.50.3-r1 |
| Wolfi | docker | 0 | 25.0.2-r0 |
| Wolfi | docker-config-mirror-gcr | 0 | 25.0.2-r0 |
| Wolfi | docker-dind | 0 | 25.0.2-r0 |
| Wolfi | docker-dind-compat | 0 | 25.0.2-r0 |
| Wolfi | docker-init | 0 | 25.0.2-r0 |
| Wolfi | docker-modprobe-compat | 0 | 25.0.2-r0 |
| Wolfi | docker-oci-entrypoint | 0 | 25.0.2-r0 |
| Wolfi | docker-rootless | 0 | 25.0.2-r0 |
| Wolfi | dockerd | 0 | 25.0.2-r0 |
| Wolfi | dockerd-oci-entrypoint | 0 | 25.0.2-r0 |
| Wolfi | dockerd-service | 0 | 25.0.2-r0 |
| Wolfi | dogstatsd | 0 | 7.50.3-r1 |
| Wolfi | guac | 0 | 0.4.0-r1 |
| Wolfi | guaccsub | 0 | 0.4.0-r1 |
| Wolfi | guacgql | 0 | 0.4.0-r1 |
| Wolfi | guacingest | 0 | 0.4.0-r1 |
| Wolfi | guacone | 0 | 0.4.0-r1 |
| Wolfi | kaniko | 0 | 1.20.1-r0 |
| Wolfi | kaniko-compat | 0 | 1.20.1-r0 |
| Wolfi | kaniko-warmer | 0 | 1.20.1-r0 |
| Wolfi | kaniko-warmer-compat | 0 | 1.20.1-r0 |
| Wolfi | kubescape | 0 | 3.0.3-r7 |
| Wolfi | scorecard | 0 | 4.13.1-r4 |
| Wolfi | skaffold | 0 | 2.11.0-r0 |
| Wolfi | trivy | 0 | 0.49.0-r1 |
| Wolfi | zot | 0 | 2.0.1-r2 |
| openSUSE:Leap 15.5 | docker | 0 | 24.0.7_ce-150000.193.1 |
| openSUSE:Leap 15.5 | docker | 0 | 25.0.6_ce-150000.207.1 |
| openSUSE:Leap 15.6 | docker | 0 | 25.0.6_ce-150000.207.1 |
| openSUSE:Leap 15.6 | docker-stable | 0 | 24.0.9_ce-150000.1.25.1 |
| openSUSE:Leap Micro 5.3 | docker | 0 | 24.0.7_ce-150000.193.1 |
| openSUSE:Leap Micro 5.4 | docker | 0 | 24.0.7_ce-150000.193.1 |
| openSUSE:Leap Micro 5.5 | docker | 0 | 25.0.6_ce-150000.207.1 |
| openSUSE:Tumbleweed | buildkit | 0 | 0.12.5-1.1 |
| openSUSE:Tumbleweed | docker | 0 | 24.0.7_ce-3.1 |
| openSUSE:Tumbleweed | docker-stable | 0 | 24.0.9_ce-15.1 |
| openSUSE:Tumbleweed | singularity-ce | 0 | 4.1.3-1.1 |
Related vulnerabilities
- CVE-2024-23652 BuildKit is a toolkit for converting source code to build artifacts in an efficient… Also affects github.com/moby/buildkit
- CVE-2024-23653 BuildKit is a toolkit for converting source code to build artifacts in an efficient… Also affects github.com/moby/buildkit
- CVE-2024-23650 BuildKit is a toolkit for converting source code to build artifacts in an efficient… Also affects github.com/moby/buildkit
- CVE-2026-33186 gRPC-Go is the Go language implementation of gRPC. Also affects buildctl
- CVE-2026-24051 OpenTelemetry-Go is the Go implementation of OpenTelemetry. Also affects buildctl
- CVE-2025-67499 The CNI portmap plugin allows containers to emulate opening a host port, forwarding that… Also affects buildctl
- CVE-2025-61729 Within HostnameError.Error(), when constructing an error string, there is no limit to the… Also affects buildctl
- CVE-2025-64329 containerd CRI server: Host memory exhaustion through Attach goroutine leak Also affects buildctl