CVE-2022-24817CWE-94

Improper kubeconfig validation allows arbitrary code execution

Critical · published May 6, 2022

CVSS v3.1
9.9
EPSS
1%
Percentile
65.9
In the wild
Unconfirmed
What it is

🔥 A crafty code injection vulnerability lurks in Flux2 versions up to 0.29.0, potentially allowing attackers to escalate privileges with just a malicious Kubeconfig! Think of it like a multi-tenant office building where anyone can submit changes to the plans without any verification — if the plans are flawed, it could lead to some serious infrastructure disasters! An attacker could exploit this vulnerability to execute arbitrary code, leading to unauthorized access and even privilege escalation. This means they could gain elevated permissions to control your Kubernetes environment, which could have absolutely devastating consequences for your deployments!

Put simply

Think of it like a multi-tenant office building where anyone can submit changes to the plans without any verification — if the plans are flawed, it could lead to some serious infrastructure disasters! This vulnerability allows code injection through a malicious Kubeconfig in Flux2, specifically impacting the helm-controller and kustomize-controller when they run with elevated service account permissions in multi-tenant setups.

What to do

An attacker could exploit this vulnerability to execute arbitrary code, leading to unauthorized access and even privilege escalation. This means they could gain elevated permissions to control your Kubernetes environment, which could have absolutely devastating consequences for your deployments! To remediate, patch Flux2 to version 0.29.0 or later, which includes fixes in the kustomize-controller v0.23.0 and helm-controller v0.19.0. Additionally, implement Validating Admission webhooks to restrict the `spec.kubeConfig` field, and consider applying restrictive AppArmor and SELinux profiles on the controller’s pod to limit executable binaries. This is fixable! Stay proactive with these steps and you'll have your Kubernetes environment locked down in no time. 🛡️

The record
Technical detail
CVSS v3.1
9.9 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.01118 · 65.9th percentile
Weakness
CWE-94 · Improper Control of Generation of Code ('Code Injection')
Published
2022-05-06T00:00Z
EPSS history
Timeline
  • 06 MAY 00:00Z
    Improper kubeconfig validation allows arbitrary code execution
    cvelistv5