Impact
BuildKit uses a Git URL fragment subdir component to checkout a specific subdirectory of a repository. In versions prior to 0.28.1, the tool does not fully validate this subdir, so an attacker who can influence the Git URL may cause BuildKit to read or copy files that lie outside the intended repository root, but within the same mounted filesystem. This flaw can expose sensitive files during a build, leading to disclosure of confidential data or facilitating further attacks.
Affected Systems
The vulnerability affects the BuildKit component of Docker, as bundled with the moby project. Any instance running BuildKit before version 0.28.1 and using Git URLs that specify a subpath is susceptible. BuildKit releases starting with v0.28.1 contain the fix.
Risk and Exploitability
The CVSS base score of 8.2 classifies the issue as high severity. Exploitation requires an attacker to control the Git URL used in the Dockerfile or build context; no network-based attack vector is described. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog, and no EPSS data is available, but the wide use of BuildKit suggests that when the subdir component is abused, the impact could be significant. There is no publicly known exploit, yet the conditions are straightforward enough that a malicious build could potentially read sensitive files.
OpenCVE Enrichment
Github GHSA