7.2high
Moby: Race condition in docker cp allows bind mount redirection to host path
- Severity
- 7.2high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.14% (higher than 3% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-rg2x-37c3-w2rhGO-2026-5617
Description
Moby is an open source container framework. In Docker Engine prior to version 29.5.1, Docker Daemon versions 28.5.2 and prior, and Moby Daemon prior to version 2.0.0-beta.14, a race condition during docker cp mount setup allows a malicious container to redirect a bind mount target to an arbitrary host path, potentially overwriting host files or causing denial of service. This issue has been patched in Docker Engine version 29.5.1 and Moby Daemon version 2.0.0-beta.14.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| moby moby | github.com/docker/docker/daemon <= 28.5.2, Docker Engine < 29.5.1, github.com/moby/moby/v2/daemon < 2.0.0-beta.14 | CVE List |
| github.com/docker/docker (Go) | up to 28.5.2, all versions | GitHub Advisory Database, Go Vulnerability Database |
| github.com/moby/moby/v2 (Go) | before 2.0.0-beta.14 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/moby/moby (Go) | up to 28.5.2, all versions | GitHub Advisory Database, Go Vulnerability Database |
| docker engine | before 29.5.1 | NVD |
| mobyproject moby | up to 28.5.2 | NVD |
| mobyproject moby/v2 | 2.0.0 | NVD |
All scores
| GitHub_M | 7.2high CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:H |
| GitHub | 7.2high CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:H |
| NVD | 7.2high CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:H |
Classification
What each source says
CVE List
Moby is an open source container framework. In Docker Engine prior to version 29.5.1, Docker Daemon versions 28.5.2 and prior, and Moby Daemon prior to version 2.0.0-beta.14, a race condition during docker cp mount setup allows a malicious container to redirect a bind mount target to an arbitrary host path, potentially overwriting host files or causing denial of service. This issue has been patched in Docker Engine version 29.5.1 and Moby Daemon version 2.0.0-beta.14.
GitHub Advisory Database
Summary
A race condition during docker cp mount setup allows a malicious container to redirect a bind mount target to an arbitrary host path, potentially overwriting host files or causing denial of service.
Details
When copying files into a container, the daemon sets up a temporary filesystem view by bind-mounting volumes into a private mount namespace. During this setup, the mount destination is created inside the container root and then a bind mount is attached using the container-relative path resolved to an absolute host path.
Between mountpoint creation and the mount() syscall, a process running inside the container can replace the destination (or a parent path component) with a symlink pointing to an arbitrary location on the host. The mount() syscall follows the symlink, causing the volume to be bind-mounted onto an arbitrary host path instead of the intended container path.
Impact
A malicious container can redirect a volume bind mount to an arbitrary host path. The impact depends on the volume content and mount options:
- If the volume is writable, arbitrary host files at the redirected path could be overwritten with the volume's contents.
- If the volume is read-only, the host path is masked by the mount for the duration of the operation, causing denial of service.
- In all cases the mount is temporary (torn down after the
docker cpcompletes), but the effects of any writes persist.
Conditions for exploitation
- A container must have at least one volume mount.
- A process inside the container must be able to rapidly create and swap symlinks at the volume mount destination path.
- An operator must initiate a
docker cpinto that container, or call thePUT /containers/{id}/archiveorHEAD /containers/{id}/archiveAPI endpoints.
Not affected
- Containers that do not have volume mounts are not affected, as the race occurs during volume bind-mount setup.
Workarounds
- Only run containers from trusted images.
- Avoid using
docker cpwith untrusted running containers. - Use authorization plugins to restrict access to the archive API endpoints (
PUT /containers/{id}/archive,HEAD /containers/{id}/archive).
Go Vulnerability Database
A race condition in the Docker daemon allows an attacker to redirect bind mounts to arbitrary host paths during a "docker cp" operation.
The affected code is in the daemon package, specifically the openContainerFS method. This is daemon-owned, Linux-specific code and is not intended for external use as a Go library.
References
| https://github.com/moby/moby/security/advisories/GHSA-rg2x-37c3-w2rh | advisory, mitigation, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-42306 | advisory | |
| https://github.com/moby/moby | package | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42306 changed 2026-06-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-rg2x-37c3-w2rh changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5617 changed 2026-07-28 | CC-BY-4.0 |
| NVD | CVE-2026-42306 changed 2026-06-17 | Public domain |