Skip to content
Threat Feed
high advisory

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
  1. 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

  1. Attacker crafts a malicious Kyverno ClusterPolicy or modifies global context data.
  2. The malicious policy or global context configures context.apiCall.service.url to point to an attacker-controlled endpoint.
  3. The crafted policy triggers an API call using the apiCall servicecall helper.
  4. The apiCall helper checks for an existing Authorization header in the policy definition.
  5. Finding no explicit Authorization header, the apiCall helper implicitly injects Authorization: Bearer <kyverno-service-account-token>.
  6. The API call, including the Kyverno service account token, is sent to the attacker-controlled endpoint defined in context.apiCall.service.url.
  7. Attacker captures the Kyverno service account token from the received API call.
  8. 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

high

Detects the creation of Kyverno policies that define an apiCall with a suspicious URL, potentially leading to token leakage.

sigma tactics: credential_access techniques: T1552.006 sources: k8s_audit, kubernetes

Detect Kyverno Policy Update with Suspicious apiCall URL

high

Detects updates to Kyverno policies that modify an apiCall to use a suspicious URL, potentially leading to token leakage.

sigma tactics: credential_access techniques: T1552.006 sources: k8s_audit, kubernetes

Detection queries are available on the platform. Get full rules →