Moby BuildKit interactive container API permits unauthorized privileged containers

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2024-23653?

CVE-2024-23653 is a vulnerability classified as Incorrect Authorization, affecting buildkit (affected versions: < 0.12.5). This vulnerability is rated Critical, with a CVSS score of 9.8. Current sources do not report this vulnerability as exploited.

Overview

Original source data

BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. In addition to running containers as build steps, BuildKit also provides APIs for running interactive containers based on built images. It was possible to use these APIs to ask BuildKit to run a container with elevated privileges. Normally, running such containers is only allowed if special security.insecure entitlement is enabled both by buildkitd configuration and allowed by the user initializing the build request. The issue has been fixed in v0.12.5. Avoid using BuildKit frontends from untrusted sources.

Affected products and scope

  • moby/buildkit: versions <= v0.12.4 are affected; the vendor identifies v0.12.5 as patched.
  • The Docker advisory also identifies Moby Docker Engine packages containing the affected BuildKit in branches <= 25.0.1 and <= 24.0.8, with corresponding patched branches >= 25.0.2 and >= 24.0.9.
  • Docker Desktop <= 4.27.0 is identified as affected because it contains the relevant patched components; 4.27.1 includes the corresponding fixes.
  • An upstream pull request targets a backport for the v0.11 branch, but the inspected material does not confirm a specific released v0.11 version containing the fix. Do not infer that branch's status from v0.12.5.

Technical details

BuildKit supports interactive containers based on built images in addition to ordinary build steps. The intended control is the security.insecure entitlement, which must be enabled in buildkitd configuration and authorized by the build request. In the vulnerable path, the interactive container API did not validate entitlements under the same conditions as ordinary build requests, so an attacker-controlled frontend or LLB generator could request elevated security mode. The published technical details identify Client.NewContainer, Container.Start, and the StartRequest.SecurityMode field as relevant components. A custom frontend can be selected through a Dockerfile # syntax directive or the --frontend option of buildctl build. The advisory establishes creation of an elevated container; the CNA description does not establish a specific container escape sequence to the host, so host compromise should be treated as a possible consequence rather than an automatic result in every deployment.

Exploitability

The supplied assessment characterizes the relevant path as network reachable, low complexity, requiring no prior privileges and no user interaction. The practical trigger is a BuildKit build request that processes an attacker-influenced frontend or affected API operation; deployments that only use trusted frontends have a narrower exposure. The record marks public_exploit as false and does not establish exploitation observed in the wild. Public detection tooling exists for this class of BuildKit issue, but its existence is not evidence of observed exploitation.

Technical impact

The direct technical outcome is that an interactive container can be created with higher privileges than the entitlement policy intended. If that container can reach build-worker capabilities or resources, the worker may be compromised and the build process may be altered. Organisational consequences can include CI/CD disruption, loss of artifact integrity, or exposure of data available to the worker. The advisory does not establish that every deployment leads to host compromise, so impact must be assessed against the daemon's privileges and the worker's isolation design.

Business impact

  • A build worker may run a container with more privilege than intended, weakening the isolation boundary of a CI/CD system.
  • If the worker can access host resources or sensitive build data, possible consequences include worker compromise, altered build processes, or tampered artifacts. These are possible consequences, not evidence of a specific breach.
  • Organizations that use untrusted frontends in automated pipelines face greater exposure because a build request can reach the vulnerable path.
  • Actual impact depends on daemon privileges, worker isolation, whether the build service accepts external input, and the additional controls protecting the environment.

Remediation

  1. Upgrade standalone BuildKit to v0.12.5, the vendor-confirmed patched release. For Moby Docker Engine, use a patched release in the applicable >= 25.0.2 or >= 24.0.9 branch; for Docker Desktop, upgrade to 4.27.1.
  2. If an immediate upgrade is not possible, avoid BuildKit frontends from untrusted sources. Review frontends specified through the Dockerfile # syntax directive and the --frontend option of buildctl build.
  3. If a downstream vendor or distributor supplies a backport, verify the exact release that contains the fix for that branch. Do not treat a fix in the main branch as proof that every parallel branch is fixed.
  4. As a temporary defense-in-depth measure, restrict which clients can submit build requests, allow only approved frontends, and maintain strong isolation for build workers. These controls do not replace upgrading.

Detection

  • Inventory standalone BuildKit binaries and daemons, along with products that package or embed BuildKit. Compare installed versions with the affected and patched boundaries in the vendor advisory.
  • Review Dockerfiles, pipelines, and build configuration for external frontends selected through # syntax, or frontends supplied with the --frontend option of buildctl build. Verify the source of each frontend and allow only controlled sources.
  • Check how BuildKit APIs and build services are exposed, including which clients can submit build requests and whether they can introduce arbitrary frontend content into the pipeline.
  • Review buildkitd audit logs or available telemetry for interactive containers requested with elevated security mode, especially when the build request did not authorize the security.insecure entitlement. Absence of such log evidence does not prove safety.
  • Static analysis of Dockerfiles and frontend images, or runtime monitoring appropriate to the build worker, can provide additional coverage. These methods are supporting checks and may miss activity or generate false positives, so they do not replace inventory and patching.
Sources (24)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.