Notice on the Kubernetes kubelet and kube-proxy Authorization Vulnerability (CVE-2020-8558)
Kubernetes officially disclosed that kube-proxy, a core component, has a localhost boundary bypass vulnerability (CVE-2020-8558). With this vulnerability, attackers, through containers in the same LAN, can reach TCP and UDP services bound to 127.0.0.1 running on the node or in the node's network namespace, to obtain interface information. If a service on the port requires no additional authentication, the service is vulnerable to attacks.
Therefore, we kindly remind kube-proxy users to arrange self-check and implement timely security hardening.
For details, visit https://github.com/kubernetes/kubernetes/issues/92315.
Vulnerability Details
A security vulnerability was detected in kube-proxy, which allows adjacent hosts (hosts running in the same LAN or layer 2 domain) to access the TCP and UDP services bound to 127.0.0.1 running on the node. For example, if a cluster administrator runs a TCP service on a node that listens on 127.0.0.1:1234, because of this security vulnerability, the TCP service may be accessed by other hosts in the same LAN as the node or by containers running on the same node as the service. If the TCP service on port 1234 did not require additional authentication (because it assumed that only other localhost processes could reach it), the service could be vulnerable to attacks that use this security vulnerability.
| Vulnerability Type | CVE-ID | Discovered |
|---|---|---|
| Code injection | 2020-07-08 |
Threat Severity
Important: when the API Server enables insecure port (8080 by default)
Moderate: when the API Server disables the insecure port
There are four threat severities: low, moderate, important, and critical.
Affected Versions
The following kube-proxy versions are affected by this vulnerability:
- kube-proxy v1.18.0–v1.18.3
- kube-proxy v1.17.0–v1.17.6
- All kube-proxy versions earlier than v1.16.10
The CCE cluster control plane is protected by security groups, and CCE clusters can be accessed from tenant nodes or adjacent nodes through secure ports.
System components on cluster nodes listen on the port mapping to 127.0.0.1. This port is only used for health check and monitoring information query, which will not cause information leakage.
In conclusion, this vulnerability has little impact on CCE clusters.
Impact
If an attacker can configure the host network or runs containers with CAP_NET_RAW, the attacker can obtain the socket information of the service that listens on 127.0.0.1 on the target host. If the target host runs an exposed service that can be accessed from 127.0.0.1 without any further authentication, the service information can be obtained by the attacker. For details, see Placeholder issue.
Possible attackers can be:
- Other pods sharing a host in the same switch
- Running container of the local host
Vulnerability Handling
Secure versions have been provided with this vulnerability fixed. If your service version falls into the affected range, upgrade it to a secure version.
Preventive Measures
You are advised to take the following security measures:
- If your service container needs to use the host network mode and listen on an insecure port, you can manually add an iptables rule on nodes. Run the following command to configure an iptables rule in clusters to reject traffic to 127.0.0.1 which does not originate on the nodes.
iptables -I INPUT --dst 127.0.0.0/8 ! --src 127.0.0.0/8 -m conntrack ! --ctstate RELATED,ESTABLISHED,DNAT -j DROP
If your cluster needs not to enable the API Server insecure port, add the --insecure-port=0 flag to your Kubernetes API Server command line to disable the insecure port.
- If your cluster runs an untrusted container, run the following command to disable CAP_NET_RAW in the manifest file:
securityContext: capabilities: drop: ["NET_RAW"]
Before fixing vulnerabilities, use CSBS to back up your files and conduct a thorough test.
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.