More than 1,600 public Docker Hub images hide cryptocurrency miners, backdoors, DNS interceptors, and website redirectors.
Docker Hub is a cloud-based container library that allows developers to search and download Docker images or upload their creations to a public library or personal repositories.
Researchers at Sysdig have looked into the issue in an attempt to assess the extent of the problem and have reported images found that contain malicious code. Sysdig examined 250,000 unverified Linux images and identified 1,652 of them as malicious.
In the first place are cryptominers, found in 608 images that used server resources for cryptocurrency mining.
The second most common occurrence (281 images) was images that embedded “extra information” such as SSH keys, AWS credentials, GitHub tokens, NPM tokens, etc.
Sysdig notes that this data may have been left in public images by mistake or intentionally entered by an attacker. By embedding an SSH key or an API key in a container, a hacker can gain access to the system after the container is deployed.
Many malicious images with a built-in cryptominer used the "Typosquatting" technique to impersonate trusted images.
Sysdig reports that in 2022, 61% of all images pulled from Docker Hub will come from public repositories, up 15% from 2021, so the risk to users is increasing.
The size of the Docker Hub public library prevents its operators from checking all downloads on a daily basis, so many malicious files go unreported. Moreover, Sysdig noticed that most attackers download a couple of malicious images, so even if one image is removed and the bootloader is banned, this will not have a significant impact on the threat landscape.