Kyverno ConfigMap Cross-Namespace Read RBAC Bypass (CVE-2026-22039 Incomplete Fix)
CVE-2026-22039 incompletely fixed a cross-namespace privilege escalation vulnerability in Kyverno's apiCall context, as the ConfigMap context loader still lacks namespace validation, allowing a namespace admin to read ConfigMaps from any namespace using Kyverno's privileged service account, leading to a complete RBAC bypass in multi-tenant Kubernetes clusters.
This brief addresses a critical vulnerability in Kyverno version 1.17.0 (and earlier) related to cross-namespace ConfigMap access, stemming from an incomplete fix for CVE-2026-22039. While the original CVE addressed privilege escalation in Kyverno’s apiCall context, the ConfigMap context loader (pkg/engine/context/loaders/configmap.go) still lacks namespace validation. This allows a namespace administrator to craft a Kyverno policy that reads ConfigMaps from any namespace, effectively bypassing RBAC controls. This vulnerability impacts multi-tenant Kubernetes clusters, particularly those running Azure Kubernetes Service (AKS) or other managed Kubernetes services using Kyverno. Exploitation requires a namespace admin to create a Kyverno Policy resource in their namespace. A successful exploit allows the attacker to exfiltrate sensitive data, such as database credentials and API keys, stored in ConfigMaps across the cluster.
Attack Chain
- An attacker with namespace admin privileges creates a service account and role binding within their assigned namespace.
- The attacker deploys a Kyverno
Policyresource within their namespace. This policy is crafted to exploit the vulnerability in the ConfigMap context loader. - The policy specifies
context.configMap.namespaceto target a ConfigMap in a different, victim namespace. This step leverages the lack of namespace validation inpkg/engine/context/loaders/configmap.go. - The policy includes a
mutaterule designed to extract data from the targeted ConfigMap and embed it into annotations of another ConfigMap within the attacker’s namespace. - The attacker triggers the policy by creating or modifying a ConfigMap (e.g.,
trigger-cm) in their own namespace. This triggers Kyverno’s admission controller. - Kyverno, running with a privileged service account (cluster-wide
viewrole), fetches the ConfigMap from the victim namespace based on the attacker’s policy. - The
mutaterule in the policy executes, copying the contents of the stolen ConfigMap data into annotations of the trigger ConfigMap. - The attacker retrieves the modified
trigger-cmConfigMap and extracts the exfiltrated secrets from the annotations.
Impact
Successful exploitation of this vulnerability allows a namespace administrator to bypass Kubernetes RBAC and read ConfigMaps from any namespace within the cluster. This can lead to the exfiltration of sensitive data such as database credentials, API keys, and other secrets stored in ConfigMaps. The impact is most severe in multi-tenant environments where namespace isolation is critical for security. This vulnerability affects any Kubernetes cluster running Kyverno v1.17.0 (and earlier) with namespace-scoped Policy creation enabled. A successful attack violates the principle of least privilege and breaks multi-tenancy guarantees.
Recommendation
- Deploy the Sigma rule
Detect Kyverno Policy Creating Cross-Namespace ConfigMap Contextto identify potentially malicious policies. - Apply the namespace validation fix suggested in the advisory to
configmap.NewConfigMapLoader(). Specifically, ensure the resolved namespace in the ConfigMap context matches the policy’s namespace (pkg/engine/context/loaders/configmap.go). - Audit other Kyverno context loaders (
globalReference,imageRegistry,variable) for similar missing namespace validation patterns. - Upgrade to a patched version of Kyverno as soon as it is released. Refer to the Kyverno release notes for the fix version.
Detection coverage 2
Detect Kyverno Policy Creating Cross-Namespace ConfigMap Context
highDetects Kyverno policies that attempt to read ConfigMaps from a different namespace, indicating a potential RBAC bypass attempt.
Detect ConfigMap Modification with Unusual Annotations
mediumDetects ConfigMap resources being modified with annotations containing suspicious keys, which could indicate data exfiltration.
Detection queries are kept inside the platform. Get full rules →