🇰🇷 한글 설명
Beta9 워커의 샌드박스 파일 API는 컨테이너 외부에서 제공되며, 경로 정규화 과정에서 상위 디렉터리 세그먼트(..)와 심볼릭 링크가 적절히 차단되지 않아 워커 호스트의 임의 절대 경로에 접근할 수 있습니다. 이를 통해 테넌트가 워커 파일시스템에 root 권한으로 읽기, 쓰기, 삭제를 수행할 수 있으며, 워커 서비스 어카운트 토큰 탈취 시 cluster-admin 권한으로 클러스터 전체가 장악될 수 있습니다. 수정 버전은 worker 0.1.756입니다.
💡 쉬운 설명
사용자가 자신의 샌드박스 안에서 파일을 다루는 기능에 결함이 있어, 경로를 조작하면 파일을 호스팅하는 서버 전체의 파일에 접근할 수 있습니다. 그 결과 다른 사용자의 데이터와 클러스터 관리 권한까지 탈취될 수 있습니다.
🇺🇸 원문 (English)
The Beta9 worker serves the sandbox file API from outside the container. getHostPathFromContainerPath turns the tenant's container path into a worker path. If the unresolved path starts with a mount destination, including the default upload mount at /tmp/.beta9, the remainder is joined onto that mount's source with filepath.Join, which cleans parent-directory segments after the prefix check. A long enough run of those segments names any absolute path on the worker. A path that matches no mount is joined onto the container root and opened in the worker's own filesystem, so an absolute symbolic link such as /var/run pointing at /run is followed against the worker root. Upload, download, stat, list, find-in-files, replace-in-files, and delete-file all call this helper. A tenant with a workspace token and one running sandbox can read, write, list, and delete files on the hosting worker as root, including files of other tenants on that machine. A read-only proof downloaded the worker pod's Kubernetes service account token through the file API for a path that did not exist inside the sandbox. In the shipped remote-node manifests that service account is bound to cluster-admin. Fixed in worker 0.1.756: sandbox file operations and workspace sync open paths with os.OpenRoot, so parent-directory and symlink lookups stay inside the container root or the mount source.
📍 영향받는 시스템
Beta9 워커 0.1.756 미만 버전 (원격 노드 매니페스트 배포 환경)
⚔️ 공격 벡터
워크스페이스 토큰과 실행 중인 샌드박스 1개를 가진 테넌트가 ../ 세그먼트가 연속된 경로나 /var/run 같은 심볼릭 링크 경로로 파일 API를 호출해 워커의 임의 파일을 읽고 쓰고 삭제
🛡️ 대응 방법
Beta9 워커를 0.1.756 이상으로 업그레이드하고, 워커 서비스 어카운트의 cluster-admin 바인딩을 최소 권한으로 축소
🔧 검증 코드
출력된 beta9 워커 이미지 태그 버전이 0.1.756 미만이면 취약하며, 0.1.756 이상이면 패치가 적용된 것입니다. 결과가 없으면 해당 환경에 Beta9 워커가 배포되어 있지 않습니다.
kubectl get pods -A -o jsonpath='{range .items[*]}{.spec.containers[*].image}{"\n"}{end}' 2>/dev/null | grep -i beta9