🇰🇷 한글 설명
Cap-go 12.128.2 이전 버전에는 GET /build/logs/:jobId 엔드포인트에서 권한 상승 취약점이 존재합니다. 읽기 전용 API 키 소유자가 로그 스트림을 열고 연결을 끊으면, 서버가 특권 BUILDER_API_KEY로 빌드를 취소하여 app.build_native 권한 검사를 우회합니다.
💡 쉬운 설명
읽기만 가능한 권한을 가진 사용자도 연결을 끊는 방식으로 실행 중인 네이티브 빌드를 강제로 중단시킬 수 있습니다. 이로 인해 CI/CD 작업이 반복적으로 방해받을 수 있습니다.
🇺🇸 원문 (English)
Cap-go before 12.128.2 contains a privilege inversion vulnerability in GET /build/logs/:jobId that allows read-only API key holders to cancel running native builds. The endpoint registers an abort listener on the SSE stream that unconditionally invokes cancelBuildOnDisconnect() using the privileged server-side BUILDER_API_KEY when clients disconnect, bypassing the app.build_native permission check required by the explicit POST /build/cancel/:jobId endpoint. Attackers with read-only API keys can repeatedly disrupt native build operations and CI/CD workflows by opening the log stream and dropping the connection.
📍 영향받는 시스템
Cap-go 12.128.2 미만 버전
⚔️ 공격 벡터
읽기 전용 API 키로 /build/logs/:jobId 스트림을 열고 연결을 끊어 서버가 특권 키로 빌드를 자동 취소하도록 유도
🛡️ 대응 방법
Cap-go를 12.128.2 이상으로 업데이트하고, 로그 스트림 연결 해제 시 취소 로직에 권한 검사를 적용
🔧 검증 코드
출력된 버전이 12.128.2 미만이면 취약하며, 12.128.2 이상이면 패치가 적용된 것입니다. 아무 결과도 없으면 해당 패키지가 설치되지 않은 것입니다.
cat package.json 2>/dev/null | grep -E '"@capgo/cli"|"cap-go"' || npm ls cap-go 2>/dev/null