CVE-2023-22651: Github.com/rancher/rancher Rancher Webhook Is Misconfigured During Vulnerability

CRITICAL
Advisory Identifier: GHSA-6m9f-pj6w-w87g
CVSS 9.9
CWE-269 CWE-276
Published
Advisory Summary

CVE-2023-22651 is a CRITICAL (CVSS 9.9) rancher webhook is misconfigured during vulnerability (CWE-269: Improper Privilege Management) affecting Github.com/rancher/rancher libraries in the Go ecosystem. The issue involves rancher webhook is misconfigured during upgrade process. Remediation is available by upgrading affected packages to version 2.7.3, 0.0.0-20230424183121-6d9a175954c6.

CVE-2023-22651 at a Glance

CVE Identifier CVE-2023-22651
GHSA Identifier GHSA-6m9f-pj6w-w87g
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-269: Improper Privilege Management
Affected Product Github.com/rancher/rancher
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.9

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:H/I:H/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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-22651

To remediate this vulnerability, upgrade all affected Github.com/rancher/rancher 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/rancher/rancher fixed: 2.7.3
Upgrade github.com/rancher/rancher to 2.7.3
github.com/rancher/rancher fixed: 0.0.0-20230424183121-6d9a175954c6
Upgrade github.com/rancher/rancher to 0.0.0-20230424183121-6d9a175954c6
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/rancher/rancher

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-22651, inspect your project dependencies for Github.com/rancher/rancher:

inspect dependencies for github.com/rancher/rancher

Analyze the terminal output to locate any version of Github.com/rancher/rancher in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.3), 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-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Github.com/rancher/rancher, 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 A failure in the update logic of Rancher's admission Webhook may lead to the misconfiguration of the Webhook. This component enforces validation rules and security checks before resources are admitted into the Kubernetes cluster. When the Webhook is operating in a degraded state, it no longer validates any resources, which may result in severe privilege escalations and data corruption. The issue only affects users that upgrade from `2.6.x` or `2.7.x` to `2.7.2`. Users that did a fresh install of 2.7.2 (and did not follow an upgrade path) are not affected. The command below can be executed on the `local` cluster to determine whether the cluster is affected by this issue: ```sh $ kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io rancher.cattle.io NAME WEBHOOKS AGE rancher.cattle.io 0 19h ``` If the resulting webhook quantity is `0`, the Rancher instance is affected. ### Patches Patched versions include release `2.7.3` and later versions. ### Workarounds If you are affected and cannot update to a patched Rancher version, the recommended workaround is to manually reconfigure the Webhook with the script below. Please note that the script must be run from inside the `local` cluster or with a kubeconfig pointing to the `local` cluster which has admin permissions. ```yaml #!/bin/bash set -euo pipefail function prereqs() { if ! [ -x "$(command -v kubectl)" ]; then echo "error: kubectl is not installed." >&2 exit 1 fi if [[ -z "$(kubectl config view -o jsonpath='{.clusters[].cluster.server}')" ]]; then echo "error: No kubernetes cluster found on kubeconfig." >&2 exit 1 fi } function restart_deployment(){ kubectl rollout restart deployment rancher-webhook -n cattle-system kubectl rollout status deployment rancher-webhook -n cattle-system --timeout=30s } function workaround() { echo "Cluster: $(kubectl config view -o jsonpath='{.clusters[].cluster.server}')" if ! kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io rancher.cattle.io > /dev/null 2>&1; then echo "webhook rancher.cattle.io not found, restarting deployment:" restart_deployment echo "waiting for webhook configuration" sleep 15s fi local -i webhooks webhooks="$(kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io rancher.cattle.io --no-headers | awk '{ print $2 }')" if [ "${webhooks}" == "0" ]; then echo "Webhook misconfiguration status: Cluster is affected by CVE-2023-22651" echo "Running workaround:" kubectl delete validatingwebhookconfiguration rancher.cattle.io restart_deployment ret=$? if [ $ret -eq 0 ]; then echo "Webhook restored, CVE-2023-22651 is fixed" else echo "error trying to restart deployment. try again in a few seconds." fi else echo "Webhook misconfiguration status: not present (skipping)" fi echo "Done" } function main() { prereqs workaround } main ``` ### References - https://github.com/rancher/webhook/pull/216/commits/a4a498613b43a3ee93c5ab06742a3bc8adace45d ### For more information If you have any questions or comments about this advisory: - Reach out to the [SUSE Rancher Security team](https://github.com/rancher/rancher/security/policy) for security related inquiries. - Open an issue in the [Rancher](https://github.com/rancher/rancher/issues/new/choose) repository. - Verify our [support matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/) and [product support lifecycle](https://www.suse.com/lifecycle/).

CVE-2023-22651 Affected Github.com/rancher/rancher Versions

2 component(s)
Fixed Versions:
2.7.30.0.0-20230424183121-6d9a175954c6
Product / Package Ecosystem Affected Versions Fixed Version
github.com/rancher/rancher
Go
≥ 2.7.2
< 2.7.3
All 1 versions
2.7.2
2.7.3
github.com/rancher/rancher
Go
≥ 0.0.0-20220922131902-ec6d6d3a7616
< 0.0.0-20230424183121-6d9a175954c6
0.0.0-20230424183121-6d9a175954c6

References

Frequently Asked Questions

What is CVE-2023-22651?
CVE-2023-22651 is a security vulnerability in Github.com/rancher/rancher involving Rancher Webhook is misconfigured during upgrade process under CWE-269: Improper Privilege Management.
Which Github.com/rancher/rancher versions are affected?
Affected versions include releases prior to 2.7.3, 0.0.0-20230424183121-6d9a175954c6 across affected packages: github.com/rancher/rancher.
What version fixes CVE-2023-22651?
Upgrading to 2.7.3, 0.0.0-20230424183121-6d9a175954c6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/rancher/rancher affected?
Yes, github.com/rancher/rancher is affected in releases prior to 2.7.3, 0.0.0-20230424183121-6d9a175954c6. Upgrade your dependency to 2.7.3, 0.0.0-20230424183121-6d9a175954c6 or later.
What is the CVSS score of CVE-2023-22651?
CVE-2023-22651 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2023-22651?
CVE-2023-22651 is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check Go dependencies for CVE-2023-22651?
Run the dependency tree command: 'inspect dependencies for github.com/rancher/rancher'. 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-6m9f-pj6w-w87g",
  "modified" : "2025-05-27T14:46:00Z",
  "published" : "2023-04-24T22:34:59Z",
  "aliases" : [ "CVE-2023-22651" ],
  "summary" : "Rancher Webhook is misconfigured during upgrade process",
  "details" : "### Impact\n\nA failure in the update logic of Rancher's admission Webhook may lead to the misconfiguration of the Webhook. This component enforces validation rules and security checks before resources are admitted into the Kubernetes cluster.\n\nWhen the Webhook is operating in a degraded state, it no longer validates any resources, which may result in severe privilege escalations and data corruption.\n\nThe issue only affects users that upgrade from `2.6.x` or `2.7.x` to `2.7.2`. Users that did a fresh install of 2.7.2 (and did not follow an upgrade path) are not affected.\n\nThe command below can be executed on the `local` cluster to determine whether the cluster is affected by this issue:\n\n```sh\n$ kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io rancher.cattle.io\n\nNAME                WEBHOOKS   AGE\nrancher.cattle.io   0         19h\n```\n\nIf the resulting webhook quantity is `0`, the Rancher instance is affected.\n\n### Patches\n\nPatched versions include release `2.7.3` and later versions.\n\n### Workarounds\n\nIf you are affected and cannot update to a patched Rancher version, the recommended workaround is to manually reconfigure the Webhook with the script below. Please note that the script must be run from inside the `local` cluster or with a kubeconfig pointing to the `local` cluster which has admin permissions.\n\n```yaml\n#!/bin/bash\n\nset -euo pipefail\n\nfunction prereqs() {\n    if ! [ -x \"$(command -v kubectl)\" ]; then\n      echo \"error: kubectl is not installed.\" >&2\n      exit 1\n    fi\n\n    if [[ -z \"$(kubectl config view -o jsonpath='{.clusters[].cluster.server}')\" ]]; then\n        echo \"error: No kubernetes cluster found on kubeconfig.\" >&2\n        exit 1\n    fi\n}\n\nfunction restart_deployment(){\n    kubectl rollout restart deployment rancher-webhook -n cattle-system\n    kubectl rollout status deployment rancher-webhook -n cattle-system --timeout=30s\n}\n\nfunction workaround() {\n    echo \"Cluster: $(kubectl config view -o jsonpath='{.clusters[].cluster.server}')\"\n\n    if ! kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io rancher.cattle.io > /dev/null 2>&1; then\n        echo \"webhook rancher.cattle.io not found, restarting deployment:\"\n        restart_deployment\n\n        echo \"waiting for webhook configuration\"\n        sleep 15s\n    fi\n\n    local -i webhooks\n    webhooks=\"$(kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io rancher.cattle.io --no-headers | awk '{ print $2 }')\"\n\n    if [ \"${webhooks}\" == \"0\" ]; then\n        echo \"Webhook misconfiguration status: Cluster is affected by CVE-2023-22651\"\n        \n        echo \"Running workaround:\"\n        kubectl delete validatingwebhookconfiguration rancher.cattle.io\n        restart_deployment\n\n        ret=$?\n        if [ $ret -eq 0 ]; then\n            echo \"Webhook restored, CVE-2023-22651 is fixed\"\n        else\n            echo \"error trying to restart deployment. try again in a few seconds.\"\n        fi\n    else\n        echo \"Webhook misconfiguration status: not present (skipping)\"\n    fi\n\n    echo \"Done\"\n}\n\nfunction main() {\n    prereqs\n    workaround\n}\n\nmain\n```\n\n### References\n- https://github.com/rancher/webhook/pull/216/commits/a4a498613b43a3ee93c5ab06742a3bc8adace45d\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n- Reach out to the [SUSE Rancher Security team](https://github.com/rancher/rancher/security/policy) for security related inquiries.\n- Open an issue in the [Rancher](https://github.com/rancher/rancher/issues/new/choose) repository.\n- Verify our [support matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/) and [product support lifecycle](https://www.suse.com/lifecycle/).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/rancher/rancher"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.2"
      }, {
        "fixed" : "2.7.3"
      } ]
    } ],
    "versions" : [ "2.7.2" ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/rancher/rancher"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.0-20220922131902-ec6d6d3a7616"
      }, {
        "fixed" : "0.0.0-20230424183121-6d9a175954c6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rancher/rancher/security/advisories/GHSA-6m9f-pj6w-w87g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-22651"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.suse.com/show_bug.cgi?id=CVE-2023-22651"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rancher/rancher"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rancher/rancher/releases/tag/v2.7.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269", "CWE-276" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-04-24T22:34:59Z",
    "nvd_published_at" : "2023-05-04T08:15:22Z"
  }
}