An analysis of 1,000 popular Docker containers revealed that nearly 20% of them have nulled root passwords, Kenna Security says.
The investigation rooted from a recent Talos report showing that the official Alpine Linux Docker images had been shipping with this security oversight since December 2015. Alpine has already addressed the vulnerability.
With a CVSS score of 9.8 and rated Critical, the issue was that, in the affected images, the /etc/shadow file had a blank field instead of the encrypted password, meaning that the system considered the root user as having no password.
“Due to the nature of this issue, systems deployed using affected versions of the Alpine Linux container that utilize Linux PAM, or some other mechanism that uses the system shadow file as an authentication database, may accept a NULL password for the root user,” Talos said.
Based on these findings, Jerry Gamblin, Principal Security Engineer, Kenna Security, decided to investigate whether other containers had null passwords too.
For that, he wrote a script to check the top 1,000 docker containers from the Docker store, and discovered that roughly 20% of had null root passwords.
Initially, the script found over 200 of these containers with nulled root passwords, but the results contained duplicate containers. A second run showed that 157 (19.75%) of 794 containers had null passwords for root.
After some tweaks, the script revealed that, of 1,000 containers, 194 (19.4%) were in the same situation.
The most popular container on the list is kylemanna/openvpn, with over 10,000,000 pulls. govuk/governmentpaas, hashicorp, microsoft, monsanto, and mesosphere are also on the list.
As Gamblin points out, these containers are not necessarily vulnerable, as other conditions must also be met for exploitation. In Alpine Linux’ case, the containers were only vulnerable if the shadow and linux-pam packages were installed.
“Just because a container has no root password does not mean that it is automatically vulnerable. These findings could lead to configuration-based vulnerabilities in certain situations, as was the case with this the Alpine Linux vulnerability,” the researchers notes.
To ensure that systems remain protected, one should avoid deploying containers that allow users to authenticate as root, as this is also outside the scope of ‘best practices’, Gamblin points out.
“All of which is to say that many people believe that containers offer more security because they extend the trend of virtualization. I’d say that this might be true, but […] there’s also a chance that containers could lead to unforeseen security concerns,” the researcher concludes.