Critical Docker Vulnerability: Understanding CVE-2026-17106, Also Known as CopyEscape
A significant vulnerability within Docker, identified as CVE-2026-17106 and commonly referred to as CopyEscape, has raised alarms among cybersecurity experts. This flaw allows a malicious container to overwrite files on the host machine, particularly when users execute the docker cp command—a command utilized for copying files from a Docker container to the local filesystem. This emerging issue is a vital concern for developers and organizations relying on Docker for containerization, as it directly jeopardizes the integrity of their systems.
This vulnerability specifically impacts copy-out operations, during which Docker extracts data from a container and retrieves it onto the system utilizing the Docker Command Line Interface (CLI). The potential implications of CopyEscape extend beyond simple file overwrites, introducing the risk of much greater system vulnerabilities that could be exploited by malicious actors.
The Unveiling of Docker’s CopyEscape Flaw
The issue was prominently uncovered by Imperva’s Red Team, who identified a critical flaw in Docker’s archive-processing path. While the docker cp function appears to merely facilitate file transfers, the process involves several intricate steps. Initially, Docker’s daemon structures the requested content from a container into a tar archive. Once this operation is complete, the Docker CLI extracts the archive locally. Consequently, any attacker in control of the source container would have the potential to manipulate the archive’s contents, which the local Docker user would subsequently process.
CopyEscape capitalizes on two key vulnerabilities within this file-transfer process. The first vulnerability occurs when a malicious container triggers a race condition as Docker scans its filesystem to construct the archive. In this scenario, Docker may initially identify a path as a directory it needs to explore. However, an attacker could swiftly replace that directory with a symbolic link before Docker finalizes its metadata recording. This leads to a situation where the archive incorrectly represents the same path as both a symbolic link and a directory containing child files.
The second vulnerability arises during the extraction phase of the operation. It has been observed that the Docker CLI does not consistently confine every filesystem operation to the user-designated destination. A strategically crafted symlink entry could direct the extraction process outside the specified output directory, thus allowing a subsequent child file entry to be written through that link. Such a sequence creates the potential for commands intended to safely copy files to inadvertently overwrite critical data elsewhere on the host system.
The severity of this vulnerability correlates with the privileges held by the individual or process executing the docker cp command. For example, a developer tasked with copying files from a container under malicious control could unintentionally overwrite vital files. These include vital shell startup files, SSH settings, cloud configuration files, source code, and other essential binaries or user-level persistence mechanisms.
On macOS, an additional layer of risk is present since the Docker CLI executes the extraction on the host machine rather than within Docker Desktop’s Linux virtual machine, thereby exposing the files in the user’s macOS filesystem. On Linux systems, this vulnerability escalates in severity, especially if the docker cp command is employed with elevated privileges. Imperva’s proof of concept demonstrated that it was possible to replace /usr/bin/runc with a script controlled by an attacker. When the Docker operation is subsequently executed, the modified binary runs, allowing for root-level code execution—further escalating the harmful potential of this vulnerability.
It is also essential to highlight that the compromised container does not automatically acquire root privileges from the Docker daemon; rather, it leverages the authority tied to the host-side copy process.
Broader Implications for Docker Sandboxes
This vulnerability extends its ramifications to Docker Sandboxes, as confirmed by Docker itself. The sbx cp command, which is responsible for transferring files out of isolated sandbox environments, is subject to the same destination-escape vulnerability, compounding risks throughout AI agent and coding workflows where artifacts are retrieved from untrusted or potentially compromised sandbox sessions.
Recommended Mitigations and Precautions
To mitigate the risks posed by this critical vulnerability, Docker users are urged to undertake immediate upgrades. It is recommended that users update to Docker Engine and CLI version 29.7.2 or later, Docker Desktop version 4.86.0 or later, and Docker Sandboxes version 0.38.0 or later. However, until these patches are applied, various precautions can significantly enhance security:
- Avoid copying from live untrusted containers.
- Pause containers before initiating file retrieval.
- Refrain from using root privileges to run
docker cpworkflows. - Utilize isolated environments when collecting evidence or artifacts from suspected compromised containers.
The CopyEscape vulnerability underscores the importance of maintaining vigilant security practices within containerization and further emphasizes the need for timely updates and robust intervention protocols to protect against emerging threats in the rapidly evolving landscape of cybersecurity. Organizations must act decisively to shield their systems and data from potential exploitation stemming from this newfound vulnerability.

