Docker 29.10.1 (24 November 2026) fixes GHSA-vfmq-r373-x89f: a container could redirect read-only flags during docker cp. Why the old order raced and how it is fixed.
The advisory in one paragraph
Docker Engine 29.10.1, released on 24 November 2026, fixes CVE-2026-135124, published as GitHub advisory GHSA-vfmq-r373-x89f the same day. When an operator or API client copies files into a running container with docker cp or PUT /containers/{id}/archive, the daemon builds a temporary view of the container filesystem with the container's volumes bind-mounted into it, then extracts the archive there. It applied the read-only flags of those bind mounts through a path inside the container's filesystem. A process in the container could change that path at the right moment, so the flags landed on a different mount and the read-only bind stayed writable for the duration of the copy. Files from the archive could then be created or overwritten in the host directory behind a mount that was meant to protect it.
The fix is in moby/moby pull request 54279, the 29.x backport of 54278, merged on 24 November. This guide explains why the old order was racy, what the new order does differently, who is exposed, and what to do besides upgrading.
Why a descriptor was not enough
The old code was already careful about one race. It opened the mount target through os.Root so a symlink in the container could not send the initial bind mount somewhere else, and it performed the bind through the /proc/self/fd/N path of that open descriptor. A descriptor names a directory, not a path, so renames after the open cannot redirect it.
The trouble was the steps after the bind. The comment removed by the fix explains why they were done differently:
// The kernel rejects remount and propagation-change syscalls
// when the target is a /proc/self/fd path. Only the initial
// bind mount works on such paths, so we perform that via the
// fd path for TOCTOU safety and then resolve the real path for
// the read-only remount and propagation change.So the daemon called readlink on the descriptor path to get a path string such as /vol/b/ro, and then remounted read-only by that string, made it private by that string, and made it recursively read-only by that string. Each of those calls resolves the path again from the root of the container view. Between the readlink and the remount, the container can rename an ancestor directory. The integration test added with the fix shows the attack shape: /vol is a writable bind, /vol/a/ro is a decoy writable bind, /vol/b/ro is the read-only bind, and a process in the container swaps /vol/a and /vol/b in a tight loop. If the swap lands between the readlink and the remount, the string /vol/b/ro now leads to the decoy. The decoy becomes read-only and the real read-only source stays writable while the archive is extracted.
This is the general pattern of a time-of-check to time-of-use bug: the code checked, or in this case resolved, a name once, and then acted on the name again later, trusting that it still meant the same object.
What the fixed order does
The fix in daemon/containerfs_linux.go stops resolving a path that the container can influence. For each mount it now:
- Creates a stub directory (or file, for file mounts) in the daemon's private temporary directory, outside anything the container can reach.
- Bind-mounts the source onto that stub.
- Applies the read-only remount, private propagation and recursive read-only flags to the stub, by its private path.
- Opens the target inside the container view through
os.Root, as before. - Moves the finished mount from the stub onto the target descriptor with
MS_MOVE.
if err := mount.Mount(m.Source, stub, "", bindMode); err != nil {
return err
}
if err := applyContainerFSMountFlags(m, stub); err != nil {
return err
}
// ... open the target through os.Root ...
err = unix.Mount(stub, targetPath, "", unix.MS_MOVE, "")Every step that needs a path uses a path the container cannot rename. The only step that touches the container view uses a descriptor. The mount arrives at its destination already read-only, so there is no window in which it exists there while writable. A rename after the move can change where the mount appears in the container view, but not its flags.
A model of both orders
The companion example mount_flag_race_model is an in-memory model of this ordering. Directories are inodes, mounts attach a source to an inode, path resolution crosses mounts, and readlink on a descriptor reports the directory's current path, as it does on Linux after a rename. It does not call mount(2) and is not a Docker test; it exists to show which interleavings are unsafe.
The model runs the setup with the container's swap placed after each daemon step. In the old order only one placement is unsafe: after the readlink and before the remount. A swap before the readlink is harmless, because readlink then returns the new, correct path, and a swap after the remount is too late. In the new order no placement leaves the read-only source writable. One run of the unsafe case prints this trace:
daemon opens /vol/b/ro by descriptor
daemon binds host:/srv/ro on the descriptor
daemon reads the path back from the descriptor: /vol/b/ro
container swaps /vol/a and /vol/b
daemon remounts read-only by path; flag lands on host:/srv/decoyA narrow window is not a safe window. The attacker controls a process that can keep retrying the swap for as long as a copy runs, and the integration test added with the fix swaps in a tight loop for exactly that reason.
Who is affected
The advisory lists three conditions. The container has at least one read-only bind mount. A process inside the running container can modify a path leading to that mount's destination; in the test that is a writable parent volume. And someone copies files into that container with docker cp or the archive PUT endpoint.
It also lists what is not affected: containers without read-only bind mounts, stopped containers (no process can interfere), and copies out of a container (GET and HEAD on the archive endpoint), because they do not write to the mounts. Rootless Docker Engine is affected, but the impact is limited to files the daemon's user can access.
The impact is bounded in two useful ways. The attacker does not choose the content written; it comes from the archive supplied by whoever runs the copy. And the attacker cannot start the copy. But the written files persist after the copy. If the protected host directory holds configuration that the host or another container trusts, an archive containing an unexpected file name can still do damage, and an operator copying a debug script into a compromised container is exactly the situation where this matters.
What to do
Upgrade Docker Engine to 29.10.1. The advisory also gives workarounds for hosts you cannot upgrade immediately:
- Do not copy files into running containers that run untrusted workloads.
- Stop the container before copying files into it.
- Use an authorization plugin to restrict
PUT /containers/{id}/archive.
There is a design lesson for platforms built on top of the engine. Many CI systems, notebook platforms and agent sandboxes push files into running containers, for example to inject an input file or a tool. If your platform does that through the archive API, treat the copy as a privileged operation that crosses a trust boundary. Prefer delivering inputs before the workload starts, through a volume prepared by a trusted process, and keep read-only host directories out of containers whose processes you do not trust, rather than relying on the read-only flag as the only control.
For agent sandboxes the advice is specific. If an agent's code runs inside a container and the harness later copies results or new tools in, the agent's code is the untrusted process in the advisory's first condition. Copying out is unaffected; copying in is where to apply the upgrade and the workarounds.
Applying the lesson to your own code
The fixed order generalizes beyond mounts. When privileged code must act on an object that an untrusted party can rename:
- Resolve the name once, to a descriptor or handle, and do every later operation through the handle.
- If an operation cannot take a handle, prepare the object somewhere the untrusted party cannot reach, finish every attribute there, and move it into place in one step.
- Never read a path back from a handle and act on the string; that converts a safe reference back into an unsafe one.
The same reasoning sits behind openat2 with RESOLVE_BENEATH, os.Root in Go and writing through an already-opened file handle in other languages.
Limits of this guide
The vulnerability description, conditions and workarounds come from the published advisory; the code excerpts are from pull request 54279. The companion example is a model of ordering, not an exploit, and I did not run Docker for this guide. Docker 29.10.1 also fixes CVE-2026-135844 (unbounded reads when parsing user, group and ID mapping files) and several networking bugs; read the full release notes before planning the rollout.