CVE-2026-33748

BuildKit Git URL subdir component can cause access to restricted files

Published Mar 27, 2026 CVSS 4.0 · 8.2 High EPSS < 1% KEV · Not listed
Description
BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. Prior to version 0.28.1, insufficient validation of Git URL fragment subdir components may allow access to files outside the checked-out Git repository root. Possible access is limited to files on the same mounted filesystem. The issue has been fixed in version v0.28.1 The issue affects only builds that use Git URLs with a subpath component. As a workaround, avoid building Dockerfiles from untrusted sources or using the subdir component from an untrusted Git repository where the subdir component could point to a symlink.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade BuildKit to version 0.28.1 or later
  • Avoid including subpath components in Git URLs used in Dockerfiles
  • Ensure Dockerfiles are sourced from trusted origins
  • Remove or disable use of subdir components where the Git repository is not fully trusted
  • Verify that any symlinks referenced by the subdir component do not point outside the intended directory

Generated by OpenCVE AI on March 27, 2026 at 15:56 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DSA Debian DSA DSA-6443-1 docker.io security update
Github GHSA Github GHSA GHSA-4vrq-3vrq-g6gg BuildKit Git URL subdir component can cause access to restricted files
Ubuntu USN Ubuntu USN USN-8230-1 Docker vulnerabilities
History
Type Values Removed Values Added
First Time appeared Mobyproject
Mobyproject buildkit
CPEs cpe:2.3:a:mobyproject:buildkit:*:*:*:*:*:*:*:*
Vendors & Products Mobyproject
Mobyproject buildkit
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Moby
Moby buildkit
Vendors & Products Moby
Moby buildkit
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. Prior to version 0.28.1, insufficient validation of Git URL fragment subdir components may allow access to files outside the checked-out Git repository root. Possible access is limited to files on the same mounted filesystem. The issue has been fixed in version v0.28.1 The issue affects only builds that use Git URLs with a subpath component. As a workaround, avoid building Dockerfiles from untrusted sources or using the subdir component from an untrusted Git repository where the subdir component could point to a symlink.
Title BuildKit Git URL subdir component can cause access to restricted files
Weaknesses CWE-22
CWE-59
References
Metrics cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 27, 2026, 7:58 PM
Reserved
Mar 23, 2026, 6:30 PM
Status
Analyzed
Published
Mar 27, 2026, 3:16 PM
Modified
Oct 26, 2026, 9:10 PM
Severity
Moderate
Public date
Mar 27, 2026, 2:00 PM