CVE-2026-75593 Overview
CVE-2026-75593 is a path traversal vulnerability [CWE-22] affecting BuildKit, the toolkit used by Docker and other tools to convert source code into build artifacts. The flaw exists in BuildKit versions prior to 0.31.2. A custom client with valid access to the BuildKit control API can craft an upload request that writes files outside the BuildKit-controlled state directory. Exploitation requires authenticated access to the control API, which limits the attacker population but enables integrity and availability impact on the host filesystem. The maintainers addressed the issue in BuildKit 0.31.2.
Critical Impact
An authenticated client can escape the BuildKit state directory during upload and write attacker-controlled files to arbitrary paths reachable by the daemon.
Affected Products
- BuildKit versions prior to 0.31.2
- Container build pipelines relying on the BuildKit daemon (buildkitd)
- Downstream tooling embedding the vulnerable BuildKit control API
Discovery Timeline
- 2026-08-19 - CVE-2026-75593 published to NVD
- 2026-08-19 - Last updated in NVD database
Technical Details for CVE-2026-75593
Vulnerability Analysis
BuildKit exposes a control API that clients use to submit build definitions and upload supporting files into a daemon-managed state directory. The vulnerability originates in how the daemon processes file upload requests from clients. A malicious client can construct an upload payload whose file entries traverse the intended directory boundary. The daemon writes those entries to filesystem locations outside its state directory, breaking the containment expected by operators.
The issue maps to CWE-22, improper limitation of a pathname to a restricted directory. The impact profile focuses on integrity and availability: the attacker cannot directly read files through this bug, but can overwrite or create files reachable by the BuildKit process. Because buildkitd frequently runs with elevated privileges, this can translate into tampering with build artifacts, configuration files, or executables consumed later in the pipeline.
Root Cause
BuildKit's upload handling did not fully normalize and validate destination paths before writing files supplied by the client. Path components such as .. segments or absolute paths were resolved against the state directory in a way that allowed the resulting path to fall outside the intended base. The fix in 0.31.2 enforces stricter path containment for uploaded files.
Attack Vector
Exploitation requires network reach to the BuildKit control API and valid permissions to issue builds. In typical deployments this includes CI workers, developer workstations, or any component authorized to call buildkitd. An attacker who has bypassed authentication, stolen credentials, or compromised an authorized client can submit a crafted upload request. The daemon then materializes attacker-chosen files at attacker-chosen locations, enabling downstream code execution when a poisoned artifact is invoked.
No public proof-of-concept has been published in the enriched data. Refer to the GitHub Security Advisory GHSA-g2h8-426c-7976 for maintainer-provided technical detail.
Detection Methods for CVE-2026-75593
Indicators of Compromise
- Files appearing outside the BuildKit state directory (commonly under /var/lib/buildkit/) with ownership matching the buildkitd process user.
- Unexpected modifications to system binaries, cron files, or shell startup files on hosts running buildkitd.
- BuildKit daemon log entries referencing upload sessions with unusual or absolute destination paths.
Detection Strategies
- Audit buildkitd versions across build infrastructure and flag any host running a version below 0.31.2.
- Compare filesystem baselines on build hosts to identify writes outside expected BuildKit directories following build activity.
- Correlate BuildKit control API access logs with filesystem change events on the same host within short time windows.
Monitoring Recommendations
- Enable verbose logging on buildkitd and forward logs to a centralized store for retention and search.
- Monitor authentication events for the BuildKit control API and alert on new or unusual client identities issuing builds.
- Track process behavior of buildkitd, specifically file writes to paths outside the configured state and cache directories.
How to Mitigate CVE-2026-75593
Immediate Actions Required
- Upgrade all BuildKit installations to version 0.31.2 or later.
- Inventory every host, CI runner, and container image that bundles buildkitd and schedule remediation.
- Rotate any credentials or tokens used to authenticate to the BuildKit control API if compromise is suspected.
Patch Information
The fix is available in BuildKit release v0.31.2. The maintainers describe the flaw and remediation in GHSA-g2h8-426c-7976. Operators using downstream distributions such as Docker Engine or buildx should track vendor releases that pull in the patched BuildKit version.
Workarounds
- Restrict network access to the BuildKit control API so that only trusted CI systems and operators can reach the daemon.
- Enforce strong authentication and authorization on the control API and remove any anonymous or shared credentials.
- Run buildkitd under the least privileges necessary and isolate it from sensitive host paths using namespaces or dedicated build hosts.
# Verify installed BuildKit version and upgrade path
buildkitd --version
# Example: pin BuildKit image to the patched release in CI
docker pull moby/buildkit:v0.31.2
# Restrict daemon socket exposure to trusted callers only
chmod 600 /run/buildkit/buildkitd.sock
chown root:buildkit /run/buildkit/buildkitd.sock
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

