Summary
Kyverno's apiCall service-call helper implicitly injects Authorization: Bearer <token> using the Kyverno controller's ServiceAccount token whenever a policy does not explicitly set an Authorization header. Because context.apiCall.service.url is fully policy-controlled, this design sends the Kyverno SA token to any endpoint the policy author specifies — a classic confused-deputy problem. Namespaced policies are blocked from service-call usage by the urlPath gate in pkg/engine/apicall/apiCall.go, so this issue is scoped to ClusterPolicy and global-context entries.
Impact
An attacker who can create or update a ClusterPolicy (or a GlobalContextEntry) that uses context.apiCall.service.url can direct the request URL to an attacker-controlled host and observe the implicitly injected Bearer token. A realistic path is a compromised GitOps policy repository: if the policy store is tampered with, the resulting ClusterPolicy becomes untrusted input that Kyverno executes with its own high-privilege SA. With the default Helm RBAC binding, the leaked token grants read and patch rights over admission webhook configurations, which is sufficient to subvert the entire admission layer.
Detection
Audit ClusterPolicy and GlobalContextEntry resources for apiCall.service.url values pointing outside the cluster — any URL lacking an .svc suffix or resolving to a public IP or external DNS name should be treated as a potential exfiltration sink. Pair this with audit-log review for patch operations against MutatingWebhookConfiguration and ValidatingWebhookConfiguration performed by the Kyverno admission controller's SA outside expected reconciliation windows.
Mitigation
Upgrade Kyverno to v1.17.0 or later. Until patched:
- Restrict who can create or update
ClusterPolicyandGlobalContextEntryresources via tight RBAC. - Audit all existing policies for
apiCall.service.urlvalues pointing outside the cluster; remove or relocate any external references. - After upgrading, rotate the Kyverno SA token if there is any reason to suspect a malicious policy was applied during the affected window.
Related Security Guidance
- Service Account Token Projection Abuse — how SA token exfiltration is exploited
- Securing Kubernetes Service Accounts — least-privilege SA configuration
- Kyverno — hardening Kyverno deployments