CVE-2023-34091: Github.com/kyverno/kyverno Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-hq4m-4948-64cc
CVSS 6.5
CWE-285
Published
Advisory Summary

CVE-2023-34091 is a MODERATE (CVSS 6.5) remote code execution vulnerability (CWE-285: Improper Authorization) affecting Github.com/kyverno/kyverno libraries in the Go ecosystem. The issue involves kyverno resource with a deletiontimestamp may allow policy circumvention. Remediation is available by upgrading affected packages to version 1.10.0.

CVE-2023-34091 at a Glance

CVE Identifier CVE-2023-34091
GHSA Identifier GHSA-hq4m-4948-64cc
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-285: Improper Authorization
Affected Product Github.com/kyverno/kyverno
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:U/C:N/I:H/A:N).

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

How to Fix CVE-2023-34091

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.10.0
Upgrade github.com/kyverno/kyverno to 1.10.0
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-2023-34091, 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.10.0), 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-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. 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

### Impact In versions of Kyverno prior to 1.10.0, resources which have the `deletionTimestamp` field defined can bypass validate, generate, or mutate-existing policies, even in cases where the `validationFailureAction` field is set to `Enforce`. This situation occurs as resources pending deletion were being consciously exempted by Kyverno, as a way to reduce processing load as policies are typically not applied to objects which are being deleted. However, this could potentially result in allowing a malicious user to leverage the [Kubernetes finalizers feature](https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/) by setting a finalizer which causes the Kubernetes API server to set the `deletionTimestamp` and then not completing the delete operation as a way to explicitly to bypass a Kyverno policy. Note that this is not applicable to Kubernetes Pods but, as an example, a Kubernetes Service resource can be manipulated using an indefinite finalizer to bypass policies. ### Patches This is resolved in Kyverno 1.10.0. ### Workarounds There is no known workaround. ### References _Are there any links users can visit to find out more?_

CVE-2023-34091 Affected Github.com/kyverno/kyverno Versions

1 component(s)
Fixed Versions:
1.10.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/kyverno/kyverno
Go
< 1.10.0
1.10.0

References

Frequently Asked Questions

What is CVE-2023-34091?
CVE-2023-34091 is a security vulnerability in Github.com/kyverno/kyverno involving Kyverno resource with a deletionTimestamp may allow policy circumvention under CWE-285: Improper Authorization.
Which Github.com/kyverno/kyverno versions are affected?
Affected versions include releases prior to 1.10.0 across affected packages: github.com/kyverno/kyverno.
What version fixes CVE-2023-34091?
Upgrading to 1.10.0 (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.10.0. Upgrade your dependency to 1.10.0 or later.
What is the CVSS score of CVE-2023-34091?
CVE-2023-34091 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2023-34091?
CVE-2023-34091 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Go dependencies for CVE-2023-34091?
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-hq4m-4948-64cc",
  "modified" : "2023-06-05T17:10:13Z",
  "published" : "2023-06-05T17:10:13Z",
  "aliases" : [ "CVE-2023-34091" ],
  "summary" : "Kyverno resource with a deletionTimestamp may allow policy circumvention",
  "details" : "### Impact\n\nIn versions of Kyverno prior to 1.10.0, resources which have the `deletionTimestamp` field defined can bypass validate, generate, or mutate-existing policies, even in cases where the `validationFailureAction` field is set to `Enforce`. \n\nThis situation occurs as resources pending deletion were being consciously exempted by Kyverno, as a way to reduce processing load as policies are typically not applied to objects which are being deleted. \n\nHowever, this could potentially result in allowing a malicious user to leverage the [Kubernetes finalizers feature](https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/) by setting a finalizer which causes the Kubernetes API server to set the `deletionTimestamp` and then not completing the delete operation as a way to explicitly to bypass a Kyverno policy. \n\nNote that this is not applicable to Kubernetes Pods but, as an example, a Kubernetes Service resource can be manipulated using an indefinite finalizer to bypass policies.\n\n\n### Patches\nThis is resolved in Kyverno 1.10.0.\n\n### Workarounds\nThere is no known workaround.\n\n### References\n_Are there any links users can visit to find out more?_\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kyverno/kyverno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.10.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kyverno/kyverno/security/advisories/GHSA-hq4m-4948-64cc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34091"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kyverno/kyverno"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kyverno/kyverno/releases/tag/v1.10.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-05T17:10:13Z",
    "nvd_published_at" : "2023-06-01T17:15:10Z"
  }
}