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

- Severity: High 8.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.91%, higher than 61% of CVEs (2026-12-01)
- Published: 2024-01-31T21:49:18.041Z
- Modified: 2026-09-10T03:50:09.440Z
- Also known as: GHSA-m3r6-h7wv-7xxv, GO-2024-2493
- Related: CGA-8ggv-jvp5-fgqx
- Weaknesses: CWE-362
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- moby buildkit: < 0.12.5
- github.com/moby/buildkit (Go): before 0.12.5
- mobyproject buildkit: before 0.12.5

## Every score

- GitHub_M: CVSS:3.1 8.7 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N`
- GitHub: CVSS:3.1 8.7 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N`
- NVD: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`

## 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)

## Sources

- CVE List: [CVE-2024-23651](https://www.cve.org/CVERecord?id=CVE-2024-23651), CVE Terms of Use, modified 2025-05-29
- GitHub Advisory Database: [GHSA-m3r6-h7wv-7xxv](https://github.com/advisories/GHSA-m3r6-h7wv-7xxv), CC-BY-4.0, modified 2026-09-10
- Go Vulnerability Database: [GO-2024-2493](https://pkg.go.dev/vuln/GO-2024-2493), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2024-23651](https://nvd.nist.gov/vuln/detail/CVE-2024-23651), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-23651 · Whole record: https://cve.day/CVE-2024-23651.json · Rebuilt by cve.day 2026-11-25T22:58:36.487Z
