🇰🇷 한글 설명
Nx 모노레포 솔루션의 @nx/docker 플러그인에서 설정값(repositoryName, registryUrl)을 쉘 명령어로 직접 처리하는 과정에서 명령 주입 취약점이 발견되었습니다. 공격자가 신뢰할 수 없는 설정을 통해 nx release 명령 실행 시 임의의 쉘 명령을 실행할 수 있으며, 이를 통해 레지스트리 자격 증명이나 클라우드 토큰을 탈취할 수 있습니다.
💡 쉬운 설명
Nx라는 도구를 사용할 때 설정 파일에 악성 명령어를 숨겨두면, 프로그램이 이를 실행하면서 해커의 명령을 대신 수행할 수 있는 문제입니다. 이를 통해 중요한 비밀번호나 인증 정보를 해커에게 빼앗길 위험이 있습니다.
🇺🇸 원문 (English)
Nx is a monorepo solution for TypeScript and polyglot codebases. From 21.4.0 until 22.7.8 and from 23.0.0 until 23.1.1, the @nx/docker release pipeline builds docker tag, image lookup, and docker push invocations as shell command strings. The release.docker.repositoryName and registryUrl configuration values are interpolated into those strings and passed to /bin/sh -c, allowing shell syntax in untrusted Nx configuration to execute during nx release version or nx release publish. A pull request or repository configuration change can therefore execute commands with the release job's privileges and expose registry credentials or cloud tokens, and dry-run publishing does not prevent the vulnerable pre-check command from executing. This issue is fixed in versions 22.7.8 and 23.1.1.
📍 영향받는 시스템
Nx @nx/docker (21.4.0 ~ 22.7.8 미만, 23.0.0 ~ 23.1.1 미만)
⚔️ 공격 벡터
Pull Request 또는 저장소 설정을 통해 악의적인 구성 값을 주입하여 nx release 명령 실행 시 쉘 명령 실행
🛡️ 대응 방법
Nx 버전을 22.7.8 또는 23.1.1 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 22.7.8 이상 또는 23.1.1 이상인지 확인하여 취약 여부를 판단합니다.
npx nx --version | grep -E '^(22\.7\.[8-9]|23\.1\.[1-9])|[22-23]\.'