# GHSA-wm2r-rp98-8pmh: Exposure of SSH credentials in Rancher/Fleet

> Attackers with low privileges can view exposed SSH private keys in logs when Fleet fails to download repositories, potentially compromising Git and Helm access.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Apr 2022

## What is GHSA-wm2r-rp98-8pmh?

GHSA-wm2r-rp98-8pmh is a vulnerability in github.com/rancher/rancher, published on 27 Apr 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Impact
This vulnerability only affects customers using Fleet for continuous delivery with authenticated Git and/or Helm repositories.

A security vulnerability ([CVE-2022-29810](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-29810)) was discovered in `go-getter` library in versions prior to [`v1.5.11`](https://github.com/hashicorp/go-getter/releases/tag/v1.5.11) that exposes SSH private keys in base64 format due to a failure in redacting such information from error messages. The vulnerable version of this library is used in Rancher through Fleet in versions of Fleet prior to [`v0.3.9`](https://github.com/rancher/fleet/releases/tag/v0.3.9). This issue affects Rancher versions 2.5.0 up to and including 2.5.12 and from 2.6.0 up to and including 2.6.3.

When Git and/or Helm authentication is configured in [Fleet](https://rancher.com/docs/rancher/v2.6/en/deploy-across-clusters/fleet/) and Fleet is used to deploy a git repo through `Continuous Delivery`, the affected `go-getter` version will expose the configured SSH private key secret if Fleet fails to download the git repo due to a misconfigured URL. The exposed SSH key is logged in base64 format as a query parameter together with the git URL. The credentials can be seen in Rancher UI and in Fleet's deployment pod logs.

### Patches
Patched versions include releases 2.5.13, 2.6.4 and later versions.

### Workarounds
There is not a direct mitigation besides upgrading to the patched Rancher versions. Until you are able to upgrade, limit access in Rancher to trusted users and carefully validate the URLs you are using are correct. Please note that the SSH key might still be compromised in valid URLs if the service goes down or a connection error happens when pulling from the repos.

**Note:** If you believe that SSH keys might have been exposed in your environment, it's highly advised to rotate them.

### Credits
This issue was found and reported by Dagan Henderson from Raft Engineering.

### For more information
If you have any questions or comments about this advisory:
* Reach out to [SUSE Rancher Security team](https://github.com/rancher/rancher/security/policy) for security related inquiries.
* Open an issue in [Rancher](https://github.com/rancher/rancher/issues/new/choose) repository.
* Verify our [support matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/) and [product support lifecycle](https://www.suse.com/lifecycle/).

## Which versions are affected by GHSA-wm2r-rp98-8pmh?

4 open source packages ship an affected version, including github.com/rancher/rancher.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/rancher/rancher` | Go | All versions | 2.5.13 |
| `github.com/rancher/rancher` | Go | All versions | 2.5.13 |
| `github.com/rancher/rancher` | Go | From 2.6.0 | 2.6.4 |
| `github.com/rancher/rancher` | Go | From 2.6.0 | 2.6.4 |

## How do I fix GHSA-wm2r-rp98-8pmh?

Upgrade github.com/rancher/rancher to a fixed version for your release line: 2.5.13 or 2.6.4.

## Is GHSA-wm2r-rp98-8pmh being exploited?

There is no known exploitation of GHSA-wm2r-rp98-8pmh in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-wm2r-rp98-8pmh and fix it if it is affected.

What it is: GHSA-wm2r-rp98-8pmh is a vulnerability in github.com/rancher/rancher, published on 27 Apr 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-wm2r-rp98-8pmh in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/rancher/rancher (Go): affected all versions; fixed in 2.5.13
- github.com/rancher/rancher (Go): affected all versions; fixed in 2.5.13
- github.com/rancher/rancher (Go): affected from 2.6.0; fixed in 2.6.4
- github.com/rancher/rancher (Go): affected from 2.6.0; fixed in 2.6.4

Task:
1. 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.
2. 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.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-wm2r-rp98-8pmh/ (Markdown: https://insights.sbomify.com/GHSA-wm2r-rp98-8pmh/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-wm2r-rp98-8pmh

---
From sbomify Insights: https://insights.sbomify.com/GHSA-wm2r-rp98-8pmh/
Summaries are generated and may contain mistakes; the official description above is the record.
