Most Critical Docker Vulnerability Let Hackers To Take Complete Control Over Host & All Containers Within It

Researchers discovered a critical vulnerability in Docker that allows an attacker to take complete control of the host and the containers associated with it.

The Docker vulnerability resides in the copy command (cp) used in containers platforms such as Docker, Podman, and Kubernetes. This command can be used to copy files & folders between the container and the local file system.

The commands can be used like below:

docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

Docker Copy Command Vulnerability

According to researchers, this is the first Docker cp command that leads to a full container escape after the runC vulnerability identified in February.

The vulnerability can be exploited by the attacker if the docker already compromised with any previous vulnerabilities or if the user runs a malicious container image from an untrusted source.

“If the user then executes the vulnerable cp command to copy files out of the compromised container, the attacker can escape and take full root control of the host and all other containers in it,” reads Palo Alto report.

To copy out the file between containers, Docker uses a process called docker-tar, which works by Chrooting which archiving and passing the file to the target destination.

In following exploiting video, “a Docker user runs a malicious image that contains our evil libnss_files.so library and then tries to copy some logs from the container. The /breakout binary in the image is a simple bash script that mounts the host filesystem to the container at /host_fs and also writes a message to /evil on the host.’

The docker-tar isn’t containerized and it runs in host namespaces with all root capabilities, so by injecting code into docker-tar, a malicious container can get full access.

There are 2 possible attack scenario is a Docker user that copies some files from either:

  • A container running a malicious image with bad libnss_*.so libraries.
  • A compromised container where an attacker replaced the libnss_*.so libraries.

Both scenarios allow an attacker to exploit the docker-vulnerability to gains root code execution access on the host.

The Docker vulnerability can be tracked as CVE-2019-14271 and the security issue fixed with Docker version 19.03.1.

Researchers recommended running the containers as a non-root user if the root permission is not required, it may increase security and prevent attacks.

You can read the complete Technical analysis for this vulnerability here.

Also Read: Docker Hub Hacked – Hackers Gained Access to 190,000 Users Accounts

Gurubaran

Gurubaran is a co-founder of Cyber Security News and GBHackers On Security. He has 10+ years of experience as a Security Consultant, Editor, and Analyst in cybersecurity, technology, and communications.

Recent Posts

Threat Actors Exploit Google Docs And Weebly Services For Malware Attacks

Phishing attackers used Google Docs to deliver malicious links, bypassing security measures and redirecting victims…

9 hours ago

Python NodeStealer: Targeting Facebook Business Accounts to Harvest Login Credentials

The Python-based NodeStealer, a sophisticated info-stealer, has evolved to target new information and employ advanced…

9 hours ago

XSS Vulnerability in Bing.com Let Attackers Send Crafted Malicious Requests

A significant XSS vulnerability was recently uncovered in Microsoft’s Bing.com, potentially allowing attackers to execute…

12 hours ago

Meta Removed 2 Million Account Linked to Malicious Activities

 Meta has announced the removal of over 2 million accounts connected to malicious activities, including…

15 hours ago

Veritas Enterprise Vault Vulnerabilities Lets Attackers Execute Arbitrary Code Remotely

Critical security vulnerability has been identified in Veritas Enterprise Vault, a widely-used archiving and content…

16 hours ago

7-Zip RCE Vulnerability Let Attackers Execute Remote Code

A critical security vulnerability has been disclosed in the popular file archiving tool 7-Zip, allowing…

17 hours ago