🇰🇷 한글 설명
BuildKit에서 병렬로 실행되는 두 개의 악성 빌드 단계가 동일한 하위 경로의 캐시 마운트를 공유할 때 레이스 컨디션이 발생할 수 있습니다. 이 취약점을 통해 빌드 컨테이너가 호스트 시스템의 파일에 접근할 수 있는 보안 문제가 발생합니다.
💡 쉬운 설명
빌드 도구의 설계 결함으로 인해, 나쁜 의도를 가진 빌드 명령이 실행될 때 컴퓨터 본체의 중요한 파일이 유출될 수 있는 문제입니다. 캐시 기능을 사용하는 과정에서 발생하는 충돌을 이용한 공격입니다.
🇺🇸 원문 (English)
BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. Two malicious build steps running in parallel sharing the same cache mounts with subpaths could cause a race condition that can lead to files from the host system being accessible to the build container. The issue has been fixed in v0.12.5. Workarounds include, avoiding using BuildKit frontend from an untrusted source or building an untrusted Dockerfile containing cache mounts with --mount=type=cache,source=... options.
📍 영향받는 시스템
BuildKit v0.12.5 미만 버전
⚔️ 공격 벡터
신뢰할 수 없는 Dockerfile 또는 BuildKit 프론트엔드를 사용하여 캐시 마운트 옵션(--mount=type=cache)을 포함한 빌드 수행
🛡️ 대응 방법
BuildKit을 v0.12.5 이상 버전으로 업데이트하거나, 신뢰할 수 없는 소스의 Dockerfile 및 캐시 마운트 사용을 금지함
🔧 검증 코드
출력된 BuildKit 버전이 v0.12.5 미만인 경우 취약한 상태임
docker buildx version | grep -E 'buildkit/v[0-9]+\.[0-9]+\.[0-9]+'