CVE-2024-22030: Github.com/rancher/rancher Rancher Agents Can Be Hijacked Vulnerability

HIGH
Advisory Identifier: GHSA-h4h5-9833-v2p4
CVSS 8.0
CWE-295
Published
Advisory Summary

CVE-2024-22030 is a HIGH (CVSS 8.0) rancher agents can be hijacked vulnerability (CWE-295: Improper Certificate Validation) affecting Github.com/rancher/rancher libraries in the Go ecosystem. The issue involves rancher agents can be hijacked by taking over the rancher server url. Remediation is available by upgrading affected packages to version 2.7.15, 2.8.8, 2.9.2.

CVE-2024-22030 at a Glance

CVE Identifier CVE-2024-22030
GHSA Identifier GHSA-h4h5-9833-v2p4
Severity HIGH
CVSS v3.1 Base Score 8.0
CWE Classification CWE-295: Improper Certificate Validation
Affected Product Github.com/rancher/rancher
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.0

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

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
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-2024-22030

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.15
Upgrade github.com/rancher/rancher to 2.7.15
github.com/rancher/rancher fixed: 2.8.8
Upgrade github.com/rancher/rancher to 2.8.8
github.com/rancher/rancher fixed: 2.9.2
Upgrade github.com/rancher/rancher to 2.9.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/rancher/rancher

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-22030, 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.15), 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-295: Improper Certificate Validation, where the product does not validate, or incorrectly validates, a certificate. 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 vulnerability has been identified within Rancher that can be exploited in narrow circumstances through a man-in-the-middle (MITM) attack. An attacker would need to have control of an expired domain or execute a DNS spoofing/hijacking attack against the domain to exploit this vulnerability. The targeted domain is the one used as the Rancher URL. SUSE is unaware of any successful exploitation of this vulnerability, which has a high complexity bar. Please consult the associated [MITRE ATT&CK - Technique - Adversary-in-the-Middle](https://attack.mitre.org/techniques/T1557/) for further information about this attack category. ### Patches A new setting, [`agent-tls-mode`](https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/installation-references/tls-settings), was added, which allows users to specify if agents will use `strict` certificate verification when connecting to Rancher. The field can be set to `strict` (which requires the agent to verify the certificate using only the Certificate Authority in the `cacerts` setting) or `system-store` (which allows the agent to verify the certificate using any Certificate Authority in the operating system's trust store). This setting will default to strict on new installs of Rancher `v2.8.6`, `v2.9.0`, and newer versions. When upgrading from a prior version, the current value will be kept. If updating from older versions, the settings must be manually configured. **Important:** For non-Windows nodes, this is fixed since `v2.8.6` and `v2.9.0`. For Windows nodes, this is fully fixed starting with `v2.8.8` and `v2.9.2` Patched versions include releases `v2.8.8` and `v2.9.2`. For non-Windows nodes, the fix was released with `v2.7.15`. However, if you are running Rancher `v2.7.x` and have Windows nodes, you must follow the below workaround to address this issue on those nodes. ### Workarounds If you can't update, please follow the standard security practices including: 1. Properly control the expiration and ownership of the domain used as the Rancher URL (the `server-url` of the Rancher cluster). 2. Enabling DNSSEC as a way to protect against DNS spoofing or hijacking attacks. 3. Properly clean up and decommission unused clusters and downstream clusters, instead of leaving them behind. For example, downstream clusters which are alive while the main Rancher server is no longer available. In some cases, Windows nodes added to RKE2 clusters may not be automatically updated with the desired `agent-tls-mode`. Windows clusters running at least the August patches (`v1.27.16`, `v1.28.13`, `v1.29.8`, `v1.30.4`) will be automatically updated. For Windows nodes running older versions of RKE2, this issue can be manually resolved by following these [instructions](https://github.com/rancherlabs/support-tools/tree/master/windows-agent-strict-verify). If you are running Rancher `v2.7.x` Windows nodes will not automatically update, and you must follow the above [instructions](https://github.com/rancherlabs/support-tools/tree/master/windows-agent-strict-verify), with the following notes: 1. This needs to be done for all existing Windows nodes and any new nodes provisioned. 2. You must omit the `DownloadWins` flag, and must instead manually download the `rancher-wins` version [0.4.18](https://github.com/rancher/wins/releases/tag/v0.4.18), or greater, from its GitHub repository and place it in the required directories: a. `c:\Windows` b. `c:\user\local\bin` 3. You must restart the nodes after running the script, simply restarting `rancher-wins` or RKE2 will result in [pod networking errors](https://github.com/rancher/rke2/issues/5551). The only scenario where you do not need to completely restart the node is if the cluster is running version `v1.27.16` or higher. ### Credits This issue was found and reported by Jarkko Vesiluoma from Redtest Security. ### 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 with our [support matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/) and [product support lifecycle](https://www.suse.com/lifecycle/).

CVE-2024-22030 Affected Github.com/rancher/rancher Versions

3 component(s)
Fixed Versions:
2.7.152.8.82.9.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/rancher/rancher
Go
≥ 2.7.0
< 2.7.15
2.7.15
github.com/rancher/rancher
Go
≥ 2.8.0
< 2.8.8
2.8.8
github.com/rancher/rancher
Go
≥ 2.9.0
< 2.9.2
2.9.2

References

Frequently Asked Questions

What is CVE-2024-22030?
CVE-2024-22030 is a security vulnerability in Github.com/rancher/rancher involving Rancher agents can be hijacked by taking over the Rancher Server URL under CWE-295: Improper Certificate Validation.
Which Github.com/rancher/rancher versions are affected?
Affected versions include releases prior to 2.7.15, 2.8.8, 2.9.2 across affected packages: github.com/rancher/rancher.
What version fixes CVE-2024-22030?
Upgrading to 2.7.15, 2.8.8, 2.9.2 (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.15, 2.8.8, 2.9.2. Upgrade your dependency to 2.7.15, 2.8.8, 2.9.2 or later.
What is the CVSS score of CVE-2024-22030?
CVE-2024-22030 has a CVSS v3.1 base score of 8.0 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-22030?
CVE-2024-22030 is classified under CWE-295: Improper Certificate Validation (The product does not validate, or incorrectly validates, a certificate.).
How can I check Go dependencies for CVE-2024-22030?
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-h4h5-9833-v2p4",
  "modified" : "2024-10-16T17:26:13Z",
  "published" : "2024-09-26T21:13:08Z",
  "aliases" : [ "CVE-2024-22030" ],
  "summary" : "Rancher agents can be hijacked by taking over the Rancher Server URL",
  "details" : "### Impact\nA vulnerability has been identified within Rancher that can be exploited in narrow circumstances through a man-in-the-middle (MITM) attack. An attacker would need to have control of an expired domain or execute a DNS spoofing/hijacking attack against the domain to exploit this vulnerability. The targeted domain is the one used as the Rancher URL.\n\nSUSE is unaware of any successful exploitation of this vulnerability, which has a high complexity bar. \n\nPlease consult the associated  [MITRE ATT&CK - Technique - Adversary-in-the-Middle](https://attack.mitre.org/techniques/T1557/) for further information about this attack category.\n\n### Patches\nA new setting, [`agent-tls-mode`](https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/installation-references/tls-settings), was added, which allows users to specify if agents will use `strict` certificate verification when connecting to Rancher. The field can be set to `strict` (which requires the agent to verify the certificate using only the Certificate Authority in the `cacerts` setting) or `system-store` (which allows the agent to verify the certificate using any Certificate Authority in the operating system's trust store). This setting will default to strict on new installs of Rancher `v2.8.6`, `v2.9.0`, and newer versions. When upgrading from a prior version, the current value will be kept. If updating from older versions, the settings must be manually configured.\n\n**Important:** For non-Windows nodes, this is fixed since `v2.8.6` and `v2.9.0`. For Windows nodes, this is fully fixed starting with `v2.8.8` and `v2.9.2`\n\nPatched versions include releases `v2.8.8` and `v2.9.2`.\n\nFor non-Windows nodes, the fix was released with `v2.7.15`. However, if you are running Rancher `v2.7.x` and have Windows nodes, you must follow the below workaround to address this issue on those nodes.\n\n### Workarounds\nIf you can't update, please follow the standard security practices including:\n \n1. Properly control the expiration and ownership of the domain used as the Rancher URL (the `server-url` of the Rancher cluster).\n2. Enabling DNSSEC as a way to protect against DNS spoofing or hijacking attacks. \n3. Properly clean up and decommission unused clusters and downstream clusters, instead of leaving them behind. For example, downstream clusters which are alive while the main Rancher server is no longer available.\n\nIn some cases, Windows nodes added to RKE2 clusters may not be automatically updated with the desired `agent-tls-mode`. Windows clusters running at least the August patches (`v1.27.16`, `v1.28.13`, `v1.29.8`, `v1.30.4`) will be automatically updated. For Windows nodes running older versions of RKE2, this issue can be manually resolved by following these [instructions](https://github.com/rancherlabs/support-tools/tree/master/windows-agent-strict-verify).\n\nIf you are running Rancher `v2.7.x` Windows nodes will not automatically update, and you must follow the above [instructions](https://github.com/rancherlabs/support-tools/tree/master/windows-agent-strict-verify), with the following notes:\n1. This needs to be done for all existing Windows nodes and any new nodes provisioned.\n2. You must omit the `DownloadWins` flag, and must instead manually download the `rancher-wins` version [0.4.18](https://github.com/rancher/wins/releases/tag/v0.4.18), or greater, from its GitHub repository and place it in the required directories:\na. `c:\\Windows`\nb. `c:\\user\\local\\bin`\n3. You must restart the nodes after running the script, simply restarting `rancher-wins` or RKE2 will result in [pod networking errors](https://github.com/rancher/rke2/issues/5551). The only scenario where you do not need to completely restart the node is if the cluster is running version `v1.27.16` or higher.\n\n### Credits\nThis issue was found and reported by Jarkko Vesiluoma from Redtest Security.\n\n### For more information\nIf you have any questions or comments about this advisory:\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 with our [support matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/) and [product support lifecycle](https://www.suse.com/lifecycle/).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/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.0"
      }, {
        "fixed" : "2.7.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/rancher/rancher"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0"
      }, {
        "fixed" : "2.8.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/rancher/rancher"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.9.0"
      }, {
        "fixed" : "2.9.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rancher/rancher/security/advisories/GHSA-h4h5-9833-v2p4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22030"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.suse.com/show_bug.cgi?id=CVE-2024-22030"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rancher/rancher"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rancherlabs/support-tools/tree/master/windows-agent-strict-verify"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3161"
  }, {
    "type" : "WEB",
    "url" : "https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/installation-references/tls-settings"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-295" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-26T21:13:08Z",
    "nvd_published_at" : "2024-10-16T14:15:04Z"
  }
}