Skip to content

Command injection in Rancher Git package

Moderate severity GitHub Reviewed Published Jan 25, 2023 in rancher/rancher • Updated Feb 23, 2023

Package

gomod github.com/rancher/rancher (Go)

Affected versions

>= 2.5.0, < 2.5.17
>= 2.6.0, < 2.6.10
>= 2.7.0, < 2.7.1

Patched versions

2.5.17
2.6.10
2.7.1

Description

Impact

An issue was discovered in Rancher from versions 2.5.0 up to and including 2.5.16, 2.6.0 up to and including 2.6.9 and 2.7.0, where a command injection vulnerability is present in the Rancher Git package. This package uses the underlying Git binary available in the Rancher container image to execute Git operations.

Specially crafted commands, when not properly disambiguated, can cause confusion when executed through Git, resulting in command injection in the underlying Rancher host.

This issue can potentially be exploited in Rancher in two ways:

  1. Adding an untrusted Helm catalog, in the Catalogs menu, that contains maliciously designed repo URL configuration in Helm charts.
  2. Modifying the URL configuration used to download KDM (Kontainer Driver Metadata) releases.

By default, only the Rancher admin has permission to manage both configurations for the local cluster (the cluster where Rancher is provisioned).

Note: More information about this category of issue in version control system (VCS) tools are available in Snyk's blog post.

Workarounds

Except for only adding trusted catalogs and the KDM URL to Rancher, there is no other workaround besides updating Rancher to a patched version.

Patches

Patched versions include releases 2.5.17, 2.6.10, 2.7.1 and later versions.

It is also important to update to a patched version in case Rancher or its standalone Git package implementation is used as a Go library instead of the application itself. Otherwise, this vulnerability might affect your dependent code.

For more information

If you have any questions or comments about this advisory:

References

@macedogm macedogm published to rancher/rancher Jan 25, 2023
Published to the GitHub Advisory Database Jan 25, 2023
Reviewed Jan 25, 2023
Published by the National Vulnerability Database Feb 7, 2023
Last updated Feb 23, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H

EPSS score

0.097%
(42nd percentile)

CVE ID

CVE-2022-43758

GHSA ID

GHSA-34p5-jp77-fcrc

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.