/

CVE-2026-122308

Severity:

HIGH RISK

(8.5)

Authorization Bypass (CWE-639) in Kyverno Generation

CVE-2026-122308

Undergoing Analysis

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-639

Impact:

Unauthorized disclosure of sensitive Secrets

Severity:

HIGH RISK

(8.5)

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 Generation Handler can treat a ConfigMap with spoofed internal labels as a trigger for a synchronized generate policy. A user who can create or update a ConfigMap may be able to cause sensitive Secrets to be copied from a restricted namespace into a namespace they control.

Kyverno's Generation Handler can treat a ConfigMap with spoofed internal labels as a trigger for a synchronized generate policy. A user who can create or update a ConfigMap may be able to cause sensitive Secrets to be copied from a restricted namespace into a namespace they control.

Affected context

The issue affects Kyverno deployments where the Generation Handler processes ConfigMaps for synchronized generate policies. It becomes risky when a user with create or update permissions can supply labels that the handler trusts as indicators of Kyverno-managed resources and policy triggers.

The issue affects Kyverno deployments where the Generation Handler processes ConfigMaps for synchronized generate policies. It becomes risky when a user with create or update permissions can supply labels that the handler trusts as indicators of Kyverno-managed resources and policy triggers.

Exploit preconditions

  • Attack surface: Kyverno's Generation Handler and ConfigMaps it processes
  • Required access: Permission to create or update a ConfigMap that reaches the handler
  • Trigger point: The handler evaluates labels on the ConfigMap for a synchronized generate policy
  • Why exploitation is possible: User-controlled labels can be made to resemble internal Kyverno metadata, potentially causing the handler to generate a Secret in the user's namespace
  • Attack surface: Kyverno's Generation Handler and ConfigMaps it processes
  • Required access: Permission to create or update a ConfigMap that reaches the handler
  • Trigger point: The handler evaluates labels on the ConfigMap for a synchronized generate policy
  • Why exploitation is possible: User-controlled labels can be made to resemble internal Kyverno metadata, potentially causing the handler to generate a Secret in the user's namespace

Why this happens

The authorization check relies on metadata labels that a user with ConfigMap write access may be able to set or alter. When those labels are trusted as proof that a resource is an authorized Kyverno trigger, a user can influence generation without the intended authorization. This is an authorization bypass through a user-controlled key, mapping to CWE-639.

The authorization check relies on metadata labels that a user with ConfigMap write access may be able to set or alter. When those labels are trusted as proof that a resource is an authorized Kyverno trigger, a user can influence generation without the intended authorization. This is an authorization bypass through a user-controlled key, mapping to CWE-639.

Potential impact

  • Sensitive Secrets may be copied from restricted namespaces into a namespace controlled by the requester
  • Credentials or other confidential data may be exposed to unauthorized users
  • Exposed credentials could enable further access to applications or infrastructure
  • Sensitive Secrets may be copied from restricted namespaces into a namespace controlled by the requester
  • Credentials or other confidential data may be exposed to unauthorized users
  • Exposed credentials could enable further access to applications or infrastructure

General mitigation guidance

Defensive approaches generally focus on separating trusted controller metadata from user-controlled input and enforcing authorization independently of labels.

  • Verify the source and ownership of trigger resources rather than treating labels alone as proof of trust.
  • Apply explicit authorization checks before generating or synchronizing sensitive resources.
  • Restrict which users and workloads can create or update resources processed by generation handlers.
  • Use least-privilege policies for service accounts and limit which namespaces and Secret types policies can access.
  • Prefer secure-by-default policy designs that avoid copying secrets across trust boundaries unless explicitly authorized.

Defensive approaches generally focus on separating trusted controller metadata from user-controlled input and enforcing authorization independently of labels.

  • Verify the source and ownership of trigger resources rather than treating labels alone as proof of trust.
  • Apply explicit authorization checks before generating or synchronizing sensitive resources.
  • Restrict which users and workloads can create or update resources processed by generation handlers.
  • Use least-privilege policies for service accounts and limit which namespaces and Secret types policies can access.
  • Prefer secure-by-default policy designs that avoid copying secrets across trust boundaries unless explicitly authorized.

How teams detect issues like this

  • Review generation-handler code and policies for authorization decisions based solely on user-editable labels.
  • Use static analysis and code review checks to identify trust decisions made from mutable metadata.
  • Audit ConfigMap create and update events for Kyverno-related labels, especially when followed by Secret generation in another namespace.
  • Enforce policy checks that restrict cross-namespace Secret generation and validate the identity and authorization of trigger resources.
  • Review generation-handler code and policies for authorization decisions based solely on user-editable labels.
  • Use static analysis and code review checks to identify trust decisions made from mutable metadata.
  • Audit ConfigMap create and update events for Kyverno-related labels, especially when followed by Secret generation in another namespace.
  • Enforce policy checks that restrict cross-namespace Secret generation and validate the identity and authorization of trigger resources.

Sources

SourceLink
github.comgithub.com/kyverno/kyverno/security/advisories/GHSA-hg5v-hwm3-956r
vulncheck.comvulncheck.com/advisories/kyverno-before-1.19.2-label-spoofing-via-generation-handler-processrequest

Frequently asked

questions

The described issue involves Kyverno's Generation Handler and synchronized generate policies. Its practical scope depends on which ConfigMaps the handler processes and how policies permit Secret generation.

An attacker needs permission to create or update a ConfigMap that can be evaluated by the handler. The vulnerability does not, by itself, establish that an unauthenticated remote user can exploit it.

Do not treat user-controlled labels as sufficient authorization. Verify resource provenance and enforce explicit authorization before generating sensitive resources.

Restrict write access to trigger resources, review trust decisions involving mutable metadata, and use policy controls that limit cross-namespace access to Secrets.

The described issue involves Kyverno's Generation Handler and synchronized generate policies. Its practical scope depends on which ConfigMaps the handler processes and how policies permit Secret generation.

An attacker needs permission to create or update a ConfigMap that can be evaluated by the handler. The vulnerability does not, by itself, establish that an unauthenticated remote user can exploit it.

Do not treat user-controlled labels as sufficient authorization. Verify resource provenance and enforce explicit authorization before generating sensitive resources.

Restrict write access to trigger resources, review trust decisions involving mutable metadata, and use policy controls that limit cross-namespace access to Secrets.

Find out what's already
exploitable in your codebase.