Incorrect Privilege Assignment Affecting github.com/rancher/rancher/pkg/client package, versions >=2.7.0 <2.7.14 >=2.8.0 <2.8.5


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.04% (11th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-GOLANG-GITHUBCOMRANCHERRANCHERPKGCLIENT-7268018
  • published 19 Jun 2024
  • disclosed 17 Jun 2024
  • credit Unknown

How to fix?

Upgrade github.com/rancher/rancher/pkg/client to version 2.7.14, 2.8.5 or higher.

Overview

github.com/rancher/rancher/pkg/client is a complete container management platform

Affected versions of this package are vulnerable to Incorrect Privilege Assignment when enforcing the privileges of a the RoleTemplate object with external set to true. For such objects, when the ClusterRole is set to project or is empty, an attacker can escalate privileges.

The package maintainers have provided a script for users to identify and correct RoleTemplates with a missing externalRules field and no backing ClusterRole.

#!/bin/bash
set -euo pipefail

get all RoleTemplates with .context == "project" or .context == "" that don't have externalRules.

rts=$(kubectl get roletemplates -o json | jq -r '.items[] | select((.context == "project" or .context == "") and .external == true and .externalRules == null) | .metadata.name') found_invalid_rt=false

for rt in $rts; do if ! kubectl get clusterrole "$rt" > /dev/null 2>&1; then echo "$rt" # prints RoleTemplate names that don't have a backing ClusterRole found_invalid_rt=true fi done

if ! $found_invalid_rt ; then echo 'This cluster is not affected by CVE-2023-32197: no RoleTemplate objects found' fi

CVSS Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
7.1 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    None
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    High
  • Integrity (VI)
    Low
  • Availability (VA)
    None
  • Confidentiality (SC)
    None
  • Integrity (SI)
    None
  • Availability (SA)
    None