Skip to content

Kubernetes “spec.externalIPs is deprecated” and CVE-2020-8554

Securitytested on RKE2-Cluster mit drei VMs, Kyverno

The warning when creating a service with externalIPs is more than a hint about an old API: through this field anyone who may create services can redirect traffic for arbitrary IP addresses to their service. No update fixes this CVE – only admission control.

Symptom

Warning: spec.externalIPs is deprecated and may no longer be implemented in some clusters
Error from server: error when creating "STDIN": admission webhook "vpol.validate.kyverno.svc-fail"
denied the request: Policy no-external-ips failed: Service.spec.externalIPs ist verboten
(CVE-2020-8554)

After the mitigation a service with externalIPs is rejected (“ist verboten” = “is forbidden”); without the policy it would have been created.

Diagnosis

The policy checks on CREATE and UPDATE of services that externalIPs is empty.

validations:
  - expression: "!has(object.spec.externalIPs) || size(object.spec.externalIPs) == 0"
    message: "Service.spec.externalIPs ist verboten (CVE-2020-8554)"

Causes

CVE-2020-8554A legitimate API field as an attack path

Every node's kube-proxy redirects traffic for the listed IPs to the service – including services outside the cluster. Anyone with create services can do this, cluster-wide.

DeprecationNewer versions push the field back

The warning shows the direction but does not protect you. Do not rely on it – forbid the field actively.

Fix

Forbid externalIPs with an admission policy (in the course the Kyverno ValidatingPolicy no-external-ips). Normal services keep working:
kubectl -n cve create deployment web --image=nginxinc/nginx-unprivileged:stable
kubectl -n cve expose deployment web --port=80
kubectl -n cve get svc web -o jsonpath='{.spec.type}'; echo
ClusterIP

Don't: Do not ignore the warning because the service was created anyway – that is exactly the hole.

▶
Break it yourself and find it – free
Attacking and securing Kubernetes, Day 13: case study CVE-2020-8554 – closing a CVE no patch fixes with an admission policy.
Go to day 13 →

FAQ

Does this affect LoadBalancer services too?

Yes, a LoadBalancer's status IP can be abused as well; that is why only the controller should set the status.

Do I need Kyverno for this?

No, any admission solution works, including a built-in ValidatingAdmissionPolicy with the same CEL condition.

Related error patterns

More