github.com/rancher/rancher
Affected
- introduced
2.5.0, fixed2.5.17(semver)
Fixed versions
2.5.17
Fix
- Fixed version
2.5.17go get github.com/rancher/[email protected]
Advisory
Also known as: CVE-2022-21953
Authenticated user can gain unauthorized shell pod and kubectl access in the local cluster
Impact
An issue was discovered in Rancher where an authorization logic flaw allows an authenticated user on any downstream cluster to (1) open a shell pod in the Rancher local cluster and (2) have limited kubectl access to it. The expected behavior is that a user does not have such access in the Rancher local cluster unless explicitly granted.
This issue does not allow the user to escalate privileges in the local cluster directly (this would require another vulnerability to be exploited).
The security issue happens in two different ways:
local cluster instead of the desired downstream cluster.local cluster. For example: - If the local cluster has unlimited network access, e.g. to the Internet, the user can open a reverse network connection to the shell pod.
- Or access the cloud metadata API of the underlying cloud infrastructure, where the user can extract the credentials associated with the local cluster and use them to interact with the cloud environment (this will be limited by the permissions granted to the cloud credentials in question).
- Check further recommendations about liming access to the cloud metadata API in Rancher's security best practices.
server cluster address in the kubeconfig file can be changed to point to the Rancher local cluster instead of the intended downstream cluster.- This can also be achieved by crafting a kubeconfig using a Rancher token instead of using the kubeconfig from an active cluster.
- This flaw cannot be exploited to access a downstream cluster that the user has no permissions to.
Notes:
local cluster means the cluster where Rancher is installed. It is named as local inside the list of clusters in the Rancher UI.1 or above.Workarounds
There is no workaround or direct mitigation besides updating to a patched Rancher version.
Patches
Patched versions include releases 2.5.17, 2.6.10, 2.7.1 and later versions.
For more information
If you have any questions or comments about this advisory:
High Basis: The source's own band: HIGH
2.5.0, fixed 2.5.17 (semver)2.5.17
2.5.17go get github.com/rancher/[email protected]2.6.0, fixed 2.6.10 (semver)2.6.10
2.6.10go get github.com/rancher/[email protected]2.7.0, fixed 2.7.1 (semver)2.7.1
2.7.1go get github.com/rancher/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0