CVE-2026-42306: Docker Race Condition Vulnerability
HIGHCVE-2026-42306 is a HIGH (CVSS 7.2) race condition vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Docker libraries in the Go ecosystem. The issue involves race condition in docker cp allows bind mount redirection to host path. Remediation is available by upgrading affected packages to version 2.0.0-beta.14.
CVE-2026-42306 at a Glance
Security Impact
CVSS: 7.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:H).
How to Fix CVE-2026-42306
To remediate this vulnerability, upgrade all affected Docker dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/docker/docker to Latest secure release
Upgrade github.com/moby/moby/v2 to 2.0.0-beta.14
Upgrade github.com/moby/moby to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/docker/docker
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-42306, inspect your project dependencies for Docker:
inspect dependencies for github.com/docker/docker
Analyze the terminal output to locate any version of Docker in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0-beta.14), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Docker, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-42306 Affected Docker Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/docker/docker
|
Go |
≤ 28.5.2
|
|
|
github.com/moby/moby/v2
|
Go |
< 2.0.0-beta.14
|
2.0.0-beta.14
|
|
github.com/moby/moby
|
Go |
≤ 28.5.2
|
|
References
Frequently Asked Questions
What is CVE-2026-42306?
Which Docker versions are affected?
What version fixes CVE-2026-42306?
Is github.com/docker/docker affected?
Is github.com/moby/moby/v2 affected?
What is the CVSS score of CVE-2026-42306?
What CWE is associated with CVE-2026-42306?
How can I check Go dependencies for CVE-2026-42306?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rg2x-37c3-w2rh",
"modified" : "2026-06-12T21:59:32Z",
"published" : "2026-05-18T17:53:08Z",
"aliases" : [ "CVE-2026-42306" ],
"summary" : "Docker: Race condition in docker cp allows bind mount redirection to host path",
"details" : "## Summary\n\nA 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.\n\n## Details\n\nWhen 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.\n\nBetween 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.\n\n## Impact\n\nA malicious container can redirect a volume bind mount to an arbitrary host path. The impact depends on the volume content and mount options:\n\n- If the volume is writable, arbitrary host files at the redirected path could be overwritten with the volume's contents.\n- If the volume is read-only, the host path is masked by the mount for the duration of the operation, causing denial of service.\n- In all cases the mount is temporary (torn down after the `docker cp` completes), but the effects of any writes persist.\n\n### Conditions for exploitation\n\n- A container must have at least one volume mount.\n- A process inside the container must be able to rapidly create and swap symlinks at the volume mount destination path.\n- An operator must initiate a `docker cp` into that container, or call the `PUT /containers/{id}/archive` or `HEAD /containers/{id}/archive` API endpoints.\n\n### Not affected\n\n- Containers that do not have volume mounts are not affected, as the race occurs during volume bind-mount setup.\n\n## Workarounds\n\n- Only run containers from trusted images.\n- Avoid using `docker cp` with untrusted running containers.\n- Use authorization plugins to restrict access to the archive API endpoints (`PUT /containers/{id}/archive`, `HEAD /containers/{id}/archive`).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/docker/docker"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "28.5.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/moby/moby/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.0-beta.14"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/moby/moby"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "28.5.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/moby/moby/security/advisories/GHSA-rg2x-37c3-w2rh"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42306"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/moby/moby"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-367", "CWE-61" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-18T17:53:08Z",
"nvd_published_at" : "2026-06-12T19:16:27Z"
}
}