🇰🇷 한글 설명
다운로드와 빌드하는 모듈에 악의적인 버전 문자열이 포함되어 있으면 로컬 코드 실행이 발생할 수 있다. Mercurial(hg)가 설치된 시스템에서 비표준 소스(예: 사용자 지정 도메인)에서 모듈을 다운로드하면 외부 VCS 명령어가 구성되는 방식으로 인해 예기치 않은 코드 실행이 발생할 수 있다. Git이 설치된 시스템에서 악의적인 버전 문자열을 사용하여 모듈을 다운로드하고 빌드하면 공격자가 파일 시스템의 임의 파일에 쓸 수 있다.
💡 쉬운 설명
악의적인 버전 문자열을 사용하여 모듈을 다운로드하고 빌드하면 로컬 코드 실행이 발생할 수 있으며, Mercurial(hg) 또는 Git이 설치된 시스템에서 발생할 수 있다. 이는 시스템의 보안을 위협할 수 있다. 사용자는 공식적인 채널을 통해 모듈을 다운로드하고, 버전 문자열을 신중하게 제공해야 한다.
🇺🇸 원문 (English)
Downloading and building modules with malicious version strings can cause local code execution. On systems with Mercurial (hg) installed, downloading modules from non-standard sources (e.g., custom domains) can cause unexpected code execution due to how external VCS commands are constructed. This issue can also be triggered by providing a malicious version string to the toolchain. On systems with Git installed, downloading and building modules with malicious version strings can allow an attacker to write to arbitrary files on the filesystem. This can only be triggered by explicitly providing the malicious version strings to the toolchain and does not affect usage of @latest or bare module paths.
📍 영향받는 시스템
Mercurial(hg) 또는 Git이 설치된 시스템
⚔️ 공격 벡터
악의적인 버전 문자열을 사용하여 모듈을 다운로드하고 빌드하는 것
🛡️ 대응 방법
공식적인 채널을 통해 모듈을 다운로드하고, 버전 문자열을 신중하게 제공하며, 시스템의 보안을 강화하는 것
🔧 검증 코드
로컬 시스템에서 Git이 설치되어 있는지 확인하는 코드입니다. Python 3.x가 설치되어 있어야 합니다. 코드를 실행하기 전에 관리자 권한을 획득해야 합니다. 코드를 실행한 후, JSON 형식의 결과가 출력됩니다.
python -c "import subprocess; result = subprocess.run(['git', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE); if result.returncode == 0: print('{{"result": "취약", "reason": "Git이 설치되어 있습니다."}}'); else: print('{{"result": "양호", "reason": "Git이 설치되어 있지 않습니다."}}')"