CVE-2026-15788 in BuildKit
Summary
by MITRE • 07/20/2026
BuildKit's cache mount source= selector on Windows Container on Windows (WCOW) workers does not detect NTFS directory junctions placed inside the cache root. A build authored by an untrusted user on a WCOW-configured BuildKit daemon can read arbitrary host files reachable to the BuildKit daemon process.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 07/20/2026
The vulnerability described involves a critical security flaw in BuildKit's cache mount implementation specifically affecting Windows Container on Windows (WCOW) workers. This issue stems from an inadequate detection mechanism that fails to recognize NTFS directory junctions within the cache root directory structure. Directory junctions represent symbolic links that point to directories located elsewhere in the filesystem, creating a transparent redirection mechanism that Windows filesystem treats as native paths. The flaw occurs because BuildKit's cache mount source= selector operates under the assumption that all files and directories within the cache root are accessible through standard path resolution mechanisms, without properly accounting for junction points that can redirect access to arbitrary locations on the host system.
The technical implementation of this vulnerability exploits a fundamental gap in how BuildKit handles filesystem traversal during containerized build operations. When a build process is executed on a WCOW worker configuration, the daemon establishes cache mounts to facilitate efficient build operations by reusing previously compiled artifacts. However, during this process, the selector mechanism responsible for identifying valid cache sources fails to properly enumerate or validate junction points that may exist within the cache directory hierarchy. This oversight allows an untrusted user who can submit a malicious build configuration to manipulate the cache mount behavior and gain access to files outside of the intended build context.
The operational impact of this vulnerability is severe and directly affects containerized environments where untrusted users might have the ability to submit build requests to a WCOW-enabled BuildKit daemon. An attacker with control over the build process can craft a malicious build definition that includes directory junctions pointing to sensitive host files such as credential stores, configuration files, or system binaries. Once executed, the BuildKit daemon would traverse these junction points and inadvertently expose content from locations that should remain protected within the containerized environment. This type of vulnerability falls under CWE-22 known as "Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')", specifically manifesting as a path traversal attack in a containerized context where the security boundary is compromised through improper cache mount handling.
The security implications extend beyond simple file access and represent a potential privilege escalation vector within containerized environments. Since BuildKit daemon processes typically run with elevated privileges to perform build operations, an attacker could leverage this vulnerability to access files that are normally restricted to system administrators or service accounts. The attack pattern aligns with techniques documented in the MITRE ATT&CK framework under T1059 for Command and Scripting Interpreter and T1078 for Valid Accounts, as the exploitation involves legitimate build process execution combined with path traversal mechanisms. This vulnerability particularly affects environments where BuildKit is deployed in multi-tenant scenarios or where developers have the ability to submit untrusted build definitions to shared daemon instances.
Mitigation strategies should focus on implementing robust validation of cache mount sources and ensuring that all directory junctions are properly detected and either blocked or appropriately validated before allowing access. Organizations should consider updating their BuildKit deployments to versions that include proper junction point detection mechanisms or implement additional security controls such as restrictive filesystem permissions, container runtime policies, and network segmentation. The recommended approach involves configuring the BuildKit daemon with strict cache mount validation that prevents access to host directories through symbolic links or junction points, while also implementing monitoring solutions that can detect anomalous file access patterns during build operations. Additionally, organizations should consider adopting container security platforms that provide real-time monitoring of build processes and can alert on suspicious filesystem access behaviors that may indicate exploitation attempts targeting this specific vulnerability.