CVE-2026-33748: Github.com/moby/buildkit BuildKit Git URL Subdir Component Vulnerability

HIGH
Advisory Identifier: GHSA-4vrq-3vrq-g6gg
CVSS 7.5
CWE-59 CWE-22
Published
Advisory Summary

CVE-2026-33748 is a HIGH (CVSS 7.5) buildkit git url subdir component vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Github.com/moby/buildkit libraries in the Go ecosystem. The issue involves buildkit git url subdir component can cause access to restricted files. Remediation is available by upgrading affected packages to version 0.28.1.

CVE-2026-33748 at a Glance

CVE Identifier CVE-2026-33748
GHSA Identifier GHSA-4vrq-3vrq-g6gg
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product Github.com/moby/buildkit
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-33748

To remediate this vulnerability, upgrade all affected Github.com/moby/buildkit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/moby/buildkit fixed: 0.28.1
Upgrade github.com/moby/buildkit to 0.28.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/moby/buildkit

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-33748, inspect your project dependencies for Github.com/moby/buildkit:

inspect dependencies for github.com/moby/buildkit

Analyze the terminal output to locate any version of Github.com/moby/buildkit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.28.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following'), where 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. In Github.com/moby/buildkit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Insufficient validation of Git URL fragment subdir components (`<url>#<ref>:<subdir>`, [docs](https://docs.docker.com/build/concepts/context/#url-fragments)) may allow access to files outside the checked-out Git repository root. Possible access is limited to files on the same mounted filesystem. ### Patches The issue has been fixed in version v0.28.1 ### Workarounds The issue affects only builds that use Git URLs with a subpath component. 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.

CVE-2026-33748 Affected Github.com/moby/buildkit Versions

1 component(s)
Fixed Versions:
0.28.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/moby/buildkit
Go
< 0.28.1
0.28.1

References

Frequently Asked Questions

What is CVE-2026-33748?
CVE-2026-33748 is a security vulnerability in Github.com/moby/buildkit involving BuildKit Git URL subdir component can cause access to restricted files under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which Github.com/moby/buildkit versions are affected?
Affected versions include releases prior to 0.28.1 across affected packages: github.com/moby/buildkit.
What version fixes CVE-2026-33748?
Upgrading to 0.28.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/moby/buildkit affected?
Yes, github.com/moby/buildkit is affected in releases prior to 0.28.1. Upgrade your dependency to 0.28.1 or later.
What is the CVSS score of CVE-2026-33748?
CVE-2026-33748 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-33748?
CVE-2026-33748 is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (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.).
How can I check Go dependencies for CVE-2026-33748?
Run the dependency tree command: 'inspect dependencies for github.com/moby/buildkit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4vrq-3vrq-g6gg",
  "modified" : "2026-04-24T20:58:22Z",
  "published" : "2026-03-26T18:27:49Z",
  "aliases" : [ "CVE-2026-33748" ],
  "summary" : "BuildKit Git URL subdir component can cause access to restricted files",
  "details" : "### Impact\nInsufficient validation of Git URL fragment subdir components (`<url>#<ref>:<subdir>`, [docs](https://docs.docker.com/build/concepts/context/#url-fragments)) may allow access to files outside the checked-out Git repository root. Possible access is limited to files on the same mounted filesystem.\n\n### Patches\nThe issue has been fixed in version v0.28.1\n\n### Workarounds\nThe issue affects only builds that use Git URLs with a subpath component. 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/moby/buildkit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.28.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/moby/buildkit/security/advisories/GHSA-4vrq-3vrq-g6gg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33748"
  }, {
    "type" : "WEB",
    "url" : "https://docs.docker.com/build/concepts/context/#url-fragments"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/moby/buildkit"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moby/buildkit/releases/tag/v0.28.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-59" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-26T18:27:49Z",
    "nvd_published_at" : "2026-03-27T15:16:57Z"
  }
}