Monday, September 7, 2026

Docker CopyEscape Vulnerability Enables Host File Overwrite and Root Code Execution

A critical vulnerability in Docker, tracked as CVE-2026-17106 and referred to as “CopyEscape,” allows malicious containers to overwrite files on the host system using the widely utilized `docker cp` command.

This flaw can lead to code execution as the local user and, potentially, as root on Linux systems where copy operations are performed with elevated privileges.

Docker CopyEscape Vulnerability

Researchers at Imperva Threat Research identified the issue in Docker’s container-to-host archive-copy workflow. Docker has confirmed that this vulnerability also impacts `sbx cp`, the copy utility used by Docker Sandboxes. The problem arises when a user attempts to copy files from an attacker-controlled container or sandbox.

Typically, a command like `docker cp container:/file.txt ./file.txt` is designed to write only to the user-specified destination. However, Docker does not perform a simple direct file copy.

Instead, the daemon packages the requested container files into a tar archive, and the Docker CLI then extracts it on the local machine. CopyEscape exploits weaknesses in both parts of this process.

First, an attacker can manipulate the live container’s filesystem while Docker builds the archive. Docker’s archiving routine inspects a path multiple times: first, to determine whether it is a directory, and again to create its tar metadata.

Tar Stream Output (Source: Imperva)
Tar Stream Output (Source: Imperva)

A running container can alter that path between these checks, resulting in an archive that describes contradictory filesystem states.

For instance, if Docker initially identifies an object as a directory, an attacker could replace it with a symbolic link before the archive metadata is completed.

Consequently, the archive could contain a symlink entry followed by a child file that supposedly exists beneath that symlink.

The second weakness occurs during extraction on the host system. While the Docker CLI attempts to validate symlink targets by constructing a path, it ultimately creates the symlink using the original attacker-controlled archive value.

This discrepancy allows an absolute symlink to point outside of the intended destination directory.

When Docker extracts a child entry via that symlink, the operating system resolves the link and writes the attacker’s file to an arbitrary path on the host accessible to the user running `docker cp`. On macOS, this extraction happens on the host rather than inside Docker Desktop’s Linux virtual machine.

An attacker could overwrite crucial files, including shell startup files, SSH configuration, cloud credentials, source code, executables, or LaunchAgent persistence files. A modified shell configuration file could execute malicious commands the next time the victim opens a terminal.

Linux environments face even graver risks, especially when administrators, continuous integration (CI) workers, or automation tools invoke `sudo docker cp`.

Imperva demonstrated that replacing `/usr/bin/runc` with an attacker-controlled script could lead to root code execution during a subsequent Docker operational phase.

The vulnerability does not directly grant root privileges through the Docker daemon; instead, it exploits permissions already granted to the local copy command.

The potential impact is significant for developer systems, CI/CD infrastructure, incident response workflows, and AI-agent sandbox environments. Simply retrieving logs, build artifacts, forensic evidence, or generated code from an untrusted container could trigger an overwrite on the host system.

Docker users are encouraged to upgrade to Docker Engine and CLI version 29.7.2 or later, and Docker Desktop version 4.86.0 or later.

Until patches are implemented, organizations should refrain from copying files from running or untrusted containers, stop containers before retrieval, avoid root-level copy automation, and use disposable virtual machines or low-privilege accounts when analyzing suspicious containers.

Stop new phishing & malware before they compromise your business. Integrate live intel from 15K SOCs around the world

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Hot this week

How To Access Dark Web Anonymously and know its Secretive and Mysterious Activities

What is Deep Web The deep web, invisible web, or...

How to Build and Run a Security Operations Center (SOC Guide) – 2023

Today’s Cyber security operations center (CSOC) should have everything...

Russian Hackers Bypass EDR to Deliver a Weaponized TeamViewer Component

TeamViewer's popularity and remote access capabilities make it an...

Web Server Penetration Testing Checklist – 2026

Web server pentesting is performed under three significant categories: identity,...

ATM Penetration Testing – Advanced Testing Methods to Find The Vulnerabilities

ATM Penetration testing, Hackers have found different approaches to...

CrowdStrike Launches SafeMind Agentic AI Cybersecurity System Built With NVIDIA Nemotron

CrowdStrike has launched SafeMind, an AI-driven cybersecurity system developed...

Chainguard Hits 1 Billion Build Manifests With AI-Powered Software Supply Chain Security

Chainguard has surpassed 1 billion container build manifests, doubling...

Russian Hackers Deploy New HOOKEDGE Backdoor in Espionage Attacks Across Europe

Russian state-sponsored threat actor BlueDelta, also tracked as APT28,...

New Panzer Ransomware Hits 16 Victims Across 11 Countries With Data Theft and Encryption

Panzer ransomware has emerged as a new Ransomware-as-a-Service (RaaS)...

12-Year-Old PostgreSQL Flaw Lets Attackers Execute Code and Take Over Database Servers

A critical PostgreSQL vulnerability dubbed PostGREShell could allow low-privileged...

Hackers Use Frontier AI Agents to Breach Enterprise Network in Under 10 Hours

A threat actor used frontier artificial-intelligence models and attack-specific...

CARS24 Data Breach Exposes 3,100 Customer Records, Leads Allegedly Sold for ₹1,000 Each

Used-car platform CARS24 has alleged that confidential information belonging...

Related Articles

Recent News