BuildKit possible race condition with accessing subpaths from cache mounts
BuildKit can allow files from the host system to be accessed by a build container when two malicious build steps run in parallel sharing the same cache mount with subpaths, due to a race condition. This is a serious security issue because it exposes sensitive host files to untrusted containers.
A race condition exists in BuildKit's cache mount handling when multiple build steps execute concurrently with overlapping subpaths on shared cache mounts. An attacker controlling two parallel build steps can exploit timing gaps during cache access to read arbitrary files from the host filesystem that should be isolated. The vulnerability requires shared cache configuration with subpaths and parallel execution; it was resolved in v0.12.5.
Want to know if your infrastructure is exposed to this?
Talk to TrueHacking →