CVE-2023-22651: Github.com/rancher/rancher Rancher Webhook Is Misconfigured During Vulnerability
CRITICALCVE-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
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).
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.
Upgrade github.com/rancher/rancher to 2.7.3
Upgrade github.com/rancher/rancher to 0.0.0-20230424183121-6d9a175954c6
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
CVE-2023-22651 Affected Github.com/rancher/rancher Versions
2 component(s)| 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?
Which Github.com/rancher/rancher versions are affected?
What version fixes CVE-2023-22651?
Is github.com/rancher/rancher affected?
What is the CVSS score of CVE-2023-22651?
What CWE is associated with CVE-2023-22651?
How can I check Go dependencies for CVE-2023-22651?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}