CVE-2026-33748
Received Received - Intake
Directory Traversal in BuildKit Git URL Subdir Component

Publication date: 2026-03-27

Last updated on: 2026-04-20

Assigner: GitHub, Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-27
Last Modified
2026-04-20
Generated
2026-05-07
AI Q&A
2026-03-27
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
mobyproject buildkit to 0.28.1 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
CWE-59 The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-33748 is a high-severity vulnerability in BuildKit, a toolkit used for converting source code into build artifacts. The issue arises from insufficient validation of the Git URL fragment subdir component, which can allow an attacker to access files outside the root directory of the checked-out Git repository during Docker builds.

This vulnerability specifically affects builds that use Git URLs containing a subpath component, where the subdir component could point to a symbolic link. The unauthorized file access is limited to files on the same mounted filesystem as the repository.

The issue has been fixed in BuildKit version v0.28.1. Until then, a recommended workaround is to avoid building Dockerfiles from untrusted sources or using the subdir component from untrusted Git repositories.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The provided information does not specify how this vulnerability impacts compliance with common standards and regulations such as GDPR or HIPAA.


How can this vulnerability impact me? :

This vulnerability can allow an attacker to access files outside the intended Git repository root during a Docker build process. Such unauthorized access could lead to exposure of sensitive files on the same mounted filesystem.

If exploited, this could compromise the confidentiality of data stored on the system where the build is performed, especially if untrusted Git repositories or Dockerfiles are used.

The impact is limited to the filesystem where the repository is mounted, but it still poses a significant security risk by potentially exposing sensitive information.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability affects builds that use Git URLs with a subpath component in Docker BuildKit versions up to v0.28.0. Detection involves identifying Docker builds that use Git URLs containing a subdir fragment, especially those that might reference symbolic links.

You can inspect your Docker build commands or Dockerfiles for usage of Git URLs with subdir components in the format `<url>#<ref>:<subdir>`. Look for any builds that specify a subdirectory in the Git URL.

While no specific detection commands are provided in the resources, a practical approach is to search your build scripts or CI/CD pipelines for Docker build commands that include Git URLs with subdir fragments.

  • Use grep or similar tools to find Docker build commands with Git URLs containing a subdir, for example: `grep -r "git@.*#.*:" ./`
  • Review Dockerfiles or build scripts for lines using `git clone` or `docker build` with Git URLs that include a subdirectory fragment.

What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability immediately, upgrade BuildKit to version v0.28.1 or later, where the issue has been fixed.

If upgrading is not immediately possible, avoid building Dockerfiles from untrusted sources or using Git URLs with subdir components from untrusted repositories, especially where the subdir could point to symbolic links.

These steps reduce the risk of unauthorized file access outside the checked-out Git repository root during Docker builds.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart