
If you run Kyverno to enforce admission policies in your cluster, two separate permission checks it relies on were both proven wrong this year — and either one on its own gets you from "I can create a Policy in my own namespace" to full cluster-admin.
That is the short version of a pair of bugs fixed in Kyverno 1.19.2. One lives in how Kyverno validates the apiCall field inside a policy. The other lives in how it checks who is allowed to use a generate rule. Neither needs you to compromise a node, steal a token, or find a misconfigured RBAC binding. Both just need a user who is already allowed to create one namespaced Policy object — a permission that, on a lot of clusters, is handed out far more casually than "edit ClusterRoleBindings."
What Kyverno actually checks, in one paragraph
Kyverno is a policy engine that runs as an admission webhook. You write a Policy or ClusterPolicy object describing a rule — validate, mutate, or generate — and Kyverno enforces it on every matching resource that hits the API server. Because Kyverno has to act on your behalf across the whole cluster, its own controller runs with broad permissions. The entire security model of a namespaced Policy rests on one assumption: that Kyverno will only ever use its own broad permissions to do what your rule, scoped to your namespace, actually says. Both bugs below are cases where that assumption did not hold.
Bug 1: the apiCall path escape (GHSA-3xfv-vq8x-qhg4, CVSS 9.9)
Kyverno policies can include an apiCall block that tells the controller to fetch extra data from the Kubernetes API (or an external service) and feed it into the policy logic. The urlPath you supply is supposed to be confined to resources Kyverno would reasonably need for that namespace. The flaw: Kyverno sanitized the path for the obvious case — a literal ../ segment — but did not catch a traversal sequence hidden behind a # fragment or a ? query separator before the string reached the API server's own router. The API server itself normalizes the path and happily resolves it to a cluster-scoped endpoint. Kyverno's own ServiceAccount, which already has the RBAC to touch cluster-scoped resources on behalf of the policy engine, makes that call. The namespace confinement was a client-side check Kyverno trusted; the server never agreed to it.
That lets a user who can only create a Policy object in team-a reach cluster-scoped objects such as MutatingWebhookConfiguration, or PolicyException objects inside the kyverno namespace itself. Either one is a path to cluster-admin: a crafted MutatingWebhookConfiguration can inject arbitrary changes into any resource cluster-wide, and a PolicyException in the kyverno namespace can be used to carve your own workloads out of every policy the cluster enforces, including whichever one is supposed to stop this exact kind of escalation.
Bug 2: the generate rule permission check
Separately, Kyverno's generate rules let a policy create new resources whenever a trigger resource is created or updated — the common use is generating a default NetworkPolicy or ResourceQuota every time a namespace shows up. The admission check that is supposed to gate this asks "is the entity performing this generate action allowed to create the target resource?" — but it answers that question by checking Kyverno's own generate-controller permissions, not the permissions of the user who authored the policy. A user with RBAC only to manage Policy objects in their own namespace could write a generate rule that creates resources they personally have no RBAC to create directly — including, depending on the target, resources that grant them privileges outside their namespace.
The common thread in both bugs: Kyverno has broad permissions so it can enforce policy across the cluster, and in both cases a boundary that was supposed to confine how those permissions got used on your behalf turned out to be enforced in the wrong place — client-side string matching in one case, the controller's own identity instead of the policy author's in the other.
A worked (illustrative) example of the traversal
This is not a live exploit string from the advisory — it is a simplified illustration of the shape of the bug, to make the mechanism concrete. A policy's apiCall.urlPath that looks harmless on a quick read:
apiVersion: kyverno.io/v1
kind: Policy
metadata:
name: looks-harmless
namespace: team-a
spec:
rules:
- name: fetch-context
match:
any:
- resources:
kinds: ["Pod"]
context:
- name: result
apiCall:
# Naive validation only blocks a literal ../ segment.
# Hiding it behind a fragment lets it survive that check,
# then get normalized back out by the API server's own router.
urlPath: "/api/v1/namespaces/team-a/pods#/../../../apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations"
method: GETA naive path-sanitizer that only looks for a literal ../ substring sees #/../../../apis/... and may treat everything after # as an opaque fragment — not a path segment to validate. The Kubernetes API server's HTTP router does not agree: it normalizes the full path, fragment included, before routing the request. The Policy creator in team-a never had RBAC to list mutatingwebhookconfigurations. Kyverno's own ServiceAccount does, and it is Kyverno's ServiceAccount that makes the call.
How to check if you are exposed
# What version is actually running?
kubectl get deployment kyverno -n kyverno \
-o jsonpath='{.spec.template.spec.containers[0].image}'
# Or, if you installed via Helm:
helm list -n kyverno
helm get values kyverno -n kyverno | grep -i appVersionAnything before 1.19.2 is affected by the apiCall path issue; the generate-rule permission check was fixed in the same release. If you cannot upgrade immediately, two mitigations buy you time:
- Tighten who can create
Policy/ClusterPolicyobjects at all — treat that RBAC verb as cluster-admin-adjacent until you are patched, because that is what it now effectively is. - Audit existing
MutatingWebhookConfigurationandPolicyExceptionobjects for anything you do not recognize creating. A webhook config or exception nobody on the team remembers writing is the signature this leaves behind.
Upgrade to 1.19.2 or later, then re-run that version check. Kyverno gives you a lot of leverage over your whole cluster by design — which is exactly why the checks that are supposed to confine that leverage to what a namespaced policy author actually asked for need to hold up end to end, not just against the obvious attack string.

Experienced DevOps Engineer proficient in Python, Docker, Kubernetes, CI/CD, and cloud technologies. Specialized in automating processes and building scalable infrastructure for seamless development and deployment.


