CVE-2021-25740: Kubernetes confused deputy in Endpoints and EndpointSlices

CVE-2021-25740 · Severity: low · CVSS 3.1 · Published 2021-09-21

A design flaw in Kubernetes allows users with limited permissions to redirect network traffic to unauthorized locations. By manipulating specific API resources, an attacker could bypass security controls to access internal backend services or sensitive endpoints they should not be able to reach. This issue affects the fundamental way Kubernetes handles network routing and requires manual configuration changes to mitigate.

Technologies: k8s.io/kubernetes (Go), Kubernetes. Vendors: Go, Kubernetes.

Quick answers

Is CVE-2021-25740 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2021-25740 being exploited in the wild.
How severe is CVE-2021-25740?
Low severity, with a CVSS score of 3.1, published 21 September 2021.
Which products and versions are affected?
k8s.io/kubernetes (Go) <= 1.22.2, SEMVER:introduced=0,last_affected=1.22.2; Kubernetes <= 1.22.2.
Is there a fix for CVE-2021-25740?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2021-25740 attacked?
It is attacked over the network, in an operating system.
Am I affected by CVE-2021-25740?
Check whether you run k8s.io/kubernetes (Go) or Kubernetes at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A confused deputy vulnerability exists in Kubernetes due to the way Endpoint and EndpointSlice permissions are handled. Attackers with 'create' or 'edit' permissions for these resources can direct LoadBalancer or Ingress implementations to expose backend IPs that should be restricted. If the target's NetworkPolicy trusts the LoadBalancer or Ingress, this can bypass cross-namespace security controls and LoadBalancerSourceRanges. A similar attack vector exists for Ingress implementations that support forwarding to ExternalName Services. As this is a design flaw, no software patch is available; mitigation requires restricting write access to Endpoints and EndpointSlices by updating RBAC roles such as 'system:aggregate-to-edit'.

Affected products

  • Kubernetes Kubernetes <= 1.22.2

Identifiers

  • CVE-2021-25740
  • GHSA-vw47-mr44-3jf9

Timeline

  • 2021-07-14: disclosed: Issue opened on Kubernetes GitHub repository
  • 2021-09-20: advisory: NVD publication date
  • 2021-09-21: advisory: GitHub Advisory published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.