CVE-2026-33748: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in moby buildkit
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.
AI Analysis
Technical Summary
The vulnerability identified as CVE-2026-33748 affects moby buildkit, a widely used toolkit for building container images efficiently and reproducibly. Prior to version 0.28.1, buildkit does not properly validate the subdirectory component in Git URL fragments used during builds. This improper validation allows a path traversal attack (CWE-22) where an attacker can specify a subpath that escapes the checked-out Git repository root directory. Although access is limited to files on the same mounted filesystem, this can still expose sensitive files outside the intended build context. The issue also relates to CWE-59, involving symbolic link (symlink) following, which can be exploited if the subdir component points to a symlink. Exploitation requires no authentication or user interaction and can be triggered remotely by specifying crafted Git URLs with subpaths in build instructions. The vulnerability has a CVSS 4.0 score of 8.2 (high severity), reflecting its network attack vector, low complexity, no privileges required, and high impact on confidentiality. The flaw has been patched in buildkit version 0.28.1. Until patched, the vulnerability primarily affects builds that use Git URLs with subdirectory fragments, especially when the source is untrusted. This can lead to unauthorized disclosure of sensitive files on the build host, potentially leaking credentials, configuration files, or other critical data. There are no known exploits in the wild as of now, but the risk remains significant given buildkit's widespread use in containerized development and CI/CD pipelines.
Potential Impact
This vulnerability can lead to unauthorized disclosure of sensitive files on build hosts, compromising confidentiality and potentially integrity if attackers gain access to configuration or secret files. Organizations relying on buildkit for container image builds, especially in automated CI/CD environments, risk exposure of internal files if untrusted Git repositories or subdirectory components are used. This can facilitate further attacks such as credential theft, lateral movement, or supply chain compromise. The impact is heightened in environments where build hosts have access to sensitive data or production credentials. Since exploitation requires no authentication and can be triggered remotely via crafted Git URLs, the attack surface is broad. However, the scope is limited to files on the same mounted filesystem, reducing but not eliminating risk. The vulnerability undermines trust in build artifacts and can disrupt secure software supply chain practices globally.
Mitigation Recommendations
1. Upgrade moby buildkit to version 0.28.1 or later immediately to apply the official patch. 2. Until patched, avoid building Dockerfiles from untrusted Git repositories or those using Git URLs with subdirectory fragments. 3. Implement strict validation and sanitization of Git URL inputs in build pipelines to reject URLs containing subpath components or symlinks. 4. Use container build environments with minimal filesystem access and isolate build hosts to limit exposure of sensitive files. 5. Employ runtime monitoring to detect unusual file access patterns during builds. 6. Review and restrict permissions on build host filesystems to minimize sensitive data accessible to build processes. 7. Incorporate security scanning tools that detect usage of vulnerable buildkit versions and risky Git URL patterns in CI/CD workflows. 8. Educate developers and DevOps teams about risks of using untrusted sources and subdirectory components in builds.
Affected Countries
United States, Germany, China, India, United Kingdom, Canada, France, Japan, South Korea, Australia
CVE-2026-33748: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in moby buildkit
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability identified as CVE-2026-33748 affects moby buildkit, a widely used toolkit for building container images efficiently and reproducibly. Prior to version 0.28.1, buildkit does not properly validate the subdirectory component in Git URL fragments used during builds. This improper validation allows a path traversal attack (CWE-22) where an attacker can specify a subpath that escapes the checked-out Git repository root directory. Although access is limited to files on the same mounted filesystem, this can still expose sensitive files outside the intended build context. The issue also relates to CWE-59, involving symbolic link (symlink) following, which can be exploited if the subdir component points to a symlink. Exploitation requires no authentication or user interaction and can be triggered remotely by specifying crafted Git URLs with subpaths in build instructions. The vulnerability has a CVSS 4.0 score of 8.2 (high severity), reflecting its network attack vector, low complexity, no privileges required, and high impact on confidentiality. The flaw has been patched in buildkit version 0.28.1. Until patched, the vulnerability primarily affects builds that use Git URLs with subdirectory fragments, especially when the source is untrusted. This can lead to unauthorized disclosure of sensitive files on the build host, potentially leaking credentials, configuration files, or other critical data. There are no known exploits in the wild as of now, but the risk remains significant given buildkit's widespread use in containerized development and CI/CD pipelines.
Potential Impact
This vulnerability can lead to unauthorized disclosure of sensitive files on build hosts, compromising confidentiality and potentially integrity if attackers gain access to configuration or secret files. Organizations relying on buildkit for container image builds, especially in automated CI/CD environments, risk exposure of internal files if untrusted Git repositories or subdirectory components are used. This can facilitate further attacks such as credential theft, lateral movement, or supply chain compromise. The impact is heightened in environments where build hosts have access to sensitive data or production credentials. Since exploitation requires no authentication and can be triggered remotely via crafted Git URLs, the attack surface is broad. However, the scope is limited to files on the same mounted filesystem, reducing but not eliminating risk. The vulnerability undermines trust in build artifacts and can disrupt secure software supply chain practices globally.
Mitigation Recommendations
1. Upgrade moby buildkit to version 0.28.1 or later immediately to apply the official patch. 2. Until patched, avoid building Dockerfiles from untrusted Git repositories or those using Git URLs with subdirectory fragments. 3. Implement strict validation and sanitization of Git URL inputs in build pipelines to reject URLs containing subpath components or symlinks. 4. Use container build environments with minimal filesystem access and isolate build hosts to limit exposure of sensitive files. 5. Employ runtime monitoring to detect unusual file access patterns during builds. 6. Review and restrict permissions on build host filesystems to minimize sensitive data accessible to build processes. 7. Incorporate security scanning tools that detect usage of vulnerable buildkit versions and risky Git URL patterns in CI/CD workflows. 8. Educate developers and DevOps teams about risks of using untrusted sources and subdirectory components in builds.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-03-23T18:30:14.124Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69c6949b3c064ed76fb5b742
Added to database: 3/27/2026, 2:30:51 PM
Last enriched: 3/27/2026, 2:48:33 PM
Last updated: 3/28/2026, 12:47:07 AM
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.