Skip to main content
Vulnerability Database/CVE-2026-93318

CVE-2026-93318: BuildKit Image Layer Cache RCE Vulnerability

CVE-2026-93318 is a remote code execution flaw in BuildKit that allows malicious images to inject attacker-controlled code into victim builds through cache poisoning. This article covers technical details, affected versions, impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-93318 Overview

CVE-2026-93318 is a cache poisoning vulnerability in Moby BuildKit, the container build toolkit used by Docker and many CI/CD platforms. A malicious image can advertise DiffIDs borrowed from another image while shipping entirely different layer contents. BuildKit derived cache and snapshot identity from the advertised DiffIDs without verifying they matched the actual layer bytes.

Attackers can abuse this trust gap to seed a shared BuildKit cache with attacker-controlled layer contents. Later builds that reference a legitimate base image receive the poisoned layers, allowing code in the malicious image to execute during a victim build. The flaw is classified under [CWE-354: Improper Validation of Integrity Check Value].

Critical Impact

Attacker-controlled layers can replace trusted base image files such as /bin/sh, enabling theft of build secrets, tampering with output artifacts, and disruption of CI/CD pipelines.

Affected Products

  • Moby BuildKit prior to v0.33.1
  • Container build systems embedding vulnerable BuildKit (including Docker Buildx)
  • CI/CD environments using shared or persistent BuildKit cache with lazy-pulling snapshotters such as stargz

Discovery Timeline

  • 2026-10-05 - CVE-2026-93318 published to NVD
  • 2026-10-06 - Last updated in NVD database
  • BuildKit v0.33.1 - Fixed release published on GitHub

Technical Details for CVE-2026-93318

Vulnerability Analysis

BuildKit uses DiffIDs, which are SHA-256 digests of uncompressed layer tar streams, as identifiers for cache entries and snapshots. In vulnerable releases, BuildKit accepted the DiffIDs declared in an image manifest as authoritative when populating its content-addressable cache. The daemon did not recompute the digest from the actual layer bytes before indexing them.

This integrity check gap breaks the fundamental assumption that cache keys correspond to their advertised content. When a shared BuildKit daemon processes a malicious image first, the attacker's layer contents become bound to DiffIDs belonging to a trusted image. Subsequent builds that resolve those DiffIDs mount attacker-controlled files as their base layer.

The issue affects both regular snapshotters and lazy-pulling snapshotters such as stargz, where layer contents are fetched on demand and cache-identity decisions happen before full layer validation.

Root Cause

The root cause is improper validation of an integrity check value [CWE-354]. BuildKit trusted manifest-declared DiffIDs rather than deriving them from the fetched layer contents. Because DiffIDs double as cache and snapshot identifiers, a mismatch between declared and actual contents poisons every downstream consumer of that cache entry.

Attack Vector

Exploitation requires an attacker to push or supply a crafted image that a BuildKit daemon processes before the victim's build runs. The daemon must use shared or persistent cache, which is standard in CI/CD runners, build farms, and self-hosted registry mirrors. User interaction is required in the sense that a victim build must reference the targeted base image.

Once the poisoned cache entry exists, the next build pulling the matching DiffID receives attacker-controlled files. Replacing a frequently invoked path such as /bin/sh yields code execution inside the build container. The attacker-controlled process can read mounted build secrets, access other build resources, modify output artifacts, or hang the build.

No verified public exploit code is available. Refer to the GitHub Security Advisory GHSA-f2v9-hprr-32q3 for authoritative technical detail.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-93318

Indicators of Compromise

  • Unexpected modifications to common binaries such as /bin/sh, /bin/busybox, or distribution package managers inside built images
  • BuildKit cache entries whose on-disk layer digest does not match the advertised DiffID in the originating manifest
  • Build logs showing unexpected network connections, secret reads, or shell processes during base-image stages
  • Output artifacts containing files or environment references not present in the Dockerfile

Detection Strategies

  • Audit BuildKit daemon versions across build runners and reject any instance below v0.33.1
  • Recompute DiffIDs from stored layer tarballs and compare against cache metadata to find poisoned entries
  • Inspect image provenance using signed attestations (for example Sigstore or in-toto) to detect substituted layers
  • Correlate build-time process telemetry with expected Dockerfile instructions to surface anomalous command execution

Monitoring Recommendations

  • Forward BuildKit daemon logs and runner telemetry to a central analytics platform for base-image anomaly review
  • Alert on BuildKit instances that enable shared or persistent cache without a verified version pin
  • Monitor registries for images that reuse DiffIDs across unrelated repositories, a strong indicator of crafted manifests

How to Mitigate CVE-2026-93318

Immediate Actions Required

  • Upgrade all BuildKit daemons, including those bundled with Docker Buildx and CI runner images, to v0.33.1 or later
  • Purge existing BuildKit cache volumes that may contain poisoned entries before resuming production builds
  • Rotate any secrets, tokens, or signing keys that were mounted into builds on vulnerable daemons

Patch Information

The fix is available in BuildKit Release v0.33.1. The patched daemon validates that fetched layer contents match the DiffIDs used for cache and snapshot identity. Full technical details are published in GitHub Security Advisory GHSA-f2v9-hprr-32q3.

Workarounds

  • Disable shared and persistent BuildKit cache until all daemons are upgraded
  • Restrict which images and registries BuildKit instances may pull from, limiting attacker-supplied manifests
  • Run builds in ephemeral, single-tenant runners so cache poisoning cannot cross tenant boundaries
  • Enforce image signature verification with cosign or equivalent before any image is used as a base in builds
bash
# Verify installed BuildKit version and upgrade if below v0.33.1
buildctl --version

# Example: remove persistent BuildKit cache volume before upgrading
docker buildx prune --all --force

# Example: run buildkitd without persistent cache as a temporary mitigation
buildkitd --oci-worker-snapshotter=overlayfs --root=/tmp/buildkit-ephemeral

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.