Kyverno Unvalidated CEL Namespace Argument Vulnerability
A vulnerability in Kyverno v1.18.0 and v1.18.1 allows a namespace-scoped user to execute arbitrary resource creation across the entire cluster by exploiting an unvalidated namespace argument in CEL expressions.
CVE search metadata
CVE search record: CVE-2026-54523. Severity: critical. CVSS: 9.6. KEV: no. Product: Kyverno (v1.18.0, v1.18.1). Brief: Kyverno Unvalidated CEL Namespace Argument Vulnerability. Brief link: https://feed.craftedsignal.io/briefs/2026-08-kyverno-cel-vulnerability/
Kyverno versions v1.18.0 and v1.18.1 contain a critical security vulnerability (CVE-2026-54523) where the generator.apply() function, accessible via CEL (Common Expression Language) expressions in NamespacedMutatingPolicy, fails to validate the target namespace argument. This allows an attacker with sufficient permissions to create a NamespacedMutatingPolicy within their own namespace to force the Kyverno admission controller to generate resources - such as ConfigMaps, Secrets, or RoleBindings - in any other namespace, including highly sensitive ones like kube-system.
Because the admission controller executes these operations with cluster-wide privileges, an attacker can effectively bypass Kubernetes namespace isolation. The root cause is the lack of namespace scope enforcement in pkg/cel/policies/mpol/validate.go, leaving the generator.apply() function susceptible to cross-namespace resource injection during admission processing.
Attack Chain
- Attacker obtains
createpermissions onnamespacedmutatingpolicies.policies.kyverno.iowithin a non-privileged namespace (e.g.,tenant-ns). - Attacker crafts a malicious
NamespacedMutatingPolicyobject targeting standard resources like ConfigMaps. - Attacker inserts a
matchConditionsblock containing a CEL expression that invokesgenerator.apply("target-namespace", [resources]). - Attacker specifies a sensitive destination namespace (e.g.,
kube-system) as the first argument in thegenerator.applyfunction. - Attacker creates a legitimate resource (e.g., a ConfigMap) in
tenant-nsto trigger the Kyverno admission webhook. - The admission controller parses the
NamespacedMutatingPolicyand executes thegenerator.applyfunction at request time. - The controller, operating with cluster-wide service account privileges, creates the attacker-defined resource in the target namespace.
- Final objective is achieved, such as injecting malicious configuration, disrupting network policy, or escalating privileges via unauthorized RoleBinding creation.
Impact
Successful exploitation allows for full namespace breakout and privilege escalation within the Kubernetes cluster. An attacker can inject unauthorized configuration into protected namespaces, modify network traffic flow via NetworkPolicies, or create elevated RoleBindings to gain persistent administrative access. Any Kubernetes cluster running Kyverno v1.18.0 or v1.18.1 that permits non-admin users to manage NamespacedMutatingPolicy resources is vulnerable to complete compromise.
Recommendation
- Immediately upgrade Kyverno to a patched version that enforces namespace validation for the
generatorlibrary. - Audit all existing
NamespacedMutatingPolicyobjects formatchConditionsblocks containinggenerator.apply()calls. - Restrict RBAC permissions for creating
NamespacedMutatingPolicyresources to highly trusted service accounts or cluster administrators until the patch is applied. - Implement Admission Controller logging to monitor for resource creation events originating from
NamespacedMutatingPolicytriggers in sensitive namespaces.