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 package | Versions | Reported by |
|---|---|---|
| moby buildkit | < 0.12.5 | CVE List |
| github.com/moby/buildkit (Go) | before 0.12.5 | GitHub Advisory Database, Go Vulnerability Database |
| mobyproject buildkit | before 0.12.5 | NVD |
All scores
| GitHub_M | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N |
| GitHub | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N |
| NVD | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
Classification
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
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
| https://github.com/moby/buildkit/security/advisories/GHSA-m3r6-h7wv-7xxv | vendor-advisory, web | |
| https://github.com/moby/buildkit/pull/4604 | fix, patch, vendor-advisory, web | |
| https://github.com/moby/buildkit/releases/tag/v0.12.5 | patch, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2024-23651 | advisory | |
| https://github.com/moby/buildkit | package | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-23651 changed 2025-05-29 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-m3r6-h7wv-7xxv changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2024-2493 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2024-23651 changed 2026-06-17 | Public domain |