Summary
A namespace-scoped user who can create a namespaced Policy in their own namespace can set a context.apiCall urlPath that hides ../ segments behind a URL fragment (#) or query (?) separator. Kyverno validates the fully cleaned path against the policy's namespace but executes the raw path; since the Kubernetes client discards fragment and query portions when resolving the URL, the request lands on any namespace or cluster-scoped endpoint the attacker chooses, executed with the admission controller's ServiceAccount. This is an incomplete fix of GHSA-5qq8-67g6-4h2w: the v1.19.1 patch closed the %2e%2e and ..%2f percent-encoded traversal vectors, but not this separator-hidden variant. Credit: Artem Cherezov.
Impact
The Kyverno admission controller's ServiceAccount can create MutatingWebhookConfiguration, ValidatingWebhookConfiguration, and PolicyException objects cluster-wide, which amounts to effective cluster administrator access. The preconditions are: an authenticated namespace-scoped user with create permission on policies.kyverno.io in their own namespace, and the ability to create any resource the policy matches (to trigger admission and fire the apiCall). This vulnerability was verified on Kyverno v1.19.1 installed from the Helm chart 3.9.1 with default values.
Detection
Inspect all namespaced Policy objects for context[].apiCall.urlPath values containing # or ? characters. If the string after # or ? contains /namespaces/, the policy may be exploiting this validator/executor mismatch. Monitor Kyverno admission controller logs for API calls issued to cluster-scoped endpoints (such as /api/v1/nodes, /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations) when the triggering policy is namespace-scoped.
Mitigation
Upgrade Kyverno to version 1.19.2 or later, which closes this separator-injection variant. No workaround was published in the upstream advisory. Until an upgrade is applied, restrict create permission on policies.kyverno.io to fully trusted users and audit existing Policy objects.
Related Security Guidance
References
- GHSA-3xfv-vq8x-qhg4 — GitHub Security Advisory