🇰🇷 한글 설명
GitPython 3.1.51 미만 버전에서 Repo.archive() 및 git.ls_remote() 호출 시 위험한 Git 옵션을 검증하지 않아 명령 주입 공격이 가능합니다. 또한 Repo.iter_commits()와 Repo.blame()에서 리비전 인자의 대시(-)를 체크하지 않아 임의의 파일을 열거나 내용을 삭제할 수 있는 취약점이 존재합니다.
💡 쉬운 설명
Git 관련 기능을 사용하는 프로그램에서 공격자가 악성 명령어를 몰래 끼워 넣어 컴퓨터를 마음대로 조종하거나 파일을 삭제할 수 있는 문제입니다. 사용자가 입력한 값이 검증 없이 Git 명령어로 전달될 때 발생합니다.
🇺🇸 원문 (English)
GitPython before 3.1.51 fails to guard against dangerous Git options passed as keyword arguments in Repo.archive() and git.ls_remote(), allowing command injection via options such as --exec/--upload-pack (leading to arbitrary command execution). Additionally, Repo.iter_commits() and Repo.blame() do not check for leading-dash revision arguments, so a revision like --output=<path> can cause Git to open and truncate an arbitrary file. Exploitation requires an application that passes attacker-controlled arguments to these methods.
📍 영향받는 시스템
GitPython 3.1.51 미만 모든 버전
⚔️ 공격 벡터
사용자 입력값이 검증 없이 Repo.archive(), git.ls_remote(), Repo.iter_commits(), Repo.blame() 등의 인자로 전달될 때 발생
🛡️ 대응 방법
GitPython 라이브러리를 최신 버전인 3.1.51 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 3.1.51보다 낮으면 취약한 상태입니다.
pip show gitpython | grep Version