🇰🇷 한글 설명
GitPython 3.1.47 이전 버전의 _clone() 함수에서 multi_options 검증이 불충분하여, 공격자가 악의적인 Git 설정(예: core.hooksPath)을 주입할 수 있습니다. Clone 작업 중 주입된 Hook이 실행되어 임의의 코드 실행으로 이어질 수 있습니다.
💡 쉬운 설명
GitPython 라이브러리에서 저장소를 복제할 때 악의적인 설정이 몰래 포함될 수 있습니다. 이로 인해 복제 과정에서 공격자의 코드가 자동으로 실행될 수 있습니다.
🇺🇸 원문 (English)
GitPython is a python library used to interact with Git repositories. Prior to version 3.1.47, _clone() validates multi_options as the original list, then executes shlex.split(" ".join(multi_options)). A string like "--branch main --config core.hooksPath=/x" passes validation (starts with --branch), but after split becomes ["--branch", "main", "--config", "core.hooksPath=/x"]. Git applies the config and executes attacker hooks during clone. This issue has been patched in version 3.1.47.
📍 영향받는 시스템
GitPython < 3.1.47 (Python 라이브러리)
⚔️ 공격 벡터
Clone 요청 시 multi_options 파라미터에 --config core.hooksPath 주입으로 임의 Hook 실행 유도
🛡️ 대응 방법
GitPython을 3.1.47 이상으로 업그레이드
🔧 검증 코드
출력된 GitPython 버전이 3.1.47 이상이면 안전하며, 3.1.47 미만이면 즉시 업그레이드 필요
python3 -c "import git; print(git.__version__)" 2>/dev/null || pip list | grep -i gitpython