Buildx Bake's fs.read approval could be skipped
Most Docker security news is about the daemon. This one is about the build client, and it hits a habit I have: running docker buildx bake against a definition I did not write. On November 3 the Buildx maintainers published two advisories saying that Bake's filesystem approval step could be skipped. Both name v0.38.1 as the patched version.
What Bake's entitlements are for
Bake builds from a declarative HCL or JSON file. By default Buildx runs with restricted permissions. If a definition needs something outside the working directory, such as context = "../src", you grant it explicitly with --allow. The Bake reference documents fs.read=<path|*>, fs.write, and a combined fs form. The idea is that a definition you fetched from somewhere cannot quietly read files off your machine unless you said so.
Both advisories break that idea in narrow ways. Per the advisories, an untrusted Bake definition can expose files the Buildx client can access, without the required fs.read approval.
The two bypasses
- GHSA-xg6v-cv2h-2w5h (CVE-2026-121541, Moderate): when Bake builds several targets together, paths from some targets may not be checked against the approved entitlements.
- GHSA-rghq-x9hf-hc3r (CVE-2026-121542, Low): a path that uses the current directory's basename as a prefix, under the same parent directory, can slip past the check. The advisory adds that exploitation needs matching filenames sitting next to your project directory.
Both affect v0.38.0 and earlier, and both credit the hCaptcha Security Team. The advisory pages do not give a CVSS score, so the Moderate and Low labels are the maintainers' own ratings.
A version detail that tripped me up
I went looking for the fix and found that v0.38.1 was tagged on October 20, two weeks before the advisories. The notes I read describe only a rebuild with a newer Go toolchain, which rejects certificate chains using eight revoked eMudhra intermediates, and state no functional changes versus v0.38.0. Yet the advisories list v0.38.1 as the patched version. I can't reconcile those from the public pages. My working assumption is that the notes were not updated to mention the fix, but that is an assumption. Treat the advisory's version as the target rather than trusting a changelog skim.
The same release has a side effect worth knowing. Registries whose certificate chain relies on one of those blocked intermediates will fail TLS verification on pull and push until they get a replacement chain.
What I'm doing about it
- Check the client version with
docker buildx versionon every box and CI runner that calls Bake, and move to v0.38.1 or later. - Until then, only run Bake files I wrote or reviewed, which is the maintainers' own workaround. I also look for paths pointing outside the project directory.
- Stop passing broad grants like
--allow fs.read=*in scripts out of convenience. A bypass bug matters less when the approved set was small to begin with.
The severity here is modest, and the preconditions are real: you have to run someone else's definition. But that is exactly what happens when you clone a project and run its build file. If your pipeline does that for pull requests from forks, I would patch the runner first and read the advisories second.