🇰🇷 한글 설명
GitPython 3.1.30~3.1.47 미만 버전에서 위험한 Git 옵션을 차단하지만, 동등한 Python kwargs를 통해 이 검사를 우회할 수 있습니다. 공격자가 제어하는 upload_pack 또는 receive_pack kwargs를 Repo.clone_from(), Remote.fetch(), Remote.pull(), Remote.push()에 전달하면 allow_unsafe_options이 기본값(False)일 때도 임의 코드 실행이 가능합니다.
💡 쉬운 설명
GitPython 라이브러리가 위험한 명령어를 차단하려 했지만, 다른 방식으로는 그 차단을 우회할 수 있습니다. 악의적인 입력을 통해 공격자는 시스템에서 임의의 프로그램을 실행할 수 있습니다.
🇺🇸 원문 (English)
GitPython is a python library used to interact with Git repositories. From version 3.1.30 to before version 3.1.47, GitPython blocks dangerous Git options such as --upload-pack and --receive-pack by default, but the equivalent Python kwargs upload_pack and receive_pack bypass that check. If an application passes attacker-controlled kwargs into Repo.clone_from(), Remote.fetch(), Remote.pull(), or Remote.push(), this leads to arbitrary command execution even when allow_unsafe_options is left at its default value of False. This issue has been patched in version 3.1.47.
📍 영향받는 시스템
GitPython 3.1.30 ~ 3.1.46
⚔️ 공격 벡터
공격자 제어 kwargs(upload_pack, receive_pack)를 Repo.clone_from(), Remote.fetch(), Remote.pull(), Remote.push()에 전달
🛡️ 대응 방법
GitPython을 3.1.47 이상으로 업그레이드
🔧 검증 코드
버전 3.1.47 이상이면 패치된 상태이고, 3.1.46 이하면 취약한 상태입니다.
pip show gitpython 2>/dev/null | grep Version | awk '{print $2}'