/

CVE-2026-41068

Severity:

HIGH RISK

(7.7)

Improper Authorization in Kyverno ConfigMap Context Loader

CVE-2026-41068

Analyzed

Vulnerability type

Category:

Improper Authorization

CWE:

CWE-863

Impact:

Cross-Namespace Privilege Escalation and RBAC Bypass

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Kyverno's ConfigMap context loader incorrectly trusts the configMap.namespace field without validating it, allowing policies to reference ConfigMaps in any namespace.

In multi-tenant Kubernetes clusters, a namespace admin can abuse Kyverno's privileged service account to read ConfigMaps from other namespaces, effectively bypassing RBAC and cross-namespace isolation.

Affected context

This vulnerability appears in Kyverno deployments where:

  • Kyverno runs with a service account that has elevated or cluster-wide permissions to read ConfigMaps.
  • Policies make use of the "ConfigMap context" feature to load external data into policy evaluations.
  • Multiple tenants or teams share a Kubernetes cluster and rely on namespaces plus RBAC for isolation.

Under these conditions, a namespace administrator who can create or modify Kyverno policies or resources that use the ConfigMap context can target arbitrary namespaces via the unvalidated configMap.namespace field.

Exploit preconditions

  • Attack surface: Kyverno policy definitions and associated resources that use the ConfigMap context.
  • Required access: Ability to create, update, or control Kyverno policies or resources in at least one namespace (typically namespace admin or higher).
  • Trigger point: Evaluation of a Kyverno policy that loads data from a ConfigMap via the context loader.
  • Why exploitation is possible: The configMap.namespace field is accepted as-is, with no validation or enforcement that it matches the caller's namespace or RBAC scope. Kyverno's privileged service account then performs the ConfigMap read, effectively lending its broader permissions to the attacker-controlled policy.

Why this happens

The underlying issue is an improper authorization check when resolving ConfigMaps referenced in Kyverno's context loader.

Instead of deriving the accessible namespace from the requesting workload or enforcing RBAC-aligned constraints, the implementation trusts a user-controlled field (configMap.namespace) to decide where to read from.

This aligns with CWE-863: Improper Authorization, where the system performs a security-sensitive operation (ConfigMap read) using privileged credentials without verifying that the requester is authorized to access the chosen namespace.

Conceptually, the bug is an elevation-of-privilege pattern: a shared, highly privileged service account is used to service requests that are parameterized by user-controlled input, but the parameters are not constrained by the user's true permissions or tenancy boundaries.

Potential impact

  • A namespace admin may read ConfigMaps from other namespaces, including those intended for different tenants or system components.
  • Sensitive configuration data, such as API keys, database connection strings, or internal endpoints stored in ConfigMaps, could be exposed.
  • Cross-tenant data leakage may occur in multi-tenant clusters that rely on namespaces and RBAC for isolation.
  • Attackers could combine leaked configuration with other weaknesses to pivot further into the cluster or external systems.
  • Compliance and data governance controls may be undermined due to unauthorized access to supposedly isolated configuration data.

General mitigation guidance

Defenses focus on restoring a strict mapping between what a namespace admin can request via Kyverno and what the underlying Kubernetes API should allow:

  • Apply least-privilege to Kyverno's service account, restricting cross-namespace ConfigMap read permissions wherever possible.
  • Constrain or design policies so that the namespace used for ConfigMap lookups is derived from the resource's own namespace or another trusted context, not from an arbitrary user-supplied value.
  • Introduce explicit authorization checks in the policy engine's context loaders to ensure that referenced namespaces are either:
  • The same as the requesting namespace, or
  • Part of a small, controlled allowlist intended for shared configuration.
  • Architect policies to minimize reliance on sensitive data in ConfigMaps and segregate highly sensitive material into more tightly controlled mechanisms (e.g., secret managers with fine-grained policy).
  • In multi-tenant environments, adopt clear tenant boundaries in both RBAC and policy design, ensuring that shared tools like Kyverno cannot cross those boundaries without explicit governance.

How teams detect issues like this

Detection approaches should aim to identify both vulnerable patterns in code/policies and suspicious usage at runtime:

  • Policy review: Manually and systematically review Kyverno policies for usage of the ConfigMap context where configMap.namespace is set to a value different from the policy's namespace or is user-controlled.
  • Static analysis / linting: Use policy linters or custom CI checks that flag:
  • Any policy where the namespace for a ConfigMap context is hardcoded to another tenant's namespace.
  • Any policy that allows interpolation of untrusted values into configMap.namespace.
  • RBAC auditing: Periodically inspect Kyverno's service account permissions to detect unnecessary cluster-wide or cross-namespace ConfigMap read access.
  • Runtime monitoring: Enable API server audit logs and create queries or detectors that:
  • Identify ConfigMap get/list calls originating from Kyverno's service account targeting unexpected namespaces.
  • Surface patterns where a single service account regularly reads configuration from many tenants' namespaces.
  • Automated tooling: Integrate policy-as-code scanning tools in the development pipeline to enforce organization-wide rules around cross-namespace ConfigMap access.

Sources

SourceLink
github.comgithub.com/kyverno/kyverno/commit/bbf3e5c01391d612968440659028ae98e565a777
github.comgithub.com/kyverno/kyverno/security/advisories/GHSA-cvq5-hhx3-f99p

Frequently asked

questions

Exploitability is significant in clusters where Kyverno runs with broad ConfigMap read permissions and namespace administrators can define or control Kyverno policies. In such environments, any tenant with namespace-admin capabilities can potentially access configuration data from other namespaces.

No. The attacker typically only needs admin-level control over a single namespace that is governed by Kyverno. They exploit Kyverno's privileged service account indirectly via the unvalidated configMap.namespace field.

The safest pattern is to remove trust from user-controlled namespace parameters and instead derive the effective namespace from the authenticated context (such as the resource's namespace) while strictly limiting the policy engine's own privileges. Any cross-namespace access should be explicitly constrained and justified, not driven by arbitrary input.

Treat policy engines and controllers as high-value components: design them under a zero-trust mindset, ensure they do not make authorization decisions solely based on user-supplied parameters, and regularly subject them to security reviews. Enforce least-privilege RBAC for their service accounts, implement validation rules for any field that can influence access scope, and include automated checks in CI to detect cross-namespace or privilege-expanding patterns before deployment.

Find out what's already
exploitable in your codebase.