{"answers":{"affected":"6 open source packages ship an affected version, including github.com/rancher/rancher.","exploited":"There is no known exploitation of GHSA-c45c-39f6-6gw9 in the wild and no public exploit code.","fix":"Upgrade github.com/rancher/rancher to a fixed version for your release line: 2.5.17, 2.6.10 or 2.7.1.","what":"GHSA-c45c-39f6-6gw9 is an authentication bypass vulnerability in github.com/rancher/rancher, published on 25 Jan 2023. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-c45c-39f6-6gw9 and fix it if it is affected.\n\nWhat it is: GHSA-c45c-39f6-6gw9 is an authentication bypass vulnerability in github.com/rancher/rancher, published on 25 Jan 2023. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-c45c-39f6-6gw9 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/rancher/rancher (Go): affected from 2.5.0; fixed in 2.5.17\n- github.com/rancher/rancher (Go): affected from 2.5.0; fixed in 2.5.17\n- github.com/rancher/rancher (Go): affected from 2.6.0; fixed in 2.6.10\n- github.com/rancher/rancher (Go): affected from 2.6.0; fixed in 2.6.10\n- github.com/rancher/rancher (Go): affected from 2.7.0; fixed in 2.7.1\n- github.com/rancher/rancher (Go): affected from 2.7.0; fixed in 2.7.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-c45c-39f6-6gw9/ (Markdown: https://insights.sbomify.com/GHSA-c45c-39f6-6gw9/index.md)","id":"GHSA-c45c-39f6-6gw9","markdown":"https://insights.sbomify.com/GHSA-c45c-39f6-6gw9/index.md","name":"GHSA-c45c-39f6-6gw9","record":{"aliases":[],"analysis":{"component_type":"container_or_infrastructure","fix_type":"upgrade","impacts":["privilege_escalation","security_bypass"],"network_reachable":"yes","non_default_config":true,"product_category":"Rancher Kubernetes management","requires_auth":"low_privilege","summary":"Attackers retain access via stale tokens after disabling external auth providers or removing users from authorized lists in Rancher.","user_interaction":"not_required","vuln_class":"auth_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\n\nThis issue affects Rancher versions from 2.5.0 up to and including 2.5.16, from 2.6.0 up to and including 2.6.9 and 2.7.0. It only affects Rancher setups that have an external [authentication provider](https://ranchermanager.docs.rancher.com/pages-for-subheaders/authentication-config) configured or had one configured in the past.\n\nIt was discovered that when an external authentication provider is configured in Rancher and then disabled, the Rancher generated [tokens](https://ranchermanager.docs.rancher.com/reference-guides/about-the-api/api-tokens) associated with users who had access granted through the now disabled auth provider are not revoked. This allows users to retain access to Rancher and `kubectl` access to clusters managed by Rancher, according to their previous configured permissions, even after they are supposed to have lost it due to the auth provider been disabled.\n\nThe problem also occurs if the auth provider is configured (and is still enabled) to use the [access level scopes](https://ranchermanager.docs.rancher.com/pages-for-subheaders/authentication-config) `allow members of clusters and projects, plus authorized users \u0026 groups` and `restrict access to only the authorized users \u0026 groups`. In this case, removing users and groups from the authorized lists will not revoke the access tokens and they will remain valid.\n\nAn example scenario is:\n\n1. OpenLDAP, MS Active Directory (AD) or any other external [authentication provider](https://ranchermanager.docs.rancher.com/pages-for-subheaders/authentication-config) is configured as an auth provider.\n2. A user (`cluster-owner`) is granted `cluster-owner` permissions on a downstream cluster (`test-cluster`).\n3. `cluster-owner` logs in using their external auth provider username and password.\n4. `cluster-owner` generates a `kubeconfig` token for `test-cluster`.\n5. The configured external auth provider is disabled.\n\nIn this scenario, the `kubeconfig` generated in step 4 will still be valid after step 5, and `test-cluster` can still be accessed using the `kubeconfig` token.\n\nBy default, tokens for authenticated session have their `ttl` (time to live) set to `960` minutes, so they will expire after `16` hours. `kubeconfig` tokens are configured to never expire, and their `ttl` is set to `0`. These configurations can be changed in the Rancher's settings (`Configuration \u003e Global Settings \u003e Settings`) with the [parameters](https://ranchermanager.docs.rancher.com/reference-guides/about-the-api/api-tokens)  `auth-user-session-ttl-minutes` and `kubeconfig-default-token-ttl-minutes`, respectively.\n\n### Workarounds\n\nIf you cannot update to a patched Rancher version, the recommended workaround is to review and remove tokens associated with auth providers manually.\n\nThe tokens can be reviewed by executing `kubectl get tokens` in Rancher's `local` cluster. Each found token must be manually reviewed to check if it belongs to a user from a disabled auth provider or a user who's access was previously removed from the auth provider (when the auth provider is still enabled and is or was configured to use access level scopes, as mentioned above). The identified tokens can be removed with `kubectl delete tokens \u003ctoken_name\u003e`.\n\nIt is important to mention that this workaround must be done every time an auth provider is disabled in case you cannot update to a patched version.\n\n### Patches\n\nPatched versions include releases 2.5.17, 2.6.10, 2.7.1 and later versions. After updating to a patched version, it is highly recommended to review the existing tokens and remove tokens related to disabled auth providers as described above in the workaround section.\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/).","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Rancher generated tokens not revoked after modifications made to authentication provider","id":"GHSA-c45c-39f6-6gw9","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"auth_bypass","year":"2023"},"n_packages":6,"n_references":null,"packages":[{"ecosystem":"Go","fixed":["2.5.17"],"introduced":["2.5.0"],"last_affected":[],"package":"github.com/rancher/rancher","purl":null,"source":"GHSA-c45c-39f6-6gw9"},{"ecosystem":"Go","fixed":["2.5.17"],"introduced":["2.5.0"],"last_affected":[],"package":"github.com/rancher/rancher","purl":"pkg:golang/github.com/rancher/rancher","source":"GHSA-c45c-39f6-6gw9"},{"ecosystem":"Go","fixed":["2.6.10"],"introduced":["2.6.0"],"last_affected":[],"package":"github.com/rancher/rancher","purl":null,"source":"GHSA-c45c-39f6-6gw9"},{"ecosystem":"Go","fixed":["2.6.10"],"introduced":["2.6.0"],"last_affected":[],"package":"github.com/rancher/rancher","purl":"pkg:golang/github.com/rancher/rancher","source":"GHSA-c45c-39f6-6gw9"},{"ecosystem":"Go","fixed":["2.7.1"],"introduced":["2.7.0"],"last_affected":[],"package":"github.com/rancher/rancher","purl":null,"source":"GHSA-c45c-39f6-6gw9"},{"ecosystem":"Go","fixed":["2.7.1"],"introduced":["2.7.0"],"last_affected":[],"package":"github.com/rancher/rancher","purl":"pkg:golang/github.com/rancher/rancher","source":"GHSA-c45c-39f6-6gw9"}],"products":null,"published":"2023-01-25","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers retain access via stale tokens after disabling external auth providers or removing users from authorized lists in Rancher.","url":"https://insights.sbomify.com/GHSA-c45c-39f6-6gw9/"}