# CVE-2026-42306: Moby Docker Engine race condition in docker cp mount setup

Source: https://junglewise.ai/threats/cve-2026-42306-moby-docker-engine-race-condition-in-docker-cp-mount-setup  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-12. Updated: 2026-06-12  
License: CC BY 4.0 with a link back

CVE-2026-42306 · Severity: high · CVSS 7.2 · Published 2026-06-12

Moby is an open-source framework used to build and run software containers, most notably as the foundation for Docker. A security flaw allows a malicious container to trick the system into mounting storage volumes onto the host computer's files instead of inside the container. This could allow an attacker to overwrite critical system files or disrupt services, potentially leading to a full system compromise or a denial-of-service state.

Technologies: [Docker](https://junglewise.ai/threats/technologies/docker), [Docker Daemon](https://junglewise.ai/threats/technologies/engine), [github.com/docker/docker (Go)](https://junglewise.ai/threats/technologies/github-com-docker-docker), [github.com/moby/moby (Go)](https://junglewise.ai/threats/technologies/github-com-moby-moby), [github.com/moby/moby/v2 (Go)](https://junglewise.ai/threats/technologies/github-com-moby-moby-v2). Vendors: [Docker](https://junglewise.ai/threats/vendors/docker), [Go](https://junglewise.ai/threats/vendors/go), [Moby](https://junglewise.ai/threats/vendors/moby), [Moby Project](https://junglewise.ai/threats/vendors/moby-project).

## Quick answers

**Is CVE-2026-42306 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-42306 being exploited in the wild.

**How severe is CVE-2026-42306?** High severity, with a CVSS score of 7.2, published 12 June 2026.

**Which products and versions are affected?** Docker <= 28.5.2; Docker Daemon <= 28.5.2; Docker Engine < 29.5.1; github.com/docker/docker (Go) <= 28.5.2, SEMVER:introduced=0, SEMVER:introduced=0,last_affected=28.5.2; and 4 more.

**Is there a fix for CVE-2026-42306?** Yes. github.com/moby/moby/v2 (Go): upgrade to 2.0.0-beta.14 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-42306 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-42306?** Check whether you run Docker, Docker Daemon, Docker Engine or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/moby/moby/v2 (Go): upgrade to 2.0.0-beta.14 or later

  ```sh
  go get github.com/moby/moby/v2@v2.0.0-beta.14
  ```


## Technical details

A Time-of-Check Time-of-Use (TOCTOU) race condition exists in the Docker/Moby daemon during the setup of temporary mount namespaces for the 'docker cp' operation. When copying files, the daemon creates a mount destination within the container root and then executes a bind mount. A malicious process inside the container can exploit the window between mountpoint creation and the mount() syscall by replacing the destination path with a symbolic link. Because the mount() syscall follows symlinks, the volume is attached to an arbitrary host path. This allows an attacker to overwrite host files (if the volume is writable) or mask host paths (if read-only), causing a denial of service. Exploitation requires the container to have at least one volume mount and an operator to initiate a 'docker cp' or archive API call.

## Affected products

- Docker Docker Engine < 29.5.1
- Docker Docker Daemon <= 28.5.2
- Moby Moby Daemon < 2.0.0-beta.14

## Identifiers

- CVE-2026-42306
- GHSA-rg2x-37c3-w2rh
- GO-2026-5617

## Timeline

- 2026-05-18: advisory: Initial GitHub advisory published
- 2026-06-12: disclosed: CVE published to NVD

## References

- [https://github.com/moby/moby/security/advisories/GHSA-rg2x-37c3-w2rh](https://github.com/moby/moby/security/advisories/GHSA-rg2x-37c3-w2rh)

## Related threats

- [SwarmKit Cluster-API proxy TLS identity overwrite](https://junglewise.ai/threats/cve-2026-115539-swarmkit-s-cluster-api-proxy-can-overwrite-a-forwarded-client-s)
- [Moby overlay network encryption iptables rules bypass after firewalld reload](https://junglewise.ai/threats/cve-2026-115538-moby-s-overlay-network-driver-does-not-restore-the-iptables)
- [Moby Docker Engine symlink race condition in docker cp](https://junglewise.ai/threats/cve-2026-41568-moby-docker-engine-symlink-race-condition-in-docker-cp)
- [Moby and Docker Engine code execution via trojanized decompression binaries](https://junglewise.ai/threats/cve-2026-41567-moby-and-docker-engine-code-execution-via-trojanized)
- [Moby AuthZ plugin authorization bypass via oversized request body](https://junglewise.ai/threats/cve-2026-34040-moby-authz-plugin-authorization-bypass-via-oversized-request-body)
