Skip to content
Fencer Vulns
high 8.7

CVE-2024-23651 json

BuildKit possible race condition with accessing subpaths from cache mounts

published 2024-01-31 2 y ago modified 2026-09-10 1 mo ago also GHSA-m3r6-h7wv-7xxv , GO-2024-2493 , EUVD-2024-0383

cvss
8.7
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.9%
EPSS 0.9% chance of exploitation in 30 days, percentile 60%
public exploits
0
none known

Summary

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.

Patch / fix

  • go github.com/moby/buildkit 0.12.5
  • mobyproject buildkit 0.12.5
  • docker.io-app Ubuntu 22.04 LTS 27.5.1-0ubuntu3~22.04.2
  • docker.io-app Ubuntu 24.04 LTS 27.5.1-0ubuntu3~24.04.2
  • docker.io Ubuntu Pro 18.04 LTS 20.10.21-0ubuntu1~18.04.3+esm3
  • docker.io Ubuntu Pro 20.04 LTS 20.10.21-0ubuntu1~20.04.6+esm2
  • docker.io Ubuntu Pro 22.04 LTS 20.10.21-0ubuntu1~22.04.7+esm2
  • docker.io Ubuntu Pro 24.04 LTS 20.10.25+dfsg1-2ubuntu1+esm2
  • docker.io-app Ubuntu Pro 20.04 LTS 26.1.3-0ubuntu1~20.04.1+esm1

ubuntu advisories UBUNTU-CVE-2024-23651

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • docker-stable SLES for SAP 15 SP5, SLES for SAP 15 SP4, SLES for SAP 15 SP3 +12 more 24.0.9_ce-150000.1.25.1
  • buildkit Linux Micro 6.0 0.12.5-1.1
  • docker Linux Micro 6.0 25.0.6_ce-1.1
  • docker SLES for SAP 15 SP4, SLES for SAP 15 SP3, SLES for SAP 15 SP2 +18 more 25.0.6_ce-150000.207.1
  • buildah SLES for SAP 15 SP3, SLES 15 SP3-LTSS, SLE High Performance Computing 15 SP3-LTSS +1 more 1.35.4-150300.8.25.1
  • docker SLE Module for Containers 12 25.0.5_ce-98.112.1
  • docker SLE Module for Containers 15 SP5, SLE Module for Containers 15 SP4, SLE Micro 5.5 +18 more 24.0.7_ce-150000.193.1
  • docker SLE Module for Containers 12 24.0.7_ce-98.106.1

suse advisories SUSE-SU-2025:03545-1SUSE-SU-2025:03540-1SUSE-SU-2025:20107-1SUSE-SU-2025:20056-1SUSE-SU-2024:3120-1SUSE-SU-2024:1469-1

  • docker-stable openSUSE Tumbleweed 24.0.9_ce-15.1
  • singularity-ce openSUSE Tumbleweed 4.1.3-1.1
  • buildkit openSUSE Tumbleweed 0.12.5-1.1
  • docker openSUSE Tumbleweed 24.0.7_ce-3.1

opensuse advisories openSUSE-SU-2025:15589-1openSUSE-SU-2024:14059-1openSUSE-SU-2024:13651-1openSUSE-SU-2024:13689-1

  • docker Alpine 3.24, Alpine 3.23, Alpine 3.22 +4 more 25.0.2-r0
  • podman Alpine 3.24, Alpine 3.23, Alpine 3.22 +2 more 4.9.2-r0
  • buildkit Alpine 3.24, Alpine 3.23, Alpine 3.22 +3 more 0.12.5-r0
  • singularity Alpine 3.24, Alpine 3.23, Alpine 3.22 +3 more 4.1.1-r0

alpine advisories ALPINE-CVE-2024-23651

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • moby-engine CBL-Mariner 2.0 20.10.27-4
  • moby-engine Azure Linux 3.0 25.0.3-1

azure linux advisories AZL-34085AZL-35005

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2024-23651 updated cvss 7.5

moby/buildkit: possible race condition with accessing subpaths from cache mounts

  • Red Hat OpenShift Dev Spaces devspaces/traefik-rhel8 Red Hat Quay 3 quay/quay-builder-rhel8
    affected: workaround, no fix available “Do not use BuildKit frontends or Dockerfiles from untrusted sources.”
  • Red Hat OpenShift Developer Tools and Services odo Red Hat OpenShift Serverless openshift-serverless-clients, openshift-serverless-1/client-kn-rhel8 Red Hat OpenShift Service Mesh 2 openshift-service-mesh/istio-cni-rhel8 Red Hat Ansible Automation Platform 1.2 openshift-clients Red Hat Enterprise Linux 8 podman, buildah, podman-tests, buildah-tests, podman-docker, podman-remote, +4 more Red Hat Enterprise Linux 9 podman, buildah, podman-tests, buildah-tests, podman-docker, podman-remote, +3 more
    +1 more products
    Red Hat OpenShift Container Platform 4 openshift-clients, openshift-clients-redistributable
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
total
Assessed
18 mo ago

Exploit prediction

0.91% chance of exploitation in the next 30 days, higher than 60% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 8.7 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N
NVD 3.1 7.4 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
GitHub 3.1 8.7 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N

Affected packages

ecosystem package affected fixed in
go github.com/moby/buildkit
<0.12.5
0.12.5

Affected products

  • moby buildkit

Classification

Weakness
  • CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.