🇰🇷 한글 설명
인증된 Kafka 주체가 어떤 권한도 없어도, IncrementalAlterConfigs 또는 AlterConfigs 요청으로 BROKER 리소스를 대상으로 설정 검증을 유발하면 ${file:...} 또는 ${env:...} 형태의 설정 변수를 통해 브로커 호스트의 파일과 환경변수 내용을 읽어 응답받을 수 있습니다. 이는 CVE-2024-31141의 허용목록 완화책을 우회합니다. 인가(authorizer)가 활성화된 클러스터에서 영향을 받으며, 파일 권한 범위 내에서 자격 증명·키스토어 등 비밀 정보가 노출될 수 있습니다.
💡 쉬운 설명
권한이 전혀 없는 사용자도 Kafka 서버에 특정 설정 요청을 보내 서버 안의 파일 내용이나 환경변수 값을 훔쳐볼 수 있는 취약점입니다. 비밀번호나 인증서 같은 민감 정보가 유출될 위험이 있습니다.
🇺🇸 원문 (English)
An authenticated Kafka principal with no authorization grants (not even ALTER_CONFIGS) can make a broker read a file or an environment variable from the broker host and return its contents. An IncrementalAlterConfigs (or AlterConfigs) request targeting a BROKER resource reaches the broker's configuration validation before any authorization check is applied to that path. Validation resolves configuration variables such as ${file:/path:key} or ${env:VAR} using a ConfigProvider named in the request, and this resolution bypasses the org.apache.kafka.automatic.config.providers allowlist that was added as the mitigation for CVE-2024-31141. An arbitrary ConfigProvider (for example FileConfigProvider or EnvVarConfigProvider) is therefore instantiated and the referenced file or environment variable is read, and a type-validation error returns the resolved content to the caller.
Impact:
On a cluster with an authorizer enabled, an authenticated principal with no authorization grants can read the contents of files accessible to the broker process, and the broker's environment variables, exposing credentials, keystores, or other secrets, defeating the CVE-2024-31141 allowlist. The read is bounded by the broker process's file permissions. The brokers and the cluster remain available; the issue is disclosure of file and environment- variable contents. Clusters with no authorizer configured are not affected in practice, because every principal already holds ALTER_CONFIGS there.
Mitigation:
Upgrade to Apache Kafka 4.2.2, 4.3.2, or 4.4.0. As defense in depth, run brokers under a least-privileged operating-system account so that sensitive files are not readable by the broker process.
Resolution:
From Apache Kafka 4.2.2, 4.3.2, and 4.4.0: broker configuration changes are authorized (ALTER_CONFIGS on the cluster) before the configuration is validated, and configuration- variable resolution enforces the config-providers allowlist.
📍 영향받는 시스템
Apache Kafka (인가 기능이 활성화된 클러스터; 4.2.2 미만, 4.3.2 미만, 4.4.0 미만 버전 - 수정 버전: 4.2.2, 4.3.2, 4.4.0 이상)
⚔️ 공격 벡터
인증된 Kafka 주체가 AlterConfigs/IncrementalAlterConfigs 요청에 ${file:/경로:키} 또는 ${env:변수} 형태를 넣어 브로커 설정 검증 과정에서 파일/환경변수 내용을 응답으로 받아냄
🛡️ 대응 방법
Apache Kafka 4.2.2, 4.3.2, 4.4.0 이상으로 업그레이드하고, 브로커 프로세스를 최소 권한 OS 계정으로 실행하여 민감 파일 접근을 제한
🔧 검증 코드
출력된 Kafka 버전이 4.2.2, 4.3.2, 4.4.0 이상이면 패치 적용된 것이며, 그보다 낮은 버전이면 업그레이드가 필요합니다.
kafka-topics.sh --version 2>/dev/null || ls /opt/kafka*/libs/kafka_*.jar 2>/dev/null | head -1