🇰🇷 한글 설명
CloudNativePG의 특정 버전에서 superuser 연결 시 search_path를 고정하지 않아 발생하는 보안 취약점입니다. DATABASE OWNER 권한을 가진 사용자가 public 스키마에 조작된 연산자를 생성하여, 인스턴스 매니저가 superuser 권한으로 공격자가 제어하는 함수를 실행하도록 유도할 수 있습니다. 이를 통해 운영체제 명령 실행 및 ServiceAccount 토큰 탈취가 가능합니다.
💡 쉬운 설명
데이터베이스 관리 도구가 권한을 확인하는 과정에서 보안 설정이 미흡하여 발생하는 문제입니다. 악의적인 사용자가 데이터베이스 설정을 조작해 관리자 권한을 가로채고 서버를 직접 조종할 수 있습니다.
🇺🇸 원문 (English)
CloudNativePG is a platform designed to manage PostgreSQL databases within Kubernetes environments. Prior to 1.28.4 and 1.29.2, CloudNativePG opened superuser connections without pinning search_path in fillDefaultParameters in pkg/management/postgres/pool/profiles.go. A role holding DATABASE OWNER could create overloaded built-in operators in the public schema and change the database or role search_path, causing instance-manager introspection queries such as SELECT COUNT(*) > 0 FROM pg_catalog.pg_extension WHERE extname = $1 to execute attacker-controlled functions as the postgres superuser. The same trust issue affected direct sql.Open("pgx", ...) callsites and the public.user_search SECURITY DEFINER function, enabling PostgreSQL superuser access, operating system command execution through COPY ... FROM PROGRAM, and access to the pod ServiceAccount token. This issue is fixed in versions 1.28.4, 1.29.2, and 1.30.0.
📍 영향받는 시스템
CloudNativePG versions prior to 1.28.4, 1.29.2, and 1.30.0
⚔️ 공격 벡터
DATABASE OWNER 권한을 이용한 public 스키마 내 오버로딩된 연산자 생성 및 search_path 조작
🛡️ 대응 방법
CloudNativePG를 1.28.4, 1.29.2 또는 1.30.0 이상의 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 CloudNativePG의 버전이 1.28.4, 1.29.2 또는 1.30.0보다 낮은지 확인하십시오.
helm list -A | grep cloudnative-pg | awk '{print $4}'