🇰🇷 한글 설명
virtualenv 21.14.9 미만 버전에서 ViaTemplateActivator._generate()와 PyEnvCfg.write() 함수가 기존 심볼릭 링크나 하드 링크를 적절히 처리하지 못하는 취약점이 발견되었습니다. 이로 인해 로컬 공격자가 생성된 활성화 콘텐츠를 가로채거나, 요청된 디렉토리 외부의 파일을 공격자의 의도대로 덮어쓰도록 유도할 수 있습니다.
💡 쉬운 설명
파이썬 가상 환경을 만드는 도구에서 파일 연결 방식의 허점을 이용해, 원래 만들어야 할 위치가 아닌 엉뚱한 곳에 파일을 만들거나 내용을 바꿀 수 있는 문제입니다. 같은 컴퓨터를 사용하는 다른 사용자가 이 취약점을 이용해 사용자의 권한으로 파일을 조작할 수 있습니다.
🇺🇸 원문 (English)
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, ViaTemplateActivator._generate() removes an existing output only when Path.exists() is true, allowing a dangling symlink to survive and redirect generated activation content, while PyEnvCfg.write() opens pyvenv.cfg without first replacing an existing symbolic or hard link. Another local account that prepares final entries inside the destination can therefore cause environment creation to create or overwrite files outside the requested tree with constrained virtualenv-generated content and the invoking user's permissions. The destination parent must remain controlled by the environment owner during creation; concurrent parent-directory replacement is a separate concern. This issue is fixed in version 21.14.9.
📍 영향받는 시스템
virtualenv version < 21.14.9
⚔️ 공격 벡터
로컬 계정을 통한 심볼릭 링크(Dangling Symlink) 조작 및 파일 경로 재지정
🛡️ 대응 방법
virtualenv를 최신 버전인 21.14.9 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 Version 값이 21.14.9보다 낮으면 취약한 버전입니다.
pip show virtualenv | grep Version