🔍 CVE-2022-21668

8.0
CVSS Score
HIGH
2022-01-10
2026-06-17 04:26
✅ 완료

🇰🇷 한글 설명

pipenv의 requirements.txt 파일 파싱 결함으로 인해 공격자가 주석 내에 악의적인 명령어를 삽입할 수 있습니다. 이를 통해 사용자가 패키지를 설치할 때 공격자가 제어하는 서버에서 악성 패키지를 다운로드하게 하여 원격 코드 실행(RCE)을 유발할 수 있습니다.

💡 쉬운 설명

설치 파일 안에 몰래 숨겨진 명령어가 있어, 개발자가 평소처럼 프로그램을 설치하다가 해커의 컴퓨터에 접속 권한을 넘겨줄 수 있는 보안 약점입니다. 해커가 만든 가짜 프로그램이 설치되면서 컴퓨터가 해킹당할 수 있습니다.

🇺🇸 원문 (English)

pipenv is a Python development workflow tool. Starting with version 2018.10.9 and prior to version 2022.1.8, a flaw in pipenv's parsing of requirements files allows an attacker to insert a specially crafted string inside a comment anywhere within a requirements.txt file, which will cause victims who use pipenv to install the requirements file to download dependencies from a package index server controlled by the attacker. By embedding malicious code in packages served from their malicious index server, the attacker can trigger arbitrary remote code execution (RCE) on the victims' systems. If an attacker is able to hide a malicious `--index-url` option in a requirements file that a victim installs with pipenv, the attacker can embed arbitrary malicious code in packages served from their malicious index server that will be executed on the victim's host during installation (remote code execution/RCE). When pip installs from a source distribution, any code in the setup.py is executed by the install process. This issue is patched in version 2022.1.8. The GitHub Security Advisory contains more information about this vulnerability.

📍 영향받는 시스템

pipenv version 2018.10.9 ~ 2022.1.7

⚔️ 공격 벡터

requirements.txt 파일의 주석 부분에 악의적인 --index-url 옵션을 삽입하여 공격자의 패키지 인덱스 서버로 유도

🛡️ 대응 방법

pipenv를 최신 버전인 2022.1.8 이상으로 업데이트

🔧 검증 코드

출력된 버전이 2022.1.8 미만인 경우 취약한 버전이 설치되어 있는 상태입니다.

Shell / Script
pipenv --version | grep -E '2022.1.[0-7]|201[0-9]|202[0-1]'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H

💻 영향받는 소프트웨어

Python