CVE-2026-42306: Moby: Race condition in docker cp allows bind mount redirection to host path

Published May 18, 2026
·
Updated

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 cp completes), 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 cp into that container, or call the PUT /containers/{id}/archive or HEAD /containers/{id}/archive API 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 cp with untrusted running containers. - Use authorization plugins to restrict access to the archive API endpoints (PUT /containers/{id}/archive, HEAD /containers/{id}/archive).

Other sources

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.

MITRE

Affected Software

19 affected componentsFixes available
go/github.com/moby/moby<=28.5.2
go/github.com/moby/moby/v2<2.0.0-beta.14
2.0.0-beta.14
go/github.com/docker/docker<=28.5.2
Docker Engine<29.5.1
Mobyproject Moby<=28.5.2
Mobyproject Moby\/v2=2.0.0-beta0
Mobyproject Moby\/v2=2.0.0-beta1
Mobyproject Moby\/v2=2.0.0-beta10
Mobyproject Moby\/v2=2.0.0-beta11
Mobyproject Moby\/v2=2.0.0-beta12
Mobyproject Moby\/v2=2.0.0-beta13
Mobyproject Moby\/v2=2.0.0-beta2
Mobyproject Moby\/v2=2.0.0-beta3
Mobyproject Moby\/v2=2.0.0-beta4
Mobyproject Moby\/v2=2.0.0-beta5
Mobyproject Moby\/v2=2.0.0-beta6
Mobyproject Moby\/v2=2.0.0-beta7
Mobyproject Moby\/v2=2.0.0-beta8
Mobyproject Moby\/v2=2.0.0-beta9

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/moby/moby/v2 to a version that resolves this vulnerability.

    Fixed in 2.0.0-beta.14
  2. Upgrade

    Upgrade go/github.com/docker/docker to a version that resolves this vulnerability.

    Fixed in 29.5.1
  3. Upgrade

    Upgrade go/github.com/moby/moby to a version that resolves this vulnerability.

    Fixed in 2.0.0-beta.14
  4. Compensating control

    Only run containers from trusted images; avoid running untrusted or arbitrary container images on hosts where sensitive host paths exist.

  5. Compensating control

    Avoid using `docker cp` (and the archive API endpoints PUT /containers/{id}/archive and HEAD /containers/{id}/archive) with untrusted running containers.

  6. Compensating control

    Use authorization plugins to restrict access to the archive API endpoints (PUT /containers/{id}/archive, HEAD /containers/{id}/archive) so only authorized operators can initiate docker cp/archive operations.

Event History

May 18, 2026
Advisory Published
via GitHub·05:53 PM
Data Sourced
via GitHub·05:53 PM
DescriptionSeverityWeaknessAffected Software
Jun 12, 2026
CVE Published
via MITRE·06:09 PM
Data Sourced
via MITRE·06:09 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:16 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-42306?

CVE-2026-42306 has a high severity rating due to its potential for overwriting host files and causing denial of service.

2

How do I fix CVE-2026-42306?

To mitigate CVE-2026-42306, upgrade to a version of Docker that is greater than 28.5.2 or the 2.0.0-beta.14 release.

3

What types of attacks are possible with CVE-2026-42306?

CVE-2026-42306 could allow a malicious container to redirect bind mount targets to arbitrary host paths, leading to file overwriting.

4

Which software packages are affected by CVE-2026-42306?

CVE-2026-42306 affects several packages, including those from github.com/moby/moby and github.com/docker/docker up to specified versions.

5

Is CVE-2026-42306 widely exploitable?

Yes, CVE-2026-42306 is considered widely exploitable, particularly in environments using the affected Docker versions.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203