---
id: CVE-2021-31999
aliases:
  - GHSA-pvxj-25m6-7vqr
  - GO-2024-2778
title: Rancher Privilege escalation vulnerability via malicious "Connection" header
summary: Rancher Privilege escalation vulnerability via malicious "Connection" header
severity: high
cvss: 8.8
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'
vendor: rancher
product: github.com/rancher/rancher
ecosystem: go
affected:
  - 'github.com/rancher/rancher >= 2.0.0, < 2.4.16'
  - 'github.com/rancher/rancher >= 2.5.0, < 2.5.9'
patched:
  - github.com/rancher/rancher 2.4.16
  - github.com/rancher/rancher 2.5.9
published: '2024-04-24'
updated: '2026-07-10'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-pvxj-25m6-7vqr'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2021-31999'
  - url: 'https://bugzilla.suse.com/show_bug.cgi?id=1187084'
  - url: 'https://github.com/rancher/rancher'
  - url: 'https://pkg.go.dev/vuln/GO-2024-2778'
tags:
  - osv
  - go
epss: 0.01052
epssPercentile: 0.62867
ingestedAt: '2026-07-10T18:56:50.785Z'
---

## Overview

A vulnerability was discovered in Rancher 2.0.0 through the aforementioned patched versions, where a malicious Rancher user could craft an API request directed at the proxy for the Kubernetes API of a managed cluster to gain access to information they do not have access to. This is done by passing the "Impersonate-User" or "Impersonate-Group" header in the Connection header, which is then correctly removed by the proxy. At this point, instead of impersonating the user and their permissions, the request will act as if it was from the Rancher management server and incorrectly return the information. The vulnerability is limited to valid Rancher users with some level of permissions on the cluster. There is not a direct mitigation besides upgrading to the patched Rancher versions. 


## Affected packages

- `github.com/rancher/rancher >= 2.0.0, < 2.4.16`
- `github.com/rancher/rancher >= 2.5.0, < 2.5.9`

## Remediation

Upgrade to a patched release:

- `github.com/rancher/rancher 2.4.16`
- `github.com/rancher/rancher 2.5.9`
