CVE-2026-41568: Docker Race Condition Vulnerability

MODERATE
Advisory Identifier: GHSA-vp62-88p7-qqf5
CVSS 6.1
CWE-367 CWE-81 CWE-61
Published
Advisory Summary

CVE-2026-41568 is a MODERATE (CVSS 6.1) 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 creation of arbitrary empty files on the host via symlink swap. Remediation is available by upgrading affected packages to version 2.0.0-beta.14.

CVE-2026-41568 at a Glance

CVE Identifier CVE-2026-41568
GHSA Identifier GHSA-vp62-88p7-qqf5
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product Docker
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.1

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:L/A:H).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2026-41568

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.

github.com/docker/docker fixed: Latest secure release
Upgrade github.com/docker/docker to Latest secure release
github.com/moby/moby/v2 fixed: 2.0.0-beta.14
Upgrade github.com/moby/moby/v2 to 2.0.0-beta.14
github.com/moby/moby fixed: Latest secure release
Upgrade github.com/moby/moby to Latest secure release
Verify Direct and Transitive Dependencies

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-41568, 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

## Summary A race condition during `docker cp` mount setup allows a malicious container to create empty files or directories at arbitrary absolute paths on the host filesystem. This advisory covers the race during mountpoint creation. The related race during the subsequent mount syscall is tracked in GHSA-rg2x-37c3-w2rh ## 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 path is first resolved within the container's root filesystem using `GetResourcePath`, and then used to create the mountpoint (file or directory) if it does not already exist via `createIfNotExists`. Between path resolution and mountpoint creation, a process running inside the container can swap a path component for a symlink pointing to an arbitrary location on the host. Because `createIfNotExists` operates on the already-resolved absolute path using standard `os.MkdirAll` and `os.OpenFile` — which follow symlinks in intermediate path components — the symlink is followed and the file or directory is created outside the container root filesystem, as root. ## Impact A malicious container can create empty files or directories at arbitrary absolute paths on the host filesystem, running as root. This enables persistent denial of service — for example: - Converting `/etc/docker/daemon.json` into a directory prevents the daemon from restarting - Creating `/etc/nologin` prevents user logins - Overwriting critical system paths with empty files can break host services The container does not gain read or write access to existing host files — only the ability to create new empty files or directories at chosen paths. ### Conditions for exploitation - A container must be running with a process that can rapidly create and swap symlinks at a 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. ## Patches Mountpoint creation is now scoped to the container root using `os.Root` (Go 1.24+), which refuses to follow symlinks that escape the opened root directory. All filesystem operations in `createIfNotExists` (`MkdirAll`, `OpenFile`) are performed through the `os.Root` handle, so even if a symlink swap occurs after path resolution, the creation stays confined to the container root. ## 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`).

CVE-2026-41568 Affected Docker Versions

3 component(s)
Fixed Versions:
2.0.0-beta.14
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-41568?
CVE-2026-41568 is a security vulnerability in Docker involving Race condition in docker cp allows creation of arbitrary empty files on the host via symlink swap under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which Docker versions are affected?
Affected versions include releases prior to 2.0.0-beta.14 across affected packages: github.com/docker/docker, github.com/moby/moby/v2, github.com/moby/moby.
What version fixes CVE-2026-41568?
Upgrading to 2.0.0-beta.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/docker/docker affected?
Yes, github.com/docker/docker is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is github.com/moby/moby/v2 affected?
Yes, github.com/moby/moby/v2 is affected in releases prior to 2.0.0-beta.14. Upgrade your dependency to 2.0.0-beta.14 or later.
What is the CVSS score of CVE-2026-41568?
CVE-2026-41568 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:L/A:H.
What CWE is associated with CVE-2026-41568?
CVE-2026-41568 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (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.).
How can I check Go dependencies for CVE-2026-41568?
Run the dependency tree command: 'inspect dependencies for github.com/docker/docker'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vp62-88p7-qqf5",
  "modified" : "2026-06-12T21:59:28Z",
  "published" : "2026-05-18T17:52:55Z",
  "aliases" : [ "CVE-2026-41568" ],
  "summary" : "Docker: Race condition in docker cp allows creation of arbitrary empty files on the host via symlink swap",
  "details" : "## Summary\n\nA race condition during `docker cp` mount setup allows a malicious container to create empty files or directories at arbitrary absolute paths on the host filesystem.\n\nThis advisory covers the race during mountpoint creation. The related race during the subsequent mount syscall is tracked in GHSA-rg2x-37c3-w2rh\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 path is first resolved within the container's root filesystem using `GetResourcePath`, and then used to create the mountpoint (file or directory) if it does not already exist via `createIfNotExists`.\n\nBetween path resolution and mountpoint creation, a process running inside the container can swap a path component for a symlink pointing to an arbitrary location on the host. Because `createIfNotExists` operates on the already-resolved absolute path using standard `os.MkdirAll` and `os.OpenFile` — which follow symlinks in intermediate path components — the symlink is followed and the file or directory is created outside the container root filesystem, as root.\n\n## Impact\n\nA malicious container can create empty files or directories at arbitrary absolute paths on the host filesystem, running as root. This enables persistent denial of service — for example:\n\n- Converting `/etc/docker/daemon.json` into a directory prevents the daemon from restarting\n- Creating `/etc/nologin` prevents user logins\n- Overwriting critical system paths with empty files can break host services\n\nThe container does not gain read or write access to existing host files — only the ability to create new empty files or directories at chosen paths.\n\n### Conditions for exploitation\n\n- A container must be running with a process that can rapidly create and swap symlinks at a 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## Patches\n\nMountpoint creation is now scoped to the container root using `os.Root` (Go 1.24+), which refuses to follow symlinks that escape the opened root directory. All filesystem operations in `createIfNotExists` (`MkdirAll`, `OpenFile`) are performed through the `os.Root` handle, so even if a symlink swap occurs after path resolution, the creation stays confined to the container root.\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:L/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-vp62-88p7-qqf5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41568"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/moby/moby"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367", "CWE-61", "CWE-81" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-18T17:52:55Z",
    "nvd_published_at" : "2026-06-12T19:16:26Z"
  }
}