Now that containers have been around for a few years and have had their share of disclosed vulnerabilities, it’s time to revisit some of the more interesting ones and see if there’s a recurring theme or any underlying trend to highlight.
We found some of the more severe CVEs disclosed during 2017-2019 that affected the container ecosystem and listed them below. For details on each CVE, continue reading.
CVE | Description | Affected System |
CVE-2017-1002101 | subPath Volume Mount Vulnerability | Docker |
CVE-2017-16995 | eBPF Vulnerability | Linux |
CVE-2018-1002105 | Severe Privilege Escalation Vulnerability | Kubernetes |
CVE-2018-8115 | Windows Host Compute Service Shim (hcsshim) | Windows |
CVE-2018-11757 | Docker Skeleton Runtime Vulnerability | Docker |
CVE-2018-1000056 | Jenkins JUnit Plugin Vulnerability | Jenkins |
CVE-2019-1002100 | API Server Patch Permission DoS Vulnerability | Kubernetes |
CVE-2019-5736 | High Severity RunC Vulnerability | Docker |
CVE-2019-1003065 | Jenkins CloudShare Docker-Machine Plugin Vulnerability | Jenkins |
What Can We Learn from Vulnerabilities?
These CVEs demonstrate that key components in the toolchain and the stack, if vulnerable, can affect a containerized application. It’s not just the container code itself, or the container engine that may affect your security posture, but rather many elements across the stack.
These components may include:
- The host OS (Linux) and its kernel
- Jenkins, Docker, or any other tool involved in the process of building containers
- Kubernetes, and especially its API server, which is the control point of the entire cluster
Additionally, anything you put inside a container image that is vulnerable might affect your application. Code vulnerabilities inside containers can also, potentially, have a detrimental effect on the host and the cluster. This is especially the case when combined with other CVEs, or with bad practices, such as running with root privileges.
Security by Design
In addition to the shift-left approach of dealing with security issues early in the design phase before deployment and monitoring applications in runtime, I suggest using these Aqua tools to check for vulnerabilities:
- MicroScanner: A free tool used for scanning your container images for package vulnerabilities. If the MicroScanner finds a high-severity vulnerability, it returns a non-zero exit code (as well as reporting the details in JSON format), and that in turn fails the image build.
- Kube-Hunter: An open-source tool that hunts for Kubernetes security issues in your clusters. It was designed to increase awareness and visibility of the security controls in Kubernetes environments.
- Kube-Bench: An open-source tool that will help you configure your cluster more securely so that CVEs may have less impact. You can run it on each of your nodes to establish how well your deployment meets the best practice recommendations from the CIS community. Not only do you get information about whether each test passes or fails, but you also get advice on how to remediate any issues that have been detected.
There’s no way to prevent vulnerabilities entirely. Software has always had flaws and will continue to have them. However, we can take proactive measures to reduce their proliferation in containerized applications. We can practice security by design, both before deployment and during runtime, as an attempt to keep vulnerabilities at bay so they will occur with less frequency and have less impact.
Container Vulnerabilities and MitigationsCVE-2017-1002101: subPath Volume Mount VulnerabilityThis vulnerability allows containers using subPath volume mounts to access files or directories outside of the volume, including the host’s file system. Mitigation An update is now available for Red Hat OpenShift Container Platform 3.7, 3.6, 3.5, 3.4, and 3.3. CVE-2017-16995: eBPF VulnerabilityThis vulnerability is related to a set of security vulnerabilities in the eBPF verifier. The verifier is crucial in determining if an eBPF program is safe. It checks that the eBPF program meets certain requirements. Mitigation The immediate step is to update your Linux version if a patch is available. CVE-2018-1002105: Severe Privilege Escalation Vulnerability in KubernetesThis vulnerability allows an unauthenticated user to perform privilege escalation and gain full admin privileges on a cluster. After a remote user exploits this vulnerability and gains admin privileges, he can take ownership of a cluster. He could perform malicious actions such as injecting malicious code into containers to exfiltrate data, mine for cryptocurrencies, or access secrets. Mitigation
You can run Kube-Hunter on your network to discover whether your infrastructure is exposed to this vulnerability. It is used to discover all Kubernetes nodes in the network and to run automated penetration testing based on known vulnerabilities and exploitation techniques. CVE-2018-8115: Windows Host Compute Service Shim (hcsshim)In the Mitigation SCAN-CVE-2018-8115 is available on GitHub › CVE-2018-11757: Docker Skeleton Runtime VulnerabilityIn Docker Skeleton Runtime for Apache OpenWhisk, a Docker action inheriting the Docker tag openwhisk/dockerskeleton:1.3.0 (or earlier) may allow an attacker to replace the user function inside the container if the user code is vulnerable to code exploitation. Mitigation Executable Python script for a proxy service to dockerSkeleton CVE-2018-1000056: Jenkins JUnit Plugin VulnerabilityJenkins is a popular CI tool which is often run inside of containers. It has a number of plugins, such as the Jenkins Junit. The Jenkins JUnit plugin can be affected by an XML External Entity (XXE) processing vulnerability. This allows an attacker to configure build processes such that JUnit plugin parses a maliciously crafted file that uses external entities for extraction of secrets from the Jenkins master, server-side request forgery, or denial-of-service attacks. Mitigation CVE-2019-1002100: Mitigating the Kubernetes API Server Patch Permission DoS VulnerabilityThis vulnerability, if exploited, could lead to a denial-of-service on the K8s API server, which in turn may lead to the cluster becoming inoperable. Mitigation CVE-2019-5736: High Severity RunC VulnerabilityThis vulnerability allows an attacker to potentially compromise the container host. The vulnerability allows a malicious container to overwrite the host runc binary and gain root-level code execution capability on the host. Mitigation CVE-2019-1003065: Jenkins CloudShare Docker-Machine Plugin VulnerabilityJenkins CloudShare Docker-Machine Plugin stores credentials unencrypted in its global configuration file on the Jenkins master where they can be viewed by users with access to the master file system. If exploited, an “attacker may leverage these issues to execute arbitrary script code in the browser of the victim in the context of the affected site, steal cookie-based authentication credentials, and gain access to sensitive information. This may aid in further attacks.” Mitigation Jenkins suggests this mitigation, CloudShare Docker-Machine Plugin stores credentials unencrypted in its global configuration file |