CVE-2020-26278 in Weave Net
Summary
by MITRE • 01/21/2021
Weave Net is open source software which creates a virtual network that connects Docker containers across multiple hosts and enables their automatic discovery. Weave Net before version 2.8.0 has a vulnerability in which can allow an attacker to take over any host in the cluster. Weave Net is supplied with a manifest that runs pods on every node in a Kubernetes cluster, which are responsible for managing network connections for all other pods in the cluster. This requires a lot of power over the host, and the manifest sets `privileged: true`, which gives it that power. It also set `hostPID: true`, which gave it the ability to access all other processes on the host, and write anywhere in the root filesystem of the host. This setting was not necessary, and is being removed. You are only vulnerable if you have an additional vulnerability (e.g. a bug in Kubernetes) or misconfiguration that allows an attacker to run code inside the Weave Net pod, No such bug is known at the time of release, and there are no known instances of this being exploited. Weave Net 2.8.0 removes the hostPID setting and moves CNI plugin install to an init container. Users who do not update to 2.8.0 can edit the hostPID line in their existing DaemonSet manifest to say false instead of true, arrange some other way to install CNI plugins (e.g. Ansible) and remove those mounts from the DaemonSet manifest.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 02/18/2021
CVE-2020-26278 represents a critical privilege escalation vulnerability within Weave Net, an open source container networking solution that facilitates virtual network connectivity across Docker containers spanning multiple hosts. This vulnerability stems from the overly permissive security configuration of Weave Net pods within Kubernetes clusters, specifically through the manipulation of daemonset manifest specifications that grant excessive host-level privileges. The flaw exists in versions prior to 2.8.0 where the Weave Net manifest configures pods with `privileged: true`, `hostPID: true`, and unrestricted root filesystem write access, creating a pathway for attackers to gain complete host control when combined with other exploitation vectors.
The technical implementation of this vulnerability involves the deployment of Weave Net pods across all cluster nodes through a daemonset configuration that intentionally provides elevated privileges for network management operations. The `hostPID: true` setting allows the pod to access and manipulate processes running on the host system, while the `privileged: true` flag enables complete access to host resources including filesystem mounts, network interfaces, and system calls. This configuration pattern violates the principle of least privilege and creates an attack surface that can be exploited when attackers gain initial access to the pod through secondary vulnerabilities. The vulnerability aligns with CWE-276, which addresses improper privileges, and demonstrates how container orchestration security misconfigurations can lead to complete system compromise. The presence of these permissions was unnecessary for the core functionality of the CNI plugin installation, making the privilege escalation both avoidable and dangerous.
The operational impact of this vulnerability extends beyond simple privilege escalation to encompass complete cluster compromise, as Weave Net pods are designed to manage network connections for all other pods in the cluster. This creates a scenario where an attacker who can execute code within any Weave Net pod gains the ability to monitor, modify, or disrupt network communications across the entire cluster. The vulnerability requires an initial foothold through secondary exploits or misconfigurations in the Kubernetes environment, such as unpatched API server vulnerabilities or insecure pod security policies. According to ATT&CK framework, this represents a privilege escalation technique under T1068 and lateral movement through T1059.003, as attackers can leverage the compromised pod to establish persistence and move laterally within the cluster environment. The risk is particularly elevated in environments where Kubernetes clusters lack proper security controls such as pod security policies, network segmentation, or restricted service account permissions.
The remediation approach for CVE-2020-26278 involves upgrading to Weave Net version 2.8.0, which removes the unnecessary `hostPID: true` setting and implements proper CNI plugin installation through init containers instead of direct host filesystem manipulation. Organizations unable to immediately upgrade can manually modify existing daemonset manifests by setting `hostPID: false` and implementing alternative CNI plugin installation methods such as Ansible or other configuration management tools. This vulnerability highlights the importance of regular security auditing of container orchestration configurations and adherence to security best practices including the principle of least privilege, proper pod security policies, and comprehensive vulnerability management. The fix addresses the root cause by eliminating unnecessary host-level access while maintaining functional network capabilities, demonstrating how security improvements can be achieved without compromising essential operational requirements. Organizations should also implement monitoring for unauthorized daemonset modifications and establish security policies that prevent the deployment of privileged containers with excessive host access permissions.