🇰🇷 한글 설명
Azure/setup-kubectl GitHub Action의 3.0 미만 버전에서 발생하는 취약점입니다. Kubectl 바이너리 생성 시 권한을 777로 설정하여, 동일한 러너 내의 다른 사용자가 바이너리를 악의적으로 교체할 수 있습니다. 이를 통해 kubectl을 실행하는 사용자(주로 root)로 권한 상승이 가능합니다.
💡 쉬운 설명
설치 프로그램이 파일을 누구나 수정할 수 있게 너무 느슨한 권한으로 만들어두는 실수입니다. 이로 인해 해커가 정상적인 도구를 가짜 도구로 바꿔치기하여 컴퓨터의 관리자 권한을 뺏을 수 있습니다.
🇺🇸 원문 (English)
Azure/setup-kubectl is a GitHub Action for installing Kubectl. This vulnerability only impacts versions before version 3. An insecure temporary creation of a file allows other actors on the Actions runner to replace the Kubectl binary created by this action because it is world writable. This Kubectl tool installer runs `fs.chmodSync(kubectlPath, 777)` to set permissions on the Kubectl binary, however, this allows any local user to replace the Kubectl binary. This allows privilege escalation to the user that can also run kubectl, most likely root. This attack is only possible if an attacker somehow breached the GitHub actions runner or if a user is utilizing an Action that maliciously executes this attack. This has been fixed and released in all versions `v3` and later. 775 permissions are used instead. Users are advised to upgrade. There are no known workarounds for this issue.
📍 영향받는 시스템
Azure/setup-kubectl version < 3
⚔️ 공격 벡터
동일한 GitHub Actions 러너 내에서 로컬 사용자가 세계 쓰기 권한(world-writable)을 이용해 바이너리 교체
🛡️ 대응 방법
Azure/setup-kubectl을 v3 이상의 최신 버전으로 업그레이드
🔧 검증 코드
명령어 결과에 777 권한 설정 코드가 나타나면 취약한 버전이며, 나타나지 않으면 조치된 상태입니다.
grep -r "chmodSync(kubectlPath, 777)" . || echo "Not found or fixed"