{"id":"CVE-2026-40868","aliases":["CVE-2026-40868","GHSA-q93q-v844-jrqp","BIT-KYVERNO-2026-40868","GO-2026-5575"],"related":[],"kind":"vulnerability","state":"published","title":"kyverno apicall servicecall implicit bearer token injection leaks kyverno serviceaccount token","summary":"Kyverno is a policy engine designed for cloud native platform engineering teams. Prior to 1.16.4, kyverno’s apiCall servicecall helper implicitly injects Authorization: Bearer ... using the kyverno controller serviceaccount token when a policy does not explicitly set an Authorization header. Because context.apiCall.service.url is policy-controlled, this can send the kyverno serviceaccount token to an attacker-controlled endpoint (confused deputy). Namespaced policies are blocked from servicecall usage by the namespaced urlPath gate in pkg/engine/apicall/apiCall.go, so this report is scoped to ClusterPolicy and global context usage. This vulnerability is fixed in 1.16.4.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Kyverno is a policy engine designed for cloud native platform engineering teams. Prior to 1.16.4, kyverno’s apiCall servicecall helper implicitly injects Authorization: Bearer ... using the kyverno controller serviceaccount token when a policy does not explicitly set an Authorization header. Because context.apiCall.service.url is policy-controlled, this can send the kyverno serviceaccount token to an attacker-controlled endpoint (confused deputy). Namespaced policies are blocked from servicecall usage by the namespaced urlPath gate in pkg/engine/apicall/apiCall.go, so this report is scoped to ClusterPolicy and global context usage. This vulnerability is fixed in 1.16.4.","source":"cvelist"},{"lang":"en","text":"kyverno’s apiCall servicecall helper implicitly injects `Authorization: Bearer ...` using the kyverno controller serviceaccount token when a policy does not explicitly set an Authorization header. because `context.apiCall.service.url` is policy-controlled, this can send the kyverno serviceaccount token to an attacker-controlled endpoint (confused deputy).\n\nnamespaced policies are blocked from servicecall usage by the namespaced `urlPath` gate in `pkg/engine/apicall/apiCall.go`, so this report is scoped to ClusterPolicy and global context usage.\n\n## attacker model\n\nthe attacker can create or update a ClusterPolicy (or create a GlobalContextEntry) which uses `context.apiCall.service.url` and can choose the request URL and headers. a cross-boundary framing for real deployments is gitops: if the policy repo/controller is compromised, the ClusterPolicy/global context entry becomes untrusted input to kyverno.\n\n## relevant links\n\n- repository: https://github.com/kyverno/kyverno\n- commit: 17aeb52337fd66adb0c8126213ba076612a287a7\n- callsite (token injection): https://github.com/kyverno/kyverno/blob/17aeb52337fd66adb0c8126213ba076612a287a7/pkg/engine/apicall/executor.go#L150-L173\n- namespaced policy gate (servicecall blocked): https://github.com/kyverno/kyverno/blob/17aeb52337fd66adb0c8126213ba076612a287a7/pkg/engine/apicall/apiCall.go#L67-L83\n\n## root cause\n\nin `(*executor).addHTTPHeaders`, kyverno reads the serviceaccount token from `/var/run/secrets/kubernetes.io/serviceaccount/token` and injects it when the outgoing request has no Authorization header:\n\n```go\nif req.Header.Get(\"Authorization\") == \"\" {\n  token := a.getToken()\n  if token != \"\" {\n    req.Header.Add(\"Authorization\", \"Bearer \"+token)\n  }\n}\n```\n\n## proof of concept\n\nthe attached `poc.zip` is a reproducible cluster PoC. it uses an in-cluster HTTP receiver which logs the Authorization header it receives. the PoC does not print token bytes; it only checks that the received header is non-empty and not equal to the negative control.\n\nrun (one command):\n\n```bash\nunzip poc.zip -d poc\ncd poc\nmake test\n```\n\ncanonical (expected: implicit token injection):\n\n```bash\nunzip poc.zip -d poc\ncd poc\nmake canonical\n```\n\nexpected output includes:\n\n```\n[CALLSITE_HIT]: executor.addHTTPHeaders Authorization==\"\" -> read_serviceaccount_token=true\n[PROOF_MARKER]: authorization_header_injected=true token_nonempty=true\n```\n\ncontrol (expected: explicit Authorization header disables auto-injection):\n\n```bash\nunzip poc.zip -d poc\ncd poc\nmake control\n```\n\nexpected output includes:\n\n```\n[CALLSITE_HIT]: executor.addHTTPHeaders Authorization!=\"\" -> autoinject_skipped=true\n[NC_MARKER]: authorization_header_injected=false\n```\n\noptional: the canonical run may also print an `[RBAC]: ...` line using `kubectl auth can-i` with the exfiltrated token, to show concrete privileges without exposing the token.\n\n## impact\n\ntoken exfiltration: the kyverno controller serviceaccount token is sent to a policy-controlled endpoint. impact depends on the rbac bound to that serviceaccount in the target deployment.\n\n## recommended fix\n\ndo not auto-inject the kyverno serviceaccount token into policy-controlled servicecall requests. require explicit Authorization configuration, or enforce a strict allowlist of destinations where credentials may be attached and document the behavior.\n\n## workarounds\n\n- avoid using servicecall to arbitrary urls in policies.\n- set an explicit Authorization header in servicecall policies to prevent implicit token injection.\n\n\n[poc.zip](https://github.com/user-attachments/files/25352288/poc.zip)\n[PR_DESCRIPTION.md](https://github.com/user-attachments/files/25352289/PR_DESCRIPTION.md)\n\noleh","format":"markdown","source":"ghsa"},{"lang":"en","text":"kyverno apicall servicecall implicit bearer token injection leaks kyverno serviceaccount token in github.com/kyverno/kyverno","format":"markdown","source":"go"},{"lang":"es","text":"Kyverno es un motor de políticas diseñado para equipos de ingeniería de plataformas nativas de la nube. Antes de la versión 1.16.4, el asistente apiCall servicecall de Kyverno inyecta implícitamente Authorization: Bearer ... utilizando el token de cuenta de servicio del controlador de Kyverno cuando una política no establece explícitamente un encabezado de autorización. Debido a que context.apiCall.service.url está controlado por políticas, esto puede enviar el token de cuenta de servicio de Kyverno a un endpoint controlado por un atacante (delegado confundido). Las políticas con espacio de nombres están bloqueadas para el uso de servicecall por la puerta urlPath con espacio de nombres en pkg/engine/apicall/apiCall.go, por lo que este informe se limita al uso de ClusterPolicy y contexto global. Esta vulnerabilidad se corrige en la versión 1.16.4.","source":"nvd"}],"published":"2026-04-14T20:09:00.000Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-441","CWE-922"],"affected":[{"ranges":[{"version":"< 1.16.4","status":"affected"}],"vendor":"kyverno","product":"kyverno","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.17.0"}],"ecosystem":"Go","package":"github.com/kyverno/kyverno","purl":"pkg:golang/github.com/kyverno/kyverno","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.17.0"}],"ecosystem":"Go","package":"github.com/kyverno/kyverno","purl":"pkg:golang/github.com/kyverno/kyverno","source":"go"},{"ranges":[{"status":"affected","fixed":"1.16.4"}],"vendor":"kyverno","product":"kyverno","cpe":"cpe:2.3:a:kyverno:kyverno:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.16.4"}],"ecosystem":"Bitnami","package":"kyverno","purl":"pkg:bitnami/kyverno","source":"bitnami"}],"references":[{"url":"https://github.com/kyverno/kyverno/security/advisories/GHSA-q93q-v844-jrqp","tags":["advisory","exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40868","tags":["advisory","web"],"sources":["ghsa","go","bitnami"]},{"url":"https://github.com/kyverno/kyverno","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-04-22T13:34:55.762Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40868","url":"https://www.cve.org/CVERecord?id=CVE-2026-40868","licence":"CVE Terms of Use","modified":"2026-04-22T13:35:50.296Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q93q-v844-jrqp","url":"https://github.com/advisories/GHSA-q93q-v844-jrqp","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:02.758Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5575","url":"https://pkg.go.dev/vuln/GO-2026-5575","licence":"CC-BY-4.0","modified":"2026-06-25T23:11:14.316Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40868","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40868","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-KYVERNO-2026-40868","url":"https://osv.dev/vulnerability/BIT-KYVERNO-2026-40868","licence":"Apache-2.0","modified":"2026-09-08T08:48:08.118Z"}],"updatedAt":"2026-11-25T22:59:19.132Z","epss":{"score":0.00295,"percentile":0.23775,"date":"2026-12-01T12:00:22.000Z"}}