Kyverno Service Account Token Leak via apiCall Servicecall Helper
A vulnerability in Kyverno versions prior to 1.16.4 allows the Kyverno service account token to be sent to an attacker-controlled endpoint due to improper authorization header handling in the apiCall servicecall helper, affecting ClusterPolicy and global context usage.
CVE search metadata
CVE search record: CVE-2026-40868. Severity: high. CVSS: 8.1. KEV: no. Brief: Kyverno Service Account Token Leak via apiCall Servicecall Helper. Brief link: https://feed.craftedsignal.io/briefs/2026-04-21-kyverno-token-leak/
Triage facts
Revision 2- Evidence
- Unknown
- Severity
- High
- Sources
- 1 public source
- Freshness
- Revision 2Apr 21, 19:16 UTC
- Detection
- 2 rules
- Vulnerabilities
- 1 CVE
Revision history 1 entry · Revision 2
- Revision 2
Repaired a legacy canonical identity collision
Changed: slug
Kyverno, a policy engine for cloud native platforms, is vulnerable to a confused deputy issue affecting versions prior to 1.16.4. The vulnerability stems from the apiCall servicecall helper's behavior of implicitly injecting an Authorization: Bearer ... header using the Kyverno controller service account token when a policy does not explicitly define an Authorization header. Since context.apiCall.service.url is controlled by the policy, an attacker can craft a malicious ClusterPolicy or leverage the global context to direct the Kyverno service account token to an attacker-controlled endpoint, potentially allowing for privilege escalation or unauthorized access to resources within the Kubernetes cluster. Namespaced policies are protected by the namespaced urlPath gate, limiting the scope to ClusterPolicy and global context. This issue is resolved in Kyverno version 1.16.4.
Attack Chain
- Attacker crafts a malicious Kyverno
ClusterPolicyor modifies global context data. - The malicious policy or global context configures
context.apiCall.service.urlto point to an attacker-controlled endpoint. - The crafted policy triggers an API call using the
apiCallservicecallhelper. - The
apiCallhelper checks for an existingAuthorizationheader in the policy definition. - Finding no explicit
Authorizationheader, theapiCallhelper implicitly injectsAuthorization: Bearer <kyverno-service-account-token>. - The API call, including the Kyverno service account token, is sent to the attacker-controlled endpoint defined in
context.apiCall.service.url. - Attacker captures the Kyverno service account token from the received API call.
- Attacker uses the stolen Kyverno service account token to authenticate to the Kubernetes API and perform unauthorized actions.
Impact
Successful exploitation of this vulnerability allows an attacker to steal the Kyverno service account token. This token can then be used to impersonate the Kyverno controller and perform actions with its privileges within the Kubernetes cluster. The severity is rated high due to the potential for privilege escalation and unauthorized access to sensitive resources within the cluster. While the precise number of affected installations isn't specified, any Kyverno deployment prior to version 1.16.4 using ClusterPolicy or global context is potentially vulnerable.
Recommendation
- Upgrade Kyverno to version 1.16.4 or later to patch CVE-2026-40868.
- Implement network policies to restrict outbound connections from the Kyverno controller pod to only trusted endpoints to limit the impact if the token is leaked.
- Monitor Kubernetes audit logs for unusual API calls originating from the Kyverno service account, focusing on requests to external or untrusted endpoints (monitor via generic k8s audit logs).
Detection coverage 2
Detect Kyverno Policy Creation with Suspicious apiCall URL
highDetects the creation of Kyverno policies that define an apiCall with a suspicious URL, potentially leading to token leakage.
Detect Kyverno Policy Update with Suspicious apiCall URL
highDetects updates to Kyverno policies that modify an apiCall to use a suspicious URL, potentially leading to token leakage.
Detection queries are available on the platform. Get full rules →