IBM Support

Security Bulletin: IBM Cloud Kubernetes Service is affected by an endpoint resource security design flaw in Kubernetes (CVE-2021-25740)

Security Bulletin


Summary

IBM Cloud Kubernetes Service is affected by an endpoint resource security design flaw in Kubernetes. If a potential attacker can create or edit Endpoints or EndpointSlices in the Kubernetes API, they can potentially direct a LoadBalancer or Ingress implementation to expose backend IPs the attacker should not have access to (CVE-2021-25740).

Vulnerability Details

CVEID: CVE-2021-25740
Description: Kubernetes could allow a remote authenticated attacker to obtain sensitive information, caused by a confused deputy attack. By sending a specially-crafted request to create or edit Endpoints or EndpointSlices in the Kubernetes API, an attacker could exploit this vulnerability to obtain backend IPs information, and use this information to launch further attacks against the affected system.
CVSS Base Score: 3.1
CVSS Temporal Score: https://exchange.xforce.ibmcloud.com/vulnerabilities/205570 for more information
CVSS Vector: (CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N)

Affected Products and Versions

IBM Cloud Kubernetes Service: All versions

Remediation/Fixes

This is a design flaw in Kubernetes that has not been fully mitigated.

Workarounds and Mitigations

Run the following command against your cluster to check if the mitigation has been applied. By default, IBM Cloud Kubernetes Service clusters created with version 1.22 or later have the mitigation. Clusters upgraded to version 1.22 or later are not automatically fixed.

kubectl get clusterrole system:aggregate-to-edit -o jsonpath='{.rules}' | grep endpoints

If the command output does not contain endpoints, then your cluster has the mitigation. No further action is required.

If the command output does contain endpoints, then continue with the mitigation steps.

Mitigation: All IBM Cloud Kubernetes Service versions

Remove the endpoints permission from the system:aggregate-to-edit cluster role.

kubectl edit clusterrole/system:aggregate-to-edit

Next, follow the appropriate instructions below based on your cluster version.

Mitigation: IBM Cloud Kubernetes Service versions 1.21 and earlier

Prevent Kubernetes from reconciling the permissions of the system:aggregate-to-edit cluster role.

kubectl annotate --overwrite clusterrole/system:aggregate-to-edit rbac.authorization.kubernetes.io/autoupdate=false

When you are ready to upgrade your cluster to version 1.22, be sure to follow 1.22 version information and update actions which provides instructions for allowing Kubernetes to reconcile permissions again.

Mitigation: IBM Cloud Kubernetes Service versions 1.22 and later

If your cluster does not require any customizations to the system:aggregate-to-edit cluster role, besides removing the endpoints permission, allow Kubernetes to reconcile the permissions.

kubectl annotate --overwrite clusterrole/system:aggregate-to-edit rbac.authorization.kubernetes.io/autoupdate=true

Monitor IBM Cloud Status for Future Security Bulletins

Monitor the security notifications on the IBM Cloud Status page to be advised of future security bulletins.

References

Off

*The CVSS Environment Score is customer environment specific and will ultimately impact the Overall CVSS Score. Customers can evaluate the impact of this vulnerability in their environments by accessing the links in the Reference section of this Security Bulletin.

Disclaimer

Review the IBM security bulletin disclaimer and definitions regarding your responsibilities for assessing potential impact of security vulnerabilities to your environment.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSJTBP","label":"IBM Cloud Kubernetes Service and Red Hat OpenShift on IBM Cloud"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB21","label":"Public Cloud Platform"}}]

Document Information

Modified date:
08 June 2022

UID

ibm16574821