A newly discovered vulnerability in Docker, identified as CVE-2026-17106 and referred to as CopyEscape, poses a significant security threat by allowing malicious containers to overwrite host files and potentially execute code with root-level privileges.
Understanding the Vulnerability
This flaw stems from the way Docker handles archive extraction within moby/go-archive. When files are copied from a container to a host, Docker packages these files into a tar archive, which the local Docker CLI then extracts. This process can be exploited if an attacker controls the container, potentially inserting a symlink that redirects file writes outside the intended directory.
The main exploit, as described by Imperva, leverages a race condition during archive generation. This allows a running container to alter a directory into a symbolic link, creating an inconsistent archive that Docker CLI follows improperly during file extraction.
Impact on Systems
The consequences of this vulnerability are severe, especially on Linux systems where Docker cp is often run with elevated privileges. An attacker could replace critical files such as shell startup scripts or cloud credentials, leading to unauthorized code execution.
On macOS, although Docker Desktop operates within a Linux VM, the vulnerability still poses risks to local user files. Imperva’s proof of concept demonstrated the replacement of critical binaries with malicious scripts, executing payloads with root permissions once invoked by Docker.
Mitigation and Recommendations
To address this issue, Docker has released updates for its products. Docker Desktop version 4.86.0 and moby/go-archive version 0.3.0 contain fixes that mitigate the vulnerability. Organizations are advised to upgrade to these versions or later to secure their systems.
In the interim, administrators should avoid copying files from untrusted or compromised containers. Stopping a container before executing docker cp can help prevent exploitation. Additionally, using disposable virtual machines or isolated environments for handling suspicious container data is recommended.
The CopyEscape flaw underscores the importance of treating archive extraction as a security boundary, highlighting how routine operations can be exploited if not properly secured.
For ongoing protection, organizations should continuously monitor for updates and follow security best practices to mitigate potential threats posed by container-based environments.
