CVE-2026-42306

CVE-2026-42306 is a high-severity security vulnerability in github.com/docker/docker (go), affecting versions <= 28.5.2. It is fixed in 2.0.0-beta.14.

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.

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).

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.

CVE-2026-42306 has a CVSS score of 7.2 (High). The vector is requires local access, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.0.0-beta.14); upgrading removes the vulnerable code path.

Affected versions

github.com/docker/docker (<= 28.5.2) github.com/moby/moby/v2 (< 2.0.0-beta.14) github.com/moby/moby (<= 28.5.2)

Security releases

github.com/moby/moby/v2 → 2.0.0-beta.14 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade github.com/moby/moby/v2 to 2.0.0-beta.14 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-42306? CVE-2026-42306 is a high-severity security vulnerability in github.com/docker/docker (go), affecting versions <= 28.5.2. It is fixed in 2.0.0-beta.14.
  2. How severe is CVE-2026-42306? CVE-2026-42306 has a CVSS score of 7.2 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2026-42306?
    • github.com/docker/docker (go) (versions <= 28.5.2)
    • github.com/moby/moby/v2 (go) (versions < 2.0.0-beta.14)
    • github.com/moby/moby (go) (versions <= 28.5.2)
  4. Is there a fix for CVE-2026-42306? Yes. CVE-2026-42306 is fixed in 2.0.0-beta.14. Upgrade to this version or later.
  5. Is CVE-2026-42306 exploitable, and should I be worried? Whether CVE-2026-42306 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-42306 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-42306? Upgrade github.com/moby/moby/v2 to 2.0.0-beta.14 or later.

Other vulnerabilities in github.com/docker/docker

CVE-2026-42306CVE-2026-41567CVE-2026-34040CVE-2026-33997CVE-2025-54410

Stop the waste.
Protect your environment with Kodem.