CVE-2024-23651
JSON

8.7high

BuildKit possible race condition with accessing subpaths from cache mounts

Severity
8.7high CVSS:3.1 by GitHub_M
Exploit likelihood
0.91% (higher than 61% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-m3r6-h7wv-7xxvGO-2024-2493

Description

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

Product or packageVersionsReported by
moby buildkit< 0.12.5CVE List
github.com/moby/buildkit (Go)before 0.12.5GitHub Advisory Database, Go Vulnerability Database
mobyproject buildkitbefore 0.12.5NVD

All scores

GitHub_M8.7high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N
GitHub8.7high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N
NVD7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Classification

CWE-362

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

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.

Patches

The issue has been fixed in v0.12.5

Workarounds

Avoid using BuildKit frontend from an untrusted source or building an untrusted Dockerfile containing cache mounts with --mount=type=cache,source=... options.

References

https://www.openwall.com/lists/oss-security/2019/05/28/1

Go Vulnerability Database

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.

NVD (es)

BuildKit es un conjunto de herramientas para convertir código fuente para crear artefactos de manera eficiente, expresiva y repetible. Dos pasos de compilación maliciosos que se ejecutan en paralelo y comparten los mismos montajes de caché con subrutas podrían causar una condición de ejecución que puede hacer que los archivos del sistema host sean accesibles al contenedor de compilación. El problema se solucionó en v0.12.5. Los workarounds incluyen evitar el uso de la interfaz de BuildKit desde una fuente que no es de confianza o crear un Dockerfile que no sea de confianza que contenga montajes de caché con las opciones --mount=type=cache,source=....

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2024-23651 changed 2025-05-29CVE Terms of Use
GitHub Advisory DatabaseGHSA-m3r6-h7wv-7xxv changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2024-2493 changed 2026-02-04CC-BY-4.0
NVDCVE-2024-23651 changed 2026-06-17Public domain