🇰🇷 한글 설명
Python 의존성 관리 도구인 Poetry에서 Git 저장소 URL을 처리할 때 발생하는 취약점입니다. 공격자가 입력값 앞에 대시(-)를 붙여 명령어를 조작하면, Poetry가 이를 옵션 인자로 오인하여 임의의 코드를 실행할 수 있습니다. 이로 인해 개발자의 자격 증명이 탈취되거나 시스템 권한이 탈취될 위험이 있습니다.
💡 쉬운 설명
Poetry라는 프로그램이 외부 저장소 주소를 읽을 때, 주소 대신 특수한 명령어를 입력하면 프로그램이 이를 명령으로 착각해 실행해버리는 문제입니다. 이를 통해 해커가 사용자의 컴퓨터에서 몰래 나쁜 프로그램을 실행할 수 있습니다.
🇺🇸 원문 (English)
Poetry is a dependency manager for Python. When handling dependencies that come from a Git repository instead of a registry, Poetry uses various commands, such as `git clone`. These commands are constructed using user input (e.g. the repository URL). When building the commands, Poetry correctly avoids Command Injection vulnerabilities by passing an array of arguments instead of a command string. However, there is the possibility that a user input starts with a dash (`-`) and is therefore treated as an optional argument instead of a positional one. This can lead to Code Execution because some of the commands have options that can be leveraged to run arbitrary executables. If a developer is exploited, the attacker could steal credentials or persist their access. If the exploit happens on a server, the attackers could use their access to attack other internal systems. Since this vulnerability requires a fair amount of user interaction, it is not as dangerous as a remotely exploitable one. However, it still puts developers at risk when dealing with untrusted files in a way they think is safe, because the exploit still works when the victim tries to make sure nothing can happen, e.g. by vetting any Git or Poetry config files that might be present in the directory. Versions 1.1.9 and 1.2.0b1 contain patches for this issue.
📍 영향받는 시스템
Poetry 1.1.9 미만 및 1.2.0b1 미만 버전
⚔️ 공격 벡터
신뢰할 수 없는 Git 저장소 URL을 포함한 설정 파일을 사용하여 Poetry 명령어를 실행하도록 유도
🛡️ 대응 방법
Poetry를 1.1.9 또는 1.2.0b1 이상의 최신 버전으로 업데이트
🔧 검증 코드
출력된 버전이 1.1.9 또는 1.2.0b1보다 낮으면 취약한 상태입니다.
poetry --version | grep -E '1.1.9|1.2.0b1|(?!(1.1.9|1.2.0b1))'