🇰🇷 한글 설명
Bare Metal Operator (BMO)의 BMCEventSubscription 리소스가 다른 네임스페이스의 Secrets을 로드할 수 있어 권한이 낮은 Kubernetes 사용자가 권한 없는 Secrets을 자신의 네임스페이스로 유출할 수 있는 보안 결함. 패치되지 않은 BMO는 네임스페이스 경계를 강제하지 않아 정보 노출 위험 증가.
💡 쉬운 설명
Kubernetes에서 낮은 권한의 사용자가 자신의 영역 안에서 다른 사람의 비밀 정보에 접근할 수 있는 문제. 네임스페이스라는 보안 경계가 제대로 작동하지 않아 발생합니다.
🇺🇸 원문 (English)
The Bare Metal Operator (BMO) implements a Kubernetes API for managing bare metal hosts in Metal3. Baremetal Operator enables users to load Secret from arbitrary namespaces upon deployment of the namespace scoped Custom Resource `BMCEventSubscription`. Prior to versions 0.8.1 and 0.9.1, an adversary Kubernetes account with only namespace level roles (e.g. a tenant controlling a namespace) may create a `BMCEventSubscription` in his authorized namespace and then load Secrets from his unauthorized namespaces to his authorized namespace via the Baremetal Operator, causing Secret Leakage. The patch makes BMO refuse to read Secrets from other namespace than where the corresponding BMH resource is. The patch does not change the `BMCEventSubscription` API in BMO, but stricter validation will fail the request at admission time. It will also prevent the controller reading such Secrets, in case the BMCES CR has already been deployed. The issue exists for all versions of BMO, and is patched in BMO releases v0.9.1 and v0.8.1. Prior upgrading to patched BMO version, duplicate any existing Secret pointed to by `BMCEventSubscription`'s `httpHeadersRef` to the same namespace where the corresponding BMH exists. After upgrade, remove the old Secrets. As a workaround, the operator can configure BMO RBAC to be namespace scoped, instead of cluster scoped, to prevent BMO from accessing Secrets from other namespaces, and/or use `WATCH_NAMESPACE` configuration option to limit BMO to single namespace.
📍 영향받는 시스템
Bare Metal Operator (BMO) v0.8.0 이하 및 v0.9.0 이하 (v0.8.1, v0.9.1 이상에서 패치됨)
⚔️ 공격 벡터
낮은 권한의 Kubernetes 계정이 자신의 네임스페이스에서 BMCEventSubscription을 생성하여 spec.httpHeadersRef 필드로 다른 네임스페이스의 Secrets 참조
🛡️ 대응 방법
Bare Metal Operator를 v0.8.1 이상 또는 v0.9.1 이상으로 업그레이드하고 기존 Secrets을 같은 네임스페이스로 복제 후 삭제, 또는 RBAC를 네임스페이스 스코프로 제한
🔧 검증 코드
VULNERABLE이 출력되면 취약한 BMO 버전 설치 상태, PATCHED이면 패치된 버전 또는 BMO가 설치되지 않은 상태. 출력이 없으면 Kubernetes 환경에서 BMO를 찾을 수 없는 상태.
kubectl get pods -A -o jsonpath='{..containers[?(@.image=~".*baremetal-operator.*")].image}' 2>/dev/null | grep -qE 'v0\.[0-7]\.|v0\.8\.0|v0\.9\.0' && echo VULNERABLE || echo PATCHED