🇰🇷 한글 설명
virtualenv 20.26.6부터 21.14.2 버전 사이에서 ViaTemplateActivator.instantiate_template() 함수가 템플릿의 플레이스홀더를 순차적으로 교체하는 과정에서 보안 취약점이 발견되었습니다. 공격자가 환경 경로 또는 프롬프트에 특정 트리거 이름을 포함시키면, 이후 단계에서 인용 부호를 닫고 임의의 명령어를 실행할 수 있는 명령 주입 공격이 가능합니다.
💡 쉬운 설명
파이썬 가상 환경을 만들 때 사용하는 도구에 결함이 있어, 악의적으로 조작된 경로를 사용하면 가상 환경을 활성화하는 순간 해커의 명령어가 실행될 수 있습니다. 사용자가 설치하는 폴더 이름이나 프롬프트 설정에 특수 문자가 포함되어 있으면 위험합니다.
🇺🇸 원문 (English)
virtualenv is a tool for creating isolated virtual python environments. From 20.26.6 until 21.14.2, ViaTemplateActivator.instantiate_template() replaces placeholders one key at a time across the complete activation template, so trigger names such as __VIRTUAL_NAME__, __VIRTUAL_ENV__, or __VIRTUAL_PROMPT__ inside an already substituted and quoted environment path or prompt can be replaced during a later pass. The later value's quoting can close the earlier literal and execute the remaining path when a user activates the environment through bash, fish, xonsh, or activate_this.py. The distinct csh prompt-display token __VIRTUAL_PROMPT_DISPLAY_TCSH__ can instead break the generated script without establishing command execution. The attacker must influence the destination path or --prompt, and a value without a relevant placeholder name does not trigger this mechanism. This issue is fixed in version 21.14.2.
📍 영향받는 시스템
virtualenv versions 20.26.6 through 21.14.2
⚔️ 공격 벡터
공격자가 조작된 경로명이나 --prompt 인자를 통해 특정 플레이스홀더를 포함한 값을 전달하여 명령 실행 유도
🛡️ 대응 방법
virtualenv를 21.14.2 이상의 최신 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 21.14.2 미만(20.26.6 ~ 21.14.1)인 경우 취약한 상태입니다.
pip show virtualenv | grep Version