CVE-2026-61712: BuildKit: Possible runtime DoS via unbounded group parsing
Impact Maliciously crafted base image or build can cause a Denial of Service (DoS) condition. When creating a container from this image, memory exhaustion occurs, leading to an Out Of Memory (OOM) kill of the buildkitd process.
Patches Issue is fixed in BuildKit v0.31.1+
Workarounds Use trusted build sources.
References This is BuildKit variant of containerd advisory https://github.com/containerd/containerd/security/advisories/GHSA-jpcc-p29g-p8mq
Other sources
BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. Prior to 0.31.1, BuildKit read attacker-controlled /etc/passwd and /etc/group files without an upper bound while resolving a username to a user identifier or group identifier in executor/oci/user.go and solver/llbsolver/ops/userlinux.go. A malicious base image or build could provide oversized files that exhausted memory during user resolution and caused out-of-memory termination of the buildkitd process. This issue is fixed in version 0.31.1.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
go/github.com/moby/buildkitto a version that resolves this vulnerability.Fixed in 0.31.1 - Upgrade
Upgrade
BuildKitto a version that resolves this vulnerability.Fixed in 0.31.1 - Compensating control
Use trusted build sources to prevent a malicious base image or build from exhausting memory and causing an OOM kill of the buildkitd process.
Event History
Frequently Asked Questions
Who can trigger this denial of service?
An attacker who can cause BuildKit to process a malicious base image or build can provide oversized /etc/passwd or /etc/group files. The issue is triggered when BuildKit resolves a username to a user or group identifier.
What is the impact on the BuildKit service?
Unbounded parsing of the attacker-controlled account files can exhaust memory and cause the buildkitd process to terminate due to an out-of-memory condition.
Which versions are affected and what is the remediation?
BuildKit versions prior to 0.31.1 are affected. Upgrade to version 0.31.1, which adds the fix.