🔍 CVE-2021-41254

8.8
CVSS Score
HIGH
2021-11-12
2026-06-17 04:08
✅ 완료

🇰🇷 한글 설명

kustomize-controller에서 Kubernetes Secret 내부에 쉘 스크립트를 삽입하여 컨테이너 내부 명령을 실행할 수 있는 취약점입니다. 이를 통해 공격자는 kustomize-controller의 권한을 탈취하여 클러스터 관리자 권한을 획득할 수 있습니다.

💡 쉬운 설명

권한이 있는 사용자가 특수하게 조작된 비밀 정보를 만들어 시스템에 넣으면, 시스템이 이를 실행하면서 관리자 권한을 통째로 넘겨주는 보안 구멍입니다. 이를 통해 공격자는 전체 클러스터를 마음대로 조종할 수 있게 됩니다.

🇺🇸 원문 (English)

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.

📍 영향받는 시스템

kustomize-controller v0.15.0 미만 버전 (flux2 v0.18.0 미만 포함)

⚔️ 공격 벡터

Kubernetes Secret, Service Account 또는 Flux Kustomization 객체를 생성할 수 있는 권한을 이용해 쉘 스크립트 삽입

🛡️ 대응 방법

kustomize-controller를 v0.15.0 이상으로 업데이트하거나, Gatekeeper OPA/Kyverno를 사용하여 권한 제한 정책 적용

🔧 검증 코드

출력된 이미지 태그 버전이 0.15.0 미만인 경우 취약한 버전이 설치된 상태입니다.

Shell / Script
kubectl get deployment kustomize-controller -n flux-system -o jsonpath='{.spec.template.spec.containers[0].image}' | grep -E 'kustomize-controller:[0-1][0-4]\.'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Kubernetes