🇰🇷 한글 설명
GitPython 3.1.56 미만 버전의 Commit.count() 메서드에서 인자 주입 취약점이 발견되었습니다. 공격자가 제어 가능한 옵션을 통해 'git rev-list --output=<path>' 명령을 실행하게 함으로써, 프로세스 권한으로 특정 파일을 0바이트로 만들어 내용을 삭제할 수 있습니다.
💡 쉬운 설명
프로그램이 사용자의 입력을 제대로 검사하지 않아, 공격자가 명령어를 조작해 컴퓨터 내의 중요한 파일을 빈 파일로 만들어버릴 수 있는 문제입니다. 파일의 내용을 바꿀 수는 없지만, 파일 내용을 모두 지워버려 시스템을 망가뜨릴 수 있습니다.
🇺🇸 원문 (English)
GitPython before 3.1.56 contains an argument injection vulnerability in the Commit.count() method, which forwards keyword arguments to 'git rev-list' without the check_unsafe_options guard present in the sibling iter_items method. An attacker who can control options passed to Commit.count (e.g., via an application that forwards a user-supplied options dict) can supply output=<path>, causing 'git rev-list --output=<path>' to open and truncate the target file to zero bytes before revision parsing. This allows destruction/blanking of an arbitrary file at the process's privilege level (no content control, 0-byte truncation).
📍 영향받는 시스템
GitPython versions prior to 3.1.56
⚔️ 공격 벡터
사용자로부터 입력받은 옵션 딕셔너리를 Commit.count() 메서드에 그대로 전달하여 인자 주입(Argument Injection) 수행
🛡️ 대응 방법
GitPython 라이브러리를 3.1.56 버전 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 Version이 3.1.56 미만이면 취약한 상태입니다.
pip show gitpython | grep Version