ghsa-8c69-r38j-rpfj
Vulnerability from github
Published
2023-01-25 19:31
Modified
2023-02-07 15:48
Summary
Rancher cattle-token is predictable
Details

Impact

An issue was discovered in Rancher versions up to and including 2.6.9 and 2.7.0, where the cattle-token secret, used by the cattle-cluster-agent, is predictable. Even after the token is regenerated, it will have the same value. This issue is not present in Rancher 2.5 releases.

The cattle-token is used by Rancher's cattle-cluster-agent to connect to the Kubernetes API of Rancher provisioned downstream clusters. The problem occurs because the cattle-token secret does not use any random value in its composition, which causes it to always be regenerated with the same value. This can pose a serious problem if the token is compromised and needs to be recreated for security purposes.

The usage of the cattle-token by an unauthorized user allows to escalate privileges to the cluster owner of the affected downstream cluster. It does not allow access to Rancher's own local cluster (the cluster where Rancher is provisioned).

Workarounds

In case it is not possible to promptly update to a patched version, a workaround is to use the rotate script provided in the public security advisory CVE-2021-36782 / GHSA-g7j7-h4q8-8w2f, which facilitates the rotation and creation of a new unique downstream cluster token.

Patches

Patched versions include releases 2.6.10, 2.7.1 and later versions.

After upgrading to one of the patched versions, it is highly recommended to rotate the cattle-token in downstream clusters to guarantee that a new random token will be safely regenerated.

The procedure below can rotate the cattle-token and should be executed in each downstream cluster provisioned by Rancher. It is recommended to first test this process in an appropriate development/testing environment.

```shell

Verify the current secret before rotating it

$ kubectl describe secrets cattle-token -n cattle-system

Delete the secret

$ kubectl delete secrets cattle-token -n cattle-system

Restart the cattle-cluster-agent deployment

$ kubectl rollout restart deployment/cattle-cluster-agent -n cattle-system

Confirm that a new and different secret was generated

$ kubectl describe secrets cattle-token -n cattle-system ```

For more information

If you have any questions or comments about this advisory:

Show details on source website


{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/rancher/rancher"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.6.0"
            },
            {
              "fixed": "2.6.10"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/rancher/rancher"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.7.0"
            },
            {
              "fixed": "2.7.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2022-43755"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-330",
      "CWE-331"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-01-25T19:31:08Z",
    "nvd_published_at": "2023-02-07T13:15:00Z",
    "severity": "HIGH"
  },
  "details": "### Impact\n\nAn issue was discovered in Rancher versions up to and including 2.6.9 and 2.7.0, where the `cattle-token` secret, used by the `cattle-cluster-agent`, is predictable. Even after the token is regenerated, it will have the same value. This issue is not present in Rancher 2.5 releases.\n\nThe `cattle-token` is used by Rancher\u0027s `cattle-cluster-agent` to connect to the Kubernetes API of Rancher provisioned downstream clusters. The problem occurs because the `cattle-token` secret does not use any random value in its composition, which causes it to always be regenerated with the same value. This can pose a serious problem if the token is compromised and needs to be recreated for security purposes.\n\nThe usage of the `cattle-token` by an unauthorized user allows to escalate privileges to the cluster owner of the affected downstream cluster. It does not allow access to Rancher\u0027s own local cluster (the cluster where Rancher is provisioned).\n\n### Workarounds\n\nIn case it is not possible to promptly update to a patched version, a workaround is to use the [rotate script](https://github.com/rancherlabs/support-tools/tree/master/rotate-tokens) provided in the public security advisory [CVE-2021-36782 / GHSA-g7j7-h4q8-8w2f](https://github.com/rancher/rancher/security/advisories/GHSA-g7j7-h4q8-8w2f), which facilitates the rotation and creation of a new unique downstream cluster token.\n\n### Patches\n\nPatched versions include releases 2.6.10, 2.7.1 and later versions.\n\nAfter upgrading to one of the patched versions, it is highly recommended to rotate the `cattle-token` in downstream clusters to guarantee that a new random token will be safely regenerated.\n\nThe procedure below can rotate the `cattle-token` and should be executed in each downstream cluster provisioned by Rancher. It is recommended to first test this process in an appropriate development/testing environment.\n\n```shell\n# Verify the current secret before rotating it\n$ kubectl describe secrets cattle-token -n cattle-system\n\n# Delete the secret\n$ kubectl delete secrets cattle-token -n cattle-system\n\n# Restart the cattle-cluster-agent deployment\n$ kubectl rollout restart deployment/cattle-cluster-agent -n cattle-system\n\n# Confirm that a new and different secret was generated\n$ kubectl describe secrets cattle-token -n cattle-system\n```\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Reach out to [SUSE Rancher Security team](https://github.com/rancher/rancher/security/policy) for security related inquiries.\n* Open an issue in [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/).",
  "id": "GHSA-8c69-r38j-rpfj",
  "modified": "2023-02-07T15:48:39Z",
  "published": "2023-01-25T19:31:08Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/rancher/rancher/security/advisories/GHSA-8c69-r38j-rpfj"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-43755"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.suse.com/show_bug.cgi?id=1205297"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/rancher/rancher"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Rancher cattle-token is predictable"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.